/* ============================================================
   Aamartaka Eligibility Checker – Frontend Styles
   ============================================================ */

:root {
    --aace-blue:       #00AEEF;
    --aace-blue-dark:  #0091C7;
    --aace-blue-light: #E6F7FD;
    --aace-white:      #FFFFFF;
    --aace-gray-bg:    #F4F7FA;
    --aace-gray-border:#DDE3EC;
    --aace-gray-text:  #6B7A8D;
    --aace-dark:       #2C3E50;
    --aace-green:      #27AE60;
    --aace-red:        #E74C3C;
    --aace-radius:     8px;
    --aace-shadow:     0 2px 12px rgba(0,0,0,.10);
}

/* ------ Wrapper ------ */
.aace-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1140px;
    margin: 30px auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: var(--aace-dark);
    align-items: flex-start;
}

/* ------ Form Panel ------ */
.aace-form-panel {
    flex: 1 1 65%;
    background: var(--aace-white);
    border-radius: var(--aace-radius);
    box-shadow: var(--aace-shadow);
    overflow: hidden;
}

/* ------ Header ------ */
.aace-form-header {
    background: linear-gradient(135deg, var(--aace-blue) 0%, var(--aace-blue-dark) 100%);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    position: relative;
    gap: 12px;
}
.aace-form-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff !important;
}
.aace-header-icon {
    background: rgba(255,255,255,.2);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ------ Dark Mode Toggle ------ */
.aace-dark-mode-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    opacity: .8;
}
.aace-dm-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.aace-dm-switch input { display: none; }
.aace-dm-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,.2);
    transition: .4s;
    border-radius: 22px;
}
.aace-dm-slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.aace-dm-switch input:checked + .aace-dm-slider { background-color: var(--aace-blue-dark); }
.aace-dm-switch input:checked + .aace-dm-slider:before { transform: translateX(18px); }

/* ------ Progress Bar ------ */
.aace-progress-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 16px 28px 8px;
    position: relative;
    background: var(--aace-white);
}
.aace-progress-track {
    position: absolute;
    left: 60px; right: 60px;
    top: 30px;
    height: 3px;
    background: var(--aace-gray-border);
    z-index: 0;
}
.aace-progress-fill {
    height: 100%;
    background: var(--aace-blue);
    transition: width .4s ease;
}
.aace-step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}
.aace-step-label {
    font-size: 10px;
    color: var(--aace-gray-text);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: .5px;
}
.aace-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--aace-white);
    border: 2px solid var(--aace-gray-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--aace-gray-text);
    transition: all .3s;
}
.aace-step-dot.active {
    border-color: var(--aace-blue);
    color: var(--aace-blue);
    box-shadow: 0 0 0 3px rgba(0,174,239,.15);
}
.aace-step-dot.completed {
    background: var(--aace-blue);
    border-color: var(--aace-blue);
    color: #fff;
}
.aace-step-dot.completed .step-num { display: none; }
.aace-step-dot .step-check { display: none; }
.aace-step-dot.completed .step-check { display: block; }

/* ------ Step Panels ------ */
.aace-step { padding: 20px 28px; }
.aace-hidden { display: none !important; }

/* ------ Fields ------ */
.aace-field-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.aace-label {
    min-width: 160px;
    font-weight: 500;
    color: var(--aace-dark);
    flex-shrink: 0;
}
.aace-label-full { width: 100%; min-width: unset; }

.aace-select,
.aace-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--aace-gray-border);
    border-radius: var(--aace-radius);
    font-size: 14px;
    color: var(--aace-dark);
    background: var(--aace-white);
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
/* Show placeholder option in gray when nothing is selected yet */
.aace-select:invalid,
.aace-select option[value=""]:checked,
.aace-select option[disabled] {
    color: var(--aace-gray-text);
}
/* Unselected state — when placeholder is chosen, gray out the select */
.aace-select.aace-unselected {
    color: var(--aace-gray-text);
}
.aace-select option:not([disabled]) {
    color: var(--aace-dark);
}
.aace-select:focus, .aace-input:focus {
    border-color: var(--aace-blue);
    box-shadow: 0 0 0 3px rgba(0,174,239,.12);
}

/* ------ Radio Buttons ------ */
.aace-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.aace-radio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid var(--aace-gray-border);
    border-radius: 22px;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
}
.aace-radio-btn input { display: none; }
.aace-radio-btn:has(input:checked),
.aace-radio-btn.selected {
    border-color: var(--aace-blue);
    color: var(--aace-blue);
    background: var(--aace-blue-light);
    font-weight: 600;
}
.aace-radio-btn:before {
    content: '';
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--aace-gray-border);
    display: inline-block;
    transition: all .2s;
    flex-shrink: 0;
}
.aace-radio-btn:has(input:checked):before {
    background: var(--aace-blue);
    border-color: var(--aace-blue);
    box-shadow: inset 0 0 0 3px #fff;
}

