/* ============================================
   BeyondRxAid Business Login Page Styles
   Extracted from business login design
   ============================================ */

/* ─── CSS VARIABLES ─── */
:root {
    --bg-primary: #080808;
    --bg-card: #ffffff;
    --green-accent: #4ADE80;
    --green-dim: #22c55e;
    --green-glow: rgba(74, 222, 128, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-dark: #111111;
    --text-dark-secondary: #6b7280;
    --border-light: #e5e7eb;
    --border-dark: rgba(255, 255, 255, 0.08);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-xl: 24px;
}

/* ─── BASE STYLES ─── */
.business-login-page {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    
    overflow-x: hidden;
}

.business-login-page *, 
.business-login-page *::before, 
.business-login-page *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

/* ─── AMBIENT BACKGROUND ─── */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient-bg::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(74, 222, 128, 0.06) 0%, transparent 70%);
    animation: ambientDrift 20s ease-in-out infinite;
}

.ambient-bg::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -15%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(74, 222, 128, 0.04) 0%, transparent 70%);
    animation: ambientDrift 25s ease-in-out infinite reverse;
}

@keyframes ambientDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, -3%) scale(1.05); }
    66% { transform: translate(-3%, 5%) scale(0.95); }
}

.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 70% 60% at 30% 50%, black 0%, transparent 100%);
}

/* ─── NAVIGATION ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 clamp(20px, 4vw, 48px);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 8, 8, 0.8);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-dark);
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo img { height: 32px; width: auto; }

.nav-right-group {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--green-accent);
    transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-separator {
    width: 1px;
    height: 20px;
    background: var(--border-dark);
}

.nav-contact {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-contact-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font);
    padding: 0;
}

.nav-contact-link:hover { color: var(--green-accent); }
.nav-contact-link svg { width: 15px; height: 15px; flex-shrink: 0; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s;
    border-radius: 2px;
}

/* ─── MAIN LAYOUT ─── */
.main {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: calc(100vh - 72px);
    padding-top: 72px;
}

/* ─── LEFT PANEL ─── */
.panel-left {
    flex: 1 1 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(40px, 6vw, 80px) clamp(32px, 5vw, 72px);
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--green-glow);
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    width: fit-content;
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards 0.2s;
}

.hero-badge .pulse {
    width: 6px;
    height: 6px;
    background: var(--green-accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards 0.35s;
}

.hero-title .accent {
    color: var(--green-accent);
    display: block;
}

.hero-description {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 500px;
    margin-top: 20px;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards 0.5s;
}

.compliance-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards 0.65s;
}

.badge {
    padding: 6px 14px;
    border: 1px solid var(--border-dark);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.badge:hover {
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--green-accent);
    background: var(--green-glow);
}

.hero-ctas {
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards 0.8s;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--green-accent);
    color: #0a0a0a;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: #6ee7a0;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(74, 222, 128, 0.25);
}

.btn-primary svg { width: 18px; height: 18px; }

/* ─── AUTHENTICATED CARD ─── */
.signed-in-card .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--green-glow);
    border: 1px solid rgba(74, 222, 128, 0.18);
    color: var(--green-accent);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    width: fit-content;
    margin-bottom: 12px;
    animation: fadeIn 0.5s ease;
}

.signed-in-card .status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--green-accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.signed-in-card .user-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    background: linear-gradient(to bottom right, #fafafa, #f5f5f5);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    animation: slideInLeft 0.6s ease 0.2s both;
}

