/**
 * ZTTeam Contact Form - CSS riêng
 * Tất cả style nằm trong scope .ztteam-contact-wrapper
 * Prefix: zt-
 *
 * @package ZTTeam_Contact
 * @since 1.0.0
 */

/** CSS Variables */
.ztteam-contact-wrapper {
    --zt-primary: #2563eb;
    --zt-primary-hover: #1d4ed8;
    --zt-primary-light: #eff6ff;
    --zt-primary-rgb: 37, 99, 235;
    --zt-success: #10b981;
    --zt-success-light: #ecfdf5;
    --zt-danger: #ef4444;
    --zt-gray-50: #f9fafb;
    --zt-gray-100: #f3f4f6;
    --zt-gray-200: #e5e7eb;
    --zt-gray-400: #9ca3af;
    --zt-gray-500: #6b7280;
    --zt-gray-600: #4b5563;
    --zt-gray-700: #374151;
    --zt-gray-800: #1f2937;
    --zt-radius: 12px;
    --zt-radius-lg: 16px;
    --zt-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

.ztteam-contact-wrapper *,
.ztteam-contact-wrapper *::before,
.ztteam-contact-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/** TĂNG SPECIFICITY CHỐNG GHI ĐÈ BẰNG ID + CLASS DÀI 
 * Trọng số rất cao: 1 ID, nhiều tag, nhiều class 
 */
#ztteam-contact-wrapper.ztteam-contact-wrapper form.zt-form-body .zt-input-wrap input.zt-input.zt-input-high-spec {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--zt-gray-200);
    border-radius: var(--zt-radius);
    font-size: 14px;
    color: var(--zt-gray-800);
    background: #fff;
    outline: none;
    transition: var(--zt-transition);
    font-family: inherit;
    box-shadow: none;
    margin: 0;
    height: auto;
    line-height: 1.5;
    max-width: none;
    display: block;
}

#ztteam-contact-wrapper.ztteam-contact-wrapper form.zt-form-body .zt-input-wrap input.zt-input.zt-input-high-spec:focus {
    border-color: var(--zt-primary);
    box-shadow: 0 0 0 3px rgba(var(--zt-primary-rgb), 0.1);
}

#ztteam-contact-wrapper.ztteam-contact-wrapper form.zt-form-body .zt-input-wrap input.zt-input.zt-input-high-spec::placeholder {
    color: var(--zt-gray-400);
    opacity: 1;
}

/** Inline Field Error */
#ztteam-contact-wrapper.ztteam-contact-wrapper .zt-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.zt-field-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    padding-left: 2px;
    animation: ztFieldErrorIn 0.25s ease-out;
}

@keyframes ztFieldErrorIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/** Trigger Button (Nút ngoài cùng) */
.zt-btn-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--zt-primary), var(--zt-primary-hover));
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(var(--zt-primary-rgb), 0.25);
    transition: var(--zt-transition);
    font-family: inherit;
}

/** Trigger Button Color Variants */
.zt-btn-trigger.zt-btn-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.zt-btn-trigger.zt-btn-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.zt-btn-trigger.zt-btn-yellow {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.zt-btn-trigger svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zt-btn-trigger:hover {
    box-shadow: 0 6px 16px rgba(var(--zt-primary-rgb), 0.35);
    transform: translateY(-2px);
}

/** Modal Overlay */
.zt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 24, 39, 0.5);
    /* bg-gray-900/50 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zt-modal-overlay.zt-show {
    opacity: 1;
    visibility: visible;
}

/** Modal Content / Card */
.zt-modal-content.zt-card {
    background: #fff;
    border-radius: var(--zt-radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    position: relative;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.zt-modal-overlay.zt-show .zt-modal-content.zt-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/** Close Button */
.zt-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.zt-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.zt-modal-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/** Card Header */
.zt-card-header {
    background: linear-gradient(135deg, var(--zt-primary), var(--zt-primary-hover));
    padding: 24px 32px;
    text-align: center;
    flex-shrink: 0;
}

.zt-card-header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--zt-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.zt-card-header-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zt-card-header .zt-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.zt-card-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/** Form Body */
.zt-form-body {
    padding: 24px 32px;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .zt-form-body {
        padding: 20px 16px;
    }

    .zt-card-header {
        padding: 20px 16px;
    }
}

/** Form Group */
.zt-form-group {
    margin-bottom: 16px;
}

.zt-form-group:last-of-type {
    margin-bottom: 20px;
}

/** Label */
.zt-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--zt-gray-700);
    margin-bottom: 6px;
}