/* ------ DOB Group ------ */
.aace-dob-group {
    display: flex;
    gap: 8px;
    flex: 1;
}
.aace-dob-group select { flex: 1; }

/* ------ Experience Group ------ */
.aace-exp-group {
    display: flex;
    gap: 8px;
    flex: 1;
}
.aace-exp-group select { flex: 1; }

/* ------ Income Group ------ */
.aace-income-group {
    display: flex;
    flex: 1;
    align-items: stretch;
}
.aace-income-group .aace-input {
    border-radius: var(--aace-radius) 0 0 var(--aace-radius);
    border-right: none;
    flex: 1;
}
.aace-currency {
    padding: 9px 12px;
    background: var(--aace-gray-bg);
    border: 1px solid var(--aace-gray-border);
    border-radius: 0 var(--aace-radius) var(--aace-radius) 0;
    font-weight: 600;
    color: var(--aace-gray-text);
    white-space: nowrap;
}

/* ------ Divider ------ */
.aace-divider {
    text-align: left;
    margin: 20px 0 12px;
    font-weight: 700;
    color: var(--aace-gray-text);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--aace-gray-border);
}

/* ------ Yes / No Cards ------ */
.aace-yesno-group {
    display: flex;
    gap: 16px;
    flex: 1;
    min-width: 0;
}
.aace-yesno-card {
    flex: 1;
    border: 2px solid var(--aace-gray-border);
    border-radius: var(--aace-radius);
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: var(--aace-dark);
    background: var(--aace-white);
    transition: all .25s;
    user-select: none;
}
.aace-yesno-card:hover {
    border-color: var(--aace-blue);
    background: var(--aace-blue-light);
}
.aace-yesno-card.aace-selected {
    background: var(--aace-blue);
    border-color: var(--aace-blue);
    color: #fff;
}
.aace-yesno-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    margin: 10px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}
.aace-check-icon { border: 2px solid currentColor; }
.aace-cross-icon  { border: 2px solid currentColor; }
.aace-yesno-card.aace-selected .aace-yesno-icon { border-color: rgba(255,255,255,.7); color: rgba(255,255,255,.9); }

/* ------ Loan Row ------ */
.aace-loan-row {
    background: var(--aace-gray-bg);
    border: 1px solid var(--aace-gray-border);
    border-radius: var(--aace-radius);
    padding: 14px;
    margin-bottom: 12px;
}
.aace-loan-row-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--aace-blue);
}
.aace-loan-row-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.aace-loan-row-fields .aace-select,
.aace-loan-row-fields .aace-input { width: 100%; flex: unset; }
.aace-loan-amount-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.aace-loan-amount-row .aace-input { flex: 1; }
.aace-pct { padding: 9px 10px; background: var(--aace-gray-bg); border: 1px solid var(--aace-gray-border); border-radius: 0 var(--aace-radius) var(--aace-radius) 0; color: var(--aace-gray-text); }
.aace-loan-amount-row .aace-input:last-of-type { border-radius: var(--aace-radius) 0 0 var(--aace-radius); }

/* ------ Conditional ------ */
.aace-conditional { margin-top: 12px; }

/* ------ Input with Icon ------ */
.aace-input-icon-wrap {
    position: relative;
    flex: 1;
}
.aace-input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
    opacity: .6;
}
.aace-input-icon-field { padding-left: 36px !important; }

/* ------ Lead Banner ------ */
.aace-lead-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--aace-blue-light);
    border: 1px solid rgba(0,174,239,.2);
    border-radius: var(--aace-radius);
    padding: 16px 20px;
    margin: 0 28px 20px;
}
.aace-lead-icon {
    width: 50px; height: 50px;
    background: var(--aace-blue);
    border-radius: var(--aace-radius);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.aace-lead-banner h3 { margin: 0 0 2px; font-size: 17px; color: var(--aace-dark); }
.aace-lead-banner p  { margin: 0; color: var(--aace-gray-text); font-size: 13px; }

/* ------ Terms ------ */
.aace-terms {
    font-size: 12px;
    color: var(--aace-gray-text);
    margin: 4px 0 12px;
}
.aace-terms a { color: var(--aace-blue); font-weight: 600; }

/* ------ Error / Success ------ */
.aace-error-box {
    background: #FDECEA;
    border: 1px solid #F5C6CB;
    border-radius: var(--aace-radius);
    padding: 10px 14px;
    color: var(--aace-red);
    margin-bottom: 12px;
    font-size: 13px;
}
.aace-success-box {
    background: #EAF7EF;
    border: 1px solid #C3E6CB;
    border-radius: var(--aace-radius);
    padding: 10px 14px;
    color: var(--aace-green);
    margin-bottom: 12px;
    font-size: 13px;
}

/* ------ Navigation ------ */
.aace-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 28px 20px;
    border-top: 1px solid var(--aace-gray-border);
    margin-top: 12px;
}
.aace-nav-final { justify-content: space-between; }