.signed-in-card .user-summary:hover {
    border-color: rgba(74, 222, 128, 0.3);
    background: linear-gradient(to bottom right, #ffffff, #f9fafb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.signed-in-card .user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.signed-in-card .user-summary:hover .user-avatar {
    transform: scale(1.05);
}

.signed-in-card .user-avatar svg { width: 26px; height: 26px; }

.signed-in-card .user-details {
    flex: 1;
    min-width: 0;
}

.signed-in-card .user-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signed-in-card .user-role {
    font-size: 0.85rem;
    color: var(--text-dark-secondary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signed-in-card .signed-in-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    animation: slideInUp 0.6s ease 0.4s both;
}

.signed-in-card .full-width { 
    width: 100%; 
    justify-content: center; 
    text-align: center;
    padding: 15px 28px;
}

.signed-in-card .session-note {
    font-size: 0.85rem;
    color: var(--text-dark-secondary);
    text-align: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.signed-in-card .session-note strong {
    color: var(--text-dark);
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── RIGHT PANEL (SIGN-IN CARD) ─── */
.panel-right {
    flex: 0 0 clamp(380px, 42%, 520px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px clamp(24px, 3vw, 48px);
    position: relative;
}

.signin-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: clamp(32px, 4vw, 48px);
    position: relative;
    opacity: 0;
    animation: cardReveal 0.8s ease forwards 0.4s;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 20px 60px -10px rgba(0, 0, 0, 0.5),
        0 0 100px -20px rgba(74, 222, 128, 0.08);
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-header { margin-bottom: 32px; }

.card-header h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.card-header p {
    font-size: 0.9rem;
    color: var(--text-dark-secondary);
    line-height: 1.5;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    display: flex;
    pointer-events: none;
    transition: color 0.2s;
}

.input-icon svg { width: 18px; height: 18px; }

.form-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: #f9fafb;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    transition: all 0.25s ease;
}

.form-input::placeholder { color: #9ca3af; }

.form-input:focus {
    border-color: var(--green-dim);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.input-wrapper:focus-within .input-icon { color: var(--green-dim); }

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    padding: 4px;
    transition: color 0.2s;
}

.toggle-password:hover { color: var(--text-dark); }
.toggle-password svg { width: 20px; height: 20px; }

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    cursor: pointer;
    user-select: none;
}

.form-checkbox input { display: none; }

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkmark svg {
    width: 12px;
    height: 12px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.form-checkbox input:checked + .checkmark {
    background: var(--green-dim);
    border-color: var(--green-dim);
}

.form-checkbox input:checked + .checkmark svg {
    opacity: 1;
    transform: scale(1);
}

.form-checkbox span {
    font-size: 0.85rem;
    color: var(--text-dark-secondary);
}

.btn-signin {
    width: 100%;
    padding: 14px;
    background: var(--text-dark);
    color: #ffffff;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn-signin:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-signin:active { transform: translateY(0); }

.form-input.error { border-color: #ef4444; }
.form-input.success { border-color: var(--green-dim); }

.error-message {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 6px;
    display: none;
}

.error-message.visible { display: block; }

/* ─── FOOTER ─── */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 16px clamp(20px, 4vw, 48px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 8, 8, 0.7);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-dark);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.footer-brand .separator {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
}

.footer-brand strong {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-primary); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── LOADING SPINNER ─── */
.btn-signin.loading {
    pointer-events: none;
    color: transparent;
}

.btn-signin.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MOBILE NAVIGATION ─── */
.mobile-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(8, 8, 8, 0.98);
    backdrop-filter: blur(20px);
    padding: 24px;
    z-index: 99;
    transform: translateY(-110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-dark);
}

.mobile-nav.open { transform: translateY(0); }

.mobile-nav a,
.mobile-nav button.mobile-nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    border-bottom: 1px solid var(--border-dark);
    background: none;
    font-family: var(--font);
    cursor: pointer;
    transition: color 0.2s;
}

.mobile-nav a:hover,
.mobile-nav button.mobile-nav-btn:hover { color: var(--text-primary); }

.mobile-nav > *:last-child { border-bottom: none; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .nav-contact { display: none; }
    .nav-separator { display: none; }
    .nav-toggle { display: block; }

    .main {
        flex-direction: column;
        min-height: auto;
    }

    .panel-left {
        flex: none;
        padding: 40px clamp(24px, 5vw, 48px) 20px;
        text-align: center;
        align-items: center;
    }

    .hero-description { text-align: center; }
    .compliance-badges { justify-content: center; }
    .hero-ctas { justify-content: center; flex-wrap: wrap; }

    .panel-right {
        flex: none;
        padding: 20px clamp(24px, 5vw, 48px) 100px;
    }

    .signin-card { max-width: 480px; }
    .footer { position: relative; }
}

@media (max-width: 640px) {
    .hero-title { font-size: 2rem; }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary { width: 100%; justify-content: center; }
    .signin-card { padding: 28px; }

    .footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ─── CAPTCHA MODAL ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.captcha-modal {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 36px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .captcha-modal {
    transform: scale(1) translateY(0);
}

.captcha-modal h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.captcha-modal .modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-dark-secondary);
    margin-bottom: 24px;
}

.captcha-question {
    background: #f3f4f6;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.captcha-question .math-problem {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.captcha-question .hint {
    font-size: 0.75rem;
    color: #9ca3af;
}

.captcha-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
    outline: none;
    transition: all 0.25s ease;
    margin-bottom: 8px;
}

.captcha-input:focus {
    border-color: var(--green-dim);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.captcha-input.shake {
    animation: shake 0.4s ease;
    border-color: #ef4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.captcha-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-bottom: 12px;
    min-height: 18px;
}

.captcha-actions {
    display: flex;
    gap: 10px;
}

.captcha-actions button {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-captcha-cancel {
    background: transparent;
    border: 1.5px solid var(--border-light);
    color: var(--text-dark-secondary);
}

.btn-captcha-cancel:hover {
    background: #f3f4f6;
}

.btn-captcha-submit {
    background: var(--text-dark);
    border: none;
    color: #ffffff;
}

.btn-captcha-submit:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ─── LEGAL PAGE MODAL ─── */
.legal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.legal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.legal-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-xl);
    width: 92%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.legal-overlay.active .legal-modal {
    transform: scale(1) translateY(0);
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-dark);
    flex-shrink: 0;
}

.legal-modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.legal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-dark);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.legal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.legal-close svg { width: 18px; height: 18px; }

.legal-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.legal-modal-body::-webkit-scrollbar { width: 6px; }
.legal-modal-body::-webkit-scrollbar-track { background: transparent; }
.legal-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.legal-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.legal-content .legal-updated {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-dark);
}

.legal-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--green-accent);
    margin-top: 28px;
    margin-bottom: 10px;
}

