/* ============ CAPTCHA SECTION ============ */
.captcha-section {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.captcha-section canvas {
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    cursor: pointer;
    background: #f7fafc;
}
.captcha-refresh-btn {
    background: none;
    border: 2px solid #00994D;
    color: #00994D;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.captcha-refresh-btn:hover {
    background: #00994D !important;
    border-color: #00994D !important;
    color: #fff !important;
}
.captcha-refresh-btn i {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
}
.captcha-input-wrap {
    flex: 1;
    min-width: 160px;
}
.captcha-input-wrap input {
    width: 100%;
    padding: 10px 14px !important;
    border: 2px solid #cbd5e0 !important;
    border-radius: 6px !important;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    background: #f7fafc;
    transition: border-color 0.3s;
}
.captcha-input-wrap input:focus {
    border-color: #00994D !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,153,77,0.15);
}
.captcha-label {
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}

/* ============ QUOTE FORM CAPTCHA OVERRIDES ============ */
.quote_form .captcha-section {
    margin: 8px 0 0;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}
.quote_form .captcha-section canvas {
    width: 130px !important;
    height: 38px !important;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.quote_form .captcha-refresh-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 2px solid rgba(255,255,255,0.6) !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    line-height: 1 !important;
    transition: background 0.3s, transform 0.5s ease !important;
}
.quote_form .captcha-refresh-btn:hover {
    background: #00994D !important;
    border-color: #00994D !important;
    color: #fff !important;
}
.quote_form .captcha-refresh-btn span {
    display: none !important;
}
.quote_form .captcha-input-wrap {
    flex: 1;
    min-width: 100px;
}
.quote_form .captcha-input-wrap input {
    height: 38px !important;
    padding: 6px 10px !important;
    font-size: 14px;
    border: 2px solid rgba(255,255,255,0.3) !important;
    background: #fff !important;
    border-radius: 6px !important;
}
.quote_form .captcha-label {
    font-size: 12px;
    margin-bottom: 5px;
}
/* Quote form textarea placeholder vertical align */
.quote_form textarea {
    padding-top: 14px !important;
}
/* Quote form row for captcha + send button */
.quote_form .captcha-send-row {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: nowrap;
}
.quote_form .captcha-send-row .captcha-col {
    flex: 1;
    max-width: 55%;
}
.quote_form .captcha-send-row .send-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quote_form .captcha-send-row .send-col button {
    white-space: nowrap;
    padding: 12px 30px !important;
    height: auto !important;
    width: auto !important;
    max-width: max-content !important;
    flex: 0 1 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
/* Keyframe spin animation for robust refresh */
@keyframes captcha-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.captcha-spin-anim {
    display: inline-block !important;
    animation: captcha-spin 0.6s ease;
}

/* ============ FIELD ERROR ============ */
.field-error-msg {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
    animation: errorFadeIn 0.3s ease;
}
@keyframes errorFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ SUBMIT BUTTON LOADING ============ */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}
.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ MAIL PREVIEW MODAL ============ */
#mailPreviewModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    animation: modalFadeIn 0.35s ease;
}
#mailPreviewModal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.mail-preview-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
}
.mail-preview-container {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.4s ease;
}
@keyframes modalSlideIn {
    from { transform: translateY(30px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.mail-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    border-radius: 12px 12px 0 0;
    color: #fff;
}
.mail-preview-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mail-preview-logo {
    height: 36px;
    border-radius: 4px;
}
.mail-preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}
.mail-preview-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    line-height: 1;
}
.mail-preview-close:hover {
    background: rgba(255,255,255,0.35);
}
.mail-preview-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.mail-meta {
    background: #f7fafc;
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 4px solid #00994D;
}
.mail-meta-row {
    font-size: 13px;
    color: #4a5568;
    padding: 3px 0;
    line-height: 1.6;
}
.mail-meta-row strong {
    color: #1a365d;
    min-width: 60px;
    display: inline-block;
}
.mail-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 18px 0;
}
.mail-bank-header {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #00994D;
    margin-bottom: 18px;
}
.mail-bank-header h4 {
    font-size: 18px;
    color: #1a365d;
    margin: 0 0 4px;
    font-weight: 700;
}
.mail-bank-sub {
    font-size: 13px;
    color: #718096;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.mail-greeting p {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.7;
    margin: 0 0 10px;
}
.mail-details-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14px;
}
.mail-details-table tr {
    border-bottom: 1px solid #e2e8f0;
}
.mail-details-table td {
    padding: 10px 14px;
    vertical-align: top;
}
.mail-label {
    font-weight: 600;
    color: #1a365d;
    width: 160px;
    background: #f7fafc;
    white-space: nowrap;
}
.mail-value {
    color: #2d3748;
}
.mail-closing p {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.7;
    margin: 0 0 5px;
}
.mail-disclaimer {
    background: #fffbeb;
    border: 1px solid #fbd38d;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 18px;
}
.mail-disclaimer p {
    font-size: 11px;
    color: #975a16;
    margin: 0;
    line-height: 1.5;
}
.mail-preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #f7fafc;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #e2e8f0;
}
.mail-preview-status {
    font-size: 13px;
    color: #38a169;
    font-weight: 600;
}
.mail-preview-status i {
    margin-right: 6px;
}
.mail-preview-ok-btn {
    background: linear-gradient(135deg, #00994D 0%, #38a169 100%);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.mail-preview-ok-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,153,77,0.35);
}

/* ============ SUCCESS TOAST ============ */
.form-success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #00994D 0%, #38a169 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100000;
    box-shadow: 0 8px 25px rgba(0,153,77,0.35);
    animation: toastSlideIn 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-success-toast i {
    font-size: 20px;
}
@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 576px) {
    .captcha-section {
        flex-direction: column;
        align-items: flex-start;
    }
    .captcha-input-wrap {
        width: 100%;
    }
    .mail-preview-container {
        width: 95%;
        max-height: 90vh;
    }
    .mail-preview-header h3 {
        font-size: 14px;
    }
    .mail-label {
        width: 120px;
    }
    .mail-preview-footer {
        flex-direction: column;
        gap: 10px;
    }
}