.aace-btn-next, .aace-btn-submit {
    background: var(--aace-blue);
    color: #fff;
    border: none;
    padding: 11px 30px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .5px;
    transition: background .2s, transform .1s;
    outline: none;
}
.aace-btn-next:hover, .aace-btn-submit:hover {
    background: var(--aace-blue-dark);
    transform: translateY(-1px);
}
.aace-btn-back {
    background: transparent;
    color: var(--aace-gray-text);
    border: 1.5px solid var(--aace-gray-border);
    padding: 11px 28px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    outline: none;
}
.aace-btn-back:hover {
    border-color: var(--aace-blue);
    color: var(--aace-blue);
}
.aace-btn-submit { min-width: 160px; }

/* ------ Sidebar ------ */
.aace-sidebar {
    flex: 0 0 280px;
    width: 280px;
    background: var(--aace-white);
    border-radius: var(--aace-radius);
    box-shadow: var(--aace-shadow);
    overflow: hidden;
    position: sticky;
    top: 20px;
}
.aace-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--aace-gray-border);
}
.aace-sidebar-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--aace-blue-light);
    border: 2px solid var(--aace-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--aace-blue);
    font-size: 24px;
}
.aace-sidebar-name-block strong {
    font-size: 15px;
    color: var(--aace-dark);
    display: block;
    margin-bottom: 2px;
}
.aace-sidebar-meta {
    font-size: 12px;
    color: var(--aace-gray-text);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.6;
}
.aace-sidebar-items { padding: 8px 0 12px; }
.aace-sidebar-section-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--aace-gray-text);
    padding: 10px 16px 4px;
    background: var(--aace-gray-bg);
    border-top: 1px solid var(--aace-gray-border);
    border-bottom: 1px solid var(--aace-gray-border);
}
.aace-sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--aace-gray-border);
    transition: background .15s;
}
.aace-sidebar-item:last-child { border-bottom: none; }
.aace-sidebar-item:hover { background: var(--aace-gray-bg); }
.aace-sbi-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--aace-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--aace-blue);
}
.aace-sbi-label {
    font-size: 11px;
    color: var(--aace-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}
.aace-sbi-value {
    font-size: 13px;
    color: var(--aace-dark);
    font-weight: 500;
}

/* ------ Responsive ------ */
@media (max-width: 860px) {
    .aace-wrapper {
        flex-direction: column;
        margin: 12px;
        gap: 14px;
    }
    .aace-sidebar {
        width: 100%;
        position: static;
        order: 2;
        max-height: 320px;
        overflow-y: scroll;
        overflow-x: hidden;
        border-top: 3px solid var(--aace-blue);
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar by default — show on hover/touch */
        scrollbar-width: none;          /* Firefox */
        -ms-overflow-style: none;       /* IE / Edge legacy */
    }
    /* Chrome / Safari / Opera — hidden by default */
    .aace-sidebar::-webkit-scrollbar {
        width: 4px;
        background: transparent;
    }
    .aace-sidebar::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 4px;
        transition: background .25s;
    }
    /* Reveal scrollbar on hover (desktop touch-capable) */
    .aace-sidebar:hover::-webkit-scrollbar-thumb,
    .aace-sidebar:focus-within::-webkit-scrollbar-thumb {
        background: rgba(0, 174, 239, 0.45);
    }
    /* Reveal via JS class added on touchstart */
    .aace-sidebar.aace-scrolling::-webkit-scrollbar-thumb {
        background: rgba(0, 174, 239, 0.45);
    }
    .aace-sidebar.aace-scrolling {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 174, 239, 0.45) transparent;
    }
    .aace-form-panel {
        width: 100%;
        order: 1;
    }
    .aace-label { min-width: 120px; }
    .aace-progress-track { left: 40px; right: 40px; }

    /* Close button — only visible on mobile */
    .aace-sidebar-close {
        display: flex;
    }

    /* Restore button — only shown on mobile after dismiss */
    .aace-sidebar-restore {
        display: flex;
    }
}