.legal-content h3:first-of-type { margin-top: 0; }

.legal-content p {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.legal-content ul {
    list-style: none;
    margin-bottom: 14px;
    padding-left: 0;
}

.legal-content ul li {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
    margin-bottom: 6px;
}

.legal-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-accent);
    opacity: 0.5;
}

.legal-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal-content a {
    color: var(--green-accent);
    text-decoration: none;
}

.legal-content a:hover { text-decoration: underline; }

/* Search inside modals */
.modal-search {
    position: relative;
    margin-bottom: 24px;
}

.modal-search input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
}

.modal-search input::placeholder { color: rgba(255,255,255,0.3); }

.modal-search input:focus {
    border-color: var(--green-dim);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.08);
}

.modal-search svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: rgba(255,255,255,0.3);
    pointer-events: none;
    transition: color 0.2s;
}

.modal-search input:focus ~ svg { color: var(--green-dim); }

.no-results {
    text-align: center;
    padding: 32px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: none;
}

/* FAQ-specific accordion */
.faq-item {
    border-bottom: 1px solid var(--border-dark);
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
    width: 100%;
    padding: 18px 0;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: color 0.2s;
}

.faq-question:hover { color: var(--green-accent); }

.faq-question svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question svg { transform: rotate(45deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer-inner {
    padding-bottom: 18px;
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

/* FAQ Category Headers */
.faq-category {
    margin-bottom: 8px;
}

.faq-category-header {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--green-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 0 8px;
    margin-top: 8px;
    border-bottom: 1px solid var(--border-dark);
}

.faq-category:first-child .faq-category-header {
    margin-top: 0;
    padding-top: 0;
}

.legal-modal-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border-dark);
    text-align: center;
    flex-shrink: 0;
}

.legal-modal-footer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .legal-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .legal-modal-header { padding: 18px 20px; }
    .legal-modal-body { padding: 20px; }
    .legal-modal-footer { padding: 14px 20px; }
}
