/**
 * Xu Dừa Contact Form Pro Styles
 * Giao diện biểu mẫu liên hệ cao cấp, bảo mật và responsive
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* ==========================================================================
   Typography Master Override - Ngăn chặn triệt để lỗi font chữ tiếng Việt từ theme
   ========================================================================== */
.xudua-contact-wrapper,
.xudua-contact-wrapper *:not(.dashicons),
.xudua-contact-wrapper input,
.xudua-contact-wrapper textarea,
.xudua-contact-wrapper button,
.xudua-contact-wrapper select,
.xudua-contact-wrapper label,
.xudua-contact-wrapper h1,
.xudua-contact-wrapper h2,
.xudua-contact-wrapper h3,
.xudua-contact-wrapper h4,
.xudua-contact-wrapper p,
.xudua-contact-wrapper div,
.xudua-thankyou-wrapper,
.xudua-thankyou-wrapper *:not(.dashicons),
.xudua-thankyou-wrapper h1,
.xudua-thankyou-wrapper h2,
.xudua-thankyou-wrapper h3,
.xudua-thankyou-wrapper p,
.xudua-thankyou-wrapper a,
.xudua-thankyou-wrapper button,
.xudua-thankyou-card,
.xudua-thankyou-title,
.xudua-thankyou-subtitle,
.xudua-thankyou-body,
.xudua-thankyou-body p,
.xudua-btn-thankyou-home,
.xudua-btn-thankyou-repeat {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    box-sizing: border-box;
}

/* Bảo toàn Icon Dashicons không bị đè font */
.xudua-contact-wrapper .dashicons,
.xudua-contact-wrapper .dashicons::before,
.xudua-thankyou-wrapper .dashicons,
.xudua-thankyou-wrapper .dashicons::before {
    font-family: dashicons !important;
    display: inline-block;
    line-height: 1;
    font-weight: 400;
    font-style: normal;
    speak: never;
    text-decoration: inherit;
    text-transform: none;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.xudua-contact-wrapper {
    width: 100%;
    max-width: 780px;
    margin: 25px auto;
}

.xudua-contact-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 35px 38px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.3s ease;
}

.xudua-contact-card:hover {
    box-shadow: 0 16px 36px -4px rgba(2, 132, 199, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

.xudua-contact-header {
    margin-bottom: 26px;
    text-align: center;
}

.xudua-contact-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.xudua-contact-desc {
    margin: 0;
    font-size: 14.5px;
    color: #64748b;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Alert Notification Banners */
.xudua-contact-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 22px;
    display: none;
    animation: xuduaAlertIn 0.3s ease forwards;
}

.xudua-contact-alert.is-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    display: block;
}

.xudua-contact-alert.is-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    display: block;
}

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

/* Form Layout */
.xudua-contact-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.xudua-contact-col {
    flex: 1 1 50%;
    min-width: 0;
}

.xudua-contact-group {
    margin-bottom: 18px;
}

.xudua-form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

.xudua-required {
    color: #e11d48;
    font-weight: 700;
    margin-left: 2px;
}

/* Input Fields */
.xudua-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.xudua-input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 18px;
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.xudua-form-control {
    width: 100%;
    height: 46px;
    padding: 10px 14px 10px 42px;
    font-size: 14.5px;
    color: #0f172a;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.xudua-input-wrap.textarea-wrap .xudua-form-control {
    height: auto;
    padding-left: 16px;
    resize: vertical;
    min-height: 120px;
}

.xudua-form-control:focus {
    background-color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.xudua-form-control:focus + .xudua-input-icon,
.xudua-input-wrap:focus-within .xudua-input-icon {
    color: #0284c7;
}

.xudua-form-control.is-invalid {
    border-color: #e11d48 !important;
    background-color: #fff1f2 !important;
}

/* CAPTCHA Box */
.xudua-contact-captcha-box {
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.xudua-captcha-flex {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.xudua-captcha-badge {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.xudua-captcha-q {
    font-size: 16px;
    font-weight: 700;
    color: #0284c7;
    letter-spacing: 1.5px;
    user-select: none;
}

.xudua-btn-refresh-captcha {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #64748b;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.xudua-btn-refresh-captcha:hover {
    color: #0284c7;
    background: #f1f5f9;
}

.xudua-btn-refresh-captcha.spin .dashicons {
    animation: xuduaSpin 0.6s linear infinite;
}

.xudua-input-captcha {
    width: 140px !important;
    padding-left: 14px !important;
    text-align: center;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Footer & Buttons */
.xudua-contact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 6px;
}

.xudua-contact-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all 0.25s ease;
    min-width: 160px;
}

.xudua-contact-submit-btn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
    transform: translateY(-1px);
}

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

.xudua-contact-submit-btn.is-loading .xudua-btn-icon {
    animation: xuduaSpin 0.7s linear infinite;
}

.xudua-contact-privacy {
    font-size: 12.5px;
    color: #64748b;
}

@keyframes xuduaSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Mobile */
@media (max-width: 640px) {
    .xudua-contact-card {
        padding: 24px 20px;
    }
    .xudua-contact-row {
        flex-direction: column;
        gap: 14px;
        margin-bottom: 14px;
    }
    .xudua-contact-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .xudua-contact-submit-btn {
        width: 100%;
    }
    .xudua-captcha-flex {
        flex-direction: column;
        align-items: stretch;
    }
    .xudua-input-captcha {
        width: 100% !important;
    }
}

/* ==========================================================================
   Thank You Card Styles (Giao diện Trang Cảm Ơn Chân Thành & Lịch Sự)
   ========================================================================== */
.xudua-thankyou-wrapper {
    width: 100%;
    max-width: 720px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
}

.xudua-thankyou-wrapper *,
.xudua-thankyou-wrapper *::before,
.xudua-thankyou-wrapper *::after {
    box-sizing: border-box;
}

.xudua-thankyou-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 48px 42px;
    text-align: center;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    animation: xuduaCardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.xudua-thankyou-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #0284c7 0%, #10b981 50%, #0284c7 100%);
}

.xudua-thankyou-icon-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 22px auto;
    border-radius: 50%;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.12);
}