/* ------ Sidebar Close Button ------ */
.aace-sidebar-close {
    display: none; /* hidden on desktop */
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 174, 239, 0.10);
    border: 1px solid rgba(0, 174, 239, 0.25);
    border-radius: 50%;
    color: var(--aace-blue);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .2s, color .2s, transform .15s;
    z-index: 5;
}
.aace-sidebar-close:hover {
    background: var(--aace-blue);
    color: #fff;
    transform: scale(1.1);
}

/* Make sidebar position relative so close btn is anchored to it */
.aace-sidebar {
    position: relative; /* overrides sticky on desktop too — that's fine since sticky uses the media-query-limited version */
}
/* Restore the sticky on desktop explicitly */
@media (min-width: 861px) {
    .aace-sidebar {
        position: sticky;
    }
}

/* ------ Sidebar Restore Button ------ */
.aace-sidebar-restore {
    display: none; /* hidden on desktop; shown via media query when triggered */
    order: 2;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--aace-blue-light);
    border: 1px dashed var(--aace-blue);
    border-radius: var(--aace-radius);
    color: var(--aace-blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    margin: 0 0 4px;
}
.aace-sidebar-restore:hover {
    background: var(--aace-blue);
    color: #fff;
}
.aace-sidebar-restore .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1.1;
}
@media (max-width: 480px) {
    .aace-step { padding: 14px 14px; }
    .aace-nav  { padding: 12px 14px 14px; }
    .aace-field-row { flex-direction: column; align-items: stretch; gap: 6px; }
    .aace-label { min-width: unset; }
    .aace-lead-banner { flex-direction: column; text-align: center; }
    .aace-loan-row-fields { grid-template-columns: 1fr; }
}

/* ------ Math CAPTCHA ------ */
.aace-math-captcha-field {
    background: var(--aace-blue-light);
    border: 1px solid var(--aace-gray-border);
    border-radius: var(--aace-radius);
    padding: 10px 12px;
}
.aace-math-captcha-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--aace-dark);
    margin-bottom: 7px;
}
.aace-math-captcha-label span {
    color: var(--aace-blue);
    font-weight: 700;
}
.aace-math-captcha-field input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--aace-gray-border);
    border-radius: var(--aace-radius);
    font-size: 14px;
    color: var(--aace-dark);
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s;
}
.aace-math-captcha-field input[type="number"]:focus {
    border-color: var(--aace-blue);
    box-shadow: 0 0 0 3px rgba(0,174,239,.12);
}

/* ------ OTP Disabled States ------ */
#aace-resend-otp.aace-disabled {
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}
.aace-otp-digit:disabled {
    background: var(--aace-gray-bg);
    opacity: 0.7;
    cursor: not-allowed;
}

/* ------ Honeypot for Spam Protection ------ */
.aace-honeypot-field {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
}

/* ------ Floating Help Button ------ */
@keyframes aacePulse {
    0% { transform: scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
    50% { transform: scale(1.08); box-shadow: 0 8px 24px rgba(0,174,239,0.3); }
    100% { transform: scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
}

.aace-help-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--aace-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9990;
    transition: transform 0.2s, background 0.2s;
    animation: aacePulse 2s infinite ease-in-out;
}
.aace-help-btn:hover {
    animation: none;
    transform: scale(1.1);
    background: var(--aace-blue-dark);
}

/* ------ Help Modal ------ */
.aace-help-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.aace-help-content {
    background: var(--aace-white);
    color: var(--aace-dark);
    padding: 30px;
    border-radius: var(--aace-radius);
    width: 90%; max-width: 400px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: aaceFadeIn 0.3s;
}
@keyframes aaceFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.aace-help-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 28px; font-weight: 700;
    color: var(--aace-gray-text);
    cursor: pointer; line-height: 1;
}
.aace-help-close:hover { color: var(--aace-red); }
.aace-help-content h3 { margin-top: 0; color: var(--aace-blue); }
.aace-help-list { list-style: none; padding: 0; margin: 15px 0 0; }
.aace-help-list li { margin-bottom: 8px; }

/* Help Form */
#aace-help-form { margin-top: 20px; }
.aace-help-field { margin-bottom: 12px; }
.aace-help-field input,
.aace-help-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--aace-gray-border);
    border-radius: var(--aace-radius);
    font-size: 14px;
    color: var(--aace-dark);
    background: var(--aace-gray-bg);
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
    font-family: inherit;
}
.aace-help-field input:focus,
.aace-help-field textarea:focus {
    border-color: var(--aace-blue);
    background: var(--aace-white);
}
.aace-help-content .aace-btn-submit { width: 100%; margin-top: 8px; }
#aace-help-messages { margin-bottom: 10px; }