.zt-label .zt-required {
    color: var(--zt-danger);
    margin-left: 2px;
}

/** Input Wrapper */
.zt-input-wrap {
    position: relative;
    display: block;
}

.zt-input-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--zt-gray-400);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    z-index: 2;
}

/** Submit Button */
.zt-btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--zt-primary), var(--zt-primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--zt-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--zt-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(var(--zt-primary-rgb), 0.25);
    font-family: inherit;
}

.zt-btn-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zt-btn-submit:hover {
    box-shadow: 0 6px 16px rgba(var(--zt-primary-rgb), 0.35);
    transform: translateY(-1px);
}

.zt-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/** Spinning animation */
@keyframes zt-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.zt-spin svg {
    animation: zt-spin 1s linear infinite;
}

/** Success State */
.zt-success-wrap {
    padding: 32px;
    text-align: center;
    display: none;
}

.zt-success-wrap.zt-visible {
    display: block;
}

.zt-success-icon {
    width: 64px;
    height: 64px;
    background: var(--zt-success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.zt-success-icon svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: var(--zt-success);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zt-success-wrap h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--zt-gray-800);
    margin: 0 0 8px;
}

.zt-success-wrap p {
    font-size: 14px;
    color: var(--zt-gray-500);
    margin: 0;
}

.zt-btn-reset {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--zt-primary);
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--zt-transition);
}

.zt-btn-reset:hover {
    color: var(--zt-primary-hover);
}

.zt-btn-reset svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/** Toast */
.zt-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 12px 20px;
    border-radius: var(--zt-radius);
    font-size: 14px;
    color: #fff;
    z-index: 9999999;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s;
    font-family: inherit;
}

.zt-toast-error {
    background: var(--zt-danger);
}

.zt-toast svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/** Hidden */
.zt-hidden {
    display: none !important;
}

/** ----------------------------------------------------
 * Fixed Bottom Styles (All Screens)
 * ---------------------------------------------------*/
.zt-fixed-bottom-wrapper {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    padding: 12px 16px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
}

.zt-fixed-bottom-col {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/** Override Button cho Fixed Bottom */
.zt-fixed-bottom-wrapper .zt-btn-trigger {
    padding: 12px 28px;
    justify-content: center;
    font-size: 14px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/** Cột 2 custom */
.zt-fixed-bottom-col-custom {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zt-fixed-bottom-col-custom a,
.zt-fixed-bottom-col-custom button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: var(--zt-transition);
    white-space: nowrap;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/** Red Variant */
.zt-fixed-bottom-col-custom a.zt-color-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.zt-fixed-bottom-col-custom a.zt-color-red:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

/** Yellow Variant */
.zt-fixed-bottom-col-custom a.zt-color-yellow {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.zt-fixed-bottom-col-custom a.zt-color-yellow:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.4);
}

/** Blue Variant */
.zt-fixed-bottom-col-custom a.zt-color-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.zt-fixed-bottom-col-custom a.zt-color-blue:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}

/** Mobile: full width, có nền, 2 cột đều nhau */
@media (max-width: 767px) {
    body {
        padding-bottom: 70px !important;
    }

    .zt-fixed-bottom-wrapper {
        background: #ffffff;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        padding: 10px;
        pointer-events: auto;
    }

    .zt-fixed-bottom-col {
        flex: 1;
        min-width: 0;
    }

    .zt-fixed-bottom-wrapper .zt-btn-trigger {
        width: 100%;
        padding: 10px 16px;
        border-radius: 8px;
        box-shadow: none;
    }

    .zt-fixed-bottom-col-custom a,
    .zt-fixed-bottom-col-custom button {
        width: 100%;
        padding: 10px 16px;
        border-radius: 8px;
        box-shadow: none;
    }
}