.xudua-checkmark {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #10b981;
    stroke-miterlimit: 10;
    animation: xuduaCheckScale 0.4s ease-in-out 0.2s both;
}

.xudua-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: xuduaCheckStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.xudua-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: xuduaCheckStroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes xuduaCheckStroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes xuduaCheckScale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes xuduaCardPop {
    0% { opacity: 0; transform: scale(0.95) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.xudua-thankyou-title {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.xudua-thankyou-subtitle {
    margin: 0 0 20px 0;
    font-size: 15.5px;
    font-weight: 600;
    color: #0284c7;
    line-height: 1.5;
}

.xudua-thankyou-divider {
    width: 54px;
    height: 3px;
    background: linear-gradient(90deg, #0284c7, #10b981);
    margin: 0 auto 24px auto;
    border-radius: 3px;
}

.xudua-thankyou-body {
    margin: 0 0 32px 0;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.xudua-thankyou-body p,
.xudua-thankyou-p {
    margin: 0 0 16px 0 !important;
    color: #334155 !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
}

.xudua-thankyou-body p:last-child,
.xudua-thankyou-p:last-child {
    margin-bottom: 0 !important;
}

.xudua-thankyou-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.xudua-btn-thankyou-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
    transition: all 0.2s ease;
}

.xudua-btn-thankyou-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.38);
    color: #ffffff !important;
}

.xudua-btn-thankyou-repeat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.xudua-btn-thankyou-repeat:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

@media (max-width: 640px) {
    .xudua-thankyou-card {
        padding: 36px 22px;
    }
    .xudua-thankyou-title {
        font-size: 23px;
    }
    .xudua-thankyou-body {
        font-size: 14.5px;
    }
    .xudua-thankyou-actions {
        flex-direction: column;
        width: 100%;
    }
    .xudua-btn-thankyou-home,
    .xudua-btn-thankyou-repeat {
        width: 100%;
    }
}

/* ==========================================================================
   File Attachment Dropzone & Pill Styles (Khống chế 10MB)
   ========================================================================== */
.xudua-file-dropzone {
    display: block;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.xudua-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
    margin: 0;
    padding: 0;
}

.xudua-file-dropzone.has-file .xudua-file-input {
    display: none;
}

.xudua-file-dropzone:hover,
.xudua-file-dropzone.is-dragover {
    border-color: #0284c7;
    background-color: #f0f9ff;
}

.xudua-file-dropzone.is-dragover {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.12);
}

.xudua-dropzone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.xudua-dropzone-icon {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #0284c7;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.xudua-file-dropzone:hover .xudua-dropzone-icon {
    transform: translateY(-2px);
}

.xudua-dropzone-text {
    font-size: 14.5px;
    font-weight: 600;
    color: #0f172a;
}

.xudua-dropzone-formats {
    font-size: 12.5px;
    color: #64748b;
    margin-top: 2px;
}

.xudua-file-selected-box {
    display: flex;
    justify-content: center;
    align-items: center;
}

.xudua-file-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #93c5fd;
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1);
    animation: xuduaPillPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.xudua-file-pill .xudua-file-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #0284c7;
}

.xudua-file-pill .xudua-file-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xudua-file-pill .xudua-file-size {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 600;
}

.xudua-file-pill .xudua-btn-remove-file {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}

.xudua-file-pill .xudua-btn-remove-file:hover {
    background: #fca5a5;
    color: #7f1d1d;
}

.xudua-form-help-text {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

@keyframes xuduaPillPop {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