/* ============================================================
   DARK MODE THEME
   ============================================================ */
.aace-wrapper.dark-mode {
    --aace-white:      #2c3e50;
    --aace-gray-bg:    #34495e;
    --aace-gray-border:#4a657e;
    --aace-gray-text:  #bdc3c7;
    --aace-dark:       #ecf0f1;
    --aace-shadow:     0 2px 12px rgba(0,0,0,.3);
    color: var(--aace-dark);
}

/* Invert colors for specific elements */
.aace-wrapper.dark-mode .aace-form-panel,
.aace-wrapper.dark-mode .aace-sidebar,
.aace-wrapper.dark-mode .aace-progress-bar,
.aace-wrapper.dark-mode .aace-select,
.aace-wrapper.dark-mode .aace-input {
    background: var(--aace-white) !important;
    color: var(--aace-dark) !important;
    border-color: var(--aace-gray-border);
}
.aace-wrapper.dark-mode .aace-select.aace-unselected {
    color: var(--aace-gray-text) !important;
}

.aace-wrapper.dark-mode .aace-select:focus,
.aace-wrapper.dark-mode .aace-input:focus {
    border-color: var(--aace-blue);
    box-shadow: 0 0 0 3px rgba(0,174,239,.2);
}

/* Fix for select options in dark mode */
.aace-wrapper.dark-mode option {
    background-color: var(--aace-white);
    color: var(--aace-dark);
}

.aace-wrapper.dark-mode .aace-label {
    color: var(--aace-dark);
}

.aace-wrapper.dark-mode .aace-radio-btn {
    border-color: var(--aace-gray-border);
}
.aace-wrapper.dark-mode .aace-radio-btn:before {
    border-color: var(--aace-gray-border);
}
.aace-wrapper.dark-mode .aace-radio-btn:has(input:checked),
.aace-wrapper.dark-mode .aace-radio-btn.selected {
    background: rgba(0,174,239,.15);
}

.aace-wrapper.dark-mode .aace-currency,
.aace-wrapper.dark-mode .aace-loan-row span {
    background: var(--aace-gray-bg);
    border-color: var(--aace-gray-border);
    color: var(--aace-gray-text);
}

.aace-wrapper.dark-mode .aace-divider,
.aace-wrapper.dark-mode .aace-sidebar-section-heading {
    color: var(--aace-gray-text);
    border-color: var(--aace-gray-border);
}

.aace-wrapper.dark-mode .aace-yesno-card {
    background: var(--aace-white);
    border-color: var(--aace-gray-border);
    color: var(--aace-dark);
}
.aace-wrapper.dark-mode .aace-yesno-card:hover {
    background: var(--aace-gray-bg);
}
.aace-wrapper.dark-mode .aace-yesno-card.aace-selected {
    background: var(--aace-blue);
    border-color: var(--aace-blue);
    color: #fff;
}

.aace-wrapper.dark-mode .aace-loan-row {
    background: var(--aace-gray-bg);
    border-color: var(--aace-gray-border);
}

.aace-wrapper.dark-mode .aace-lead-banner {
    background: var(--aace-gray-bg);
    border-color: var(--aace-gray-border);
}
.aace-wrapper.dark-mode .aace-lead-banner h3 {
    color: var(--aace-dark);
}

.aace-wrapper.dark-mode .aace-sidebar-profile,
.aace-wrapper.dark-mode .aace-sidebar-item {
    border-color: var(--aace-gray-border);
}
.aace-wrapper.dark-mode .aace-sidebar-item:hover {
    background: var(--aace-gray-bg);
}
.aace-wrapper.dark-mode .aace-sidebar-name-block strong,
.aace-wrapper.dark-mode .aace-sbi-value {
    color: var(--aace-dark);
}

/* ------ Dark mode: sidebar close & restore ------ */
.aace-wrapper.dark-mode .aace-sidebar-close {
    background: rgba(0, 174, 239, 0.15);
    border-color: rgba(0, 174, 239, 0.35);
    color: var(--aace-blue);
}
.aace-wrapper.dark-mode .aace-sidebar-close:hover {
    background: var(--aace-blue);
    color: #fff;
}
.aace-wrapper.dark-mode .aace-sidebar-restore {
    background: rgba(0, 174, 239, 0.10);
    border-color: var(--aace-blue);
    color: var(--aace-blue);
}
.aace-wrapper.dark-mode .aace-sidebar-restore:hover {
    background: var(--aace-blue);
    color: #fff;
}
