/* Success toast after login/signup */
.auth-toast {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.25);
    border: 1px solid rgba(212, 165, 116, 0.4);
    animation: authToastIn 0.4s ease;
}

@keyframes authToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Auth modal — matches KHAS purple / gold theme */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(26, 26, 46, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.auth-modal {
    width: 100%;
    max-width: 440px;
    background: #faf8f5;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(26, 26, 46, 0.35);
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.35s ease;
    position: relative;
}

.auth-modal-overlay.is-open .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 50%, #4a2c5e 100%);
    padding: 28px 28px 22px;
    text-align: center;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.auth-modal-header h2 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 26px;
    margin: 0 0 6px;
    font-weight: 600;
}

.auth-modal-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.auth-modal-tabs {
    display: flex;
    margin: 20px 24px 0;
    background: #ebe6df;
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.auth-modal-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.auth-modal-tab.is-active {
    background: #A252DF;
    color: #fff;
    box-shadow: 0 4px 12px rgba(162, 82, 223, 0.35);
}

.auth-modal-body {
    padding: 24px 28px 28px;
}

.auth-panel {
    display: none;
}

.auth-panel.is-active {
    display: block;
    animation: authFadeIn 0.3s ease;
}

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

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
    font-family: 'Inter', sans-serif;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e1dcd4;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: #A252DF;
    box-shadow: 0 0 0 3px rgba(162, 82, 223, 0.15);
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap input {
    padding-right: 44px;
}

.auth-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.auth-password-toggle:hover {
    color: #A252DF;
    background: rgba(162, 82, 223, 0.08);
}

.auth-password-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-password-toggle.is-visible .icon-eye-open {
    display: none;
}

.auth-password-toggle.is-visible .icon-eye-closed {
    display: block;
}

.auth-password-toggle .icon-eye-closed {
    display: none;
}

.auth-password-toggle .icon-eye-open {
    display: block;
}

.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.auth-check input {
    margin-top: 3px;
    accent-color: #A252DF;
}

.auth-submit {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    background: #A252DF;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.auth-submit:hover {
    background: #7B2FC4;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(162, 82, 223, 0.35);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: #9ca3af;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1dcd4;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    font-family: 'Inter', sans-serif;
}

.auth-switch button {
    background: none;
    border: none;
    color: #A252DF;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
}

.auth-switch button:hover {
    color: #7B2FC4;
    text-decoration: underline;
}

.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
}

.auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.auth-forgot {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #A252DF;
    margin-top: -8px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
}

.auth-forgot:hover {
    color: #7B2FC4;
}

/* Navbar login button */
.nav-login-btn {
    background: transparent;
    color: #111;
    padding: 9px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1.5px solid #111;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-login-btn:hover {
    border-color: #A252DF;
    color: #A252DF;
    background: rgba(162, 82, 223, 0.06);
}

.navbar.scrolled .nav-login-btn {
    border-color: #111;
    color: #111;
}

.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.nav-dashboard-link {
    background: #d4a574;
    color: #1a1a2e;
    padding: 9px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-dashboard-link:hover {
    background: #e8bc8a;
    transform: translateY(-1px);
}

.nav-logout-form {
    margin: 0;
}

.nav-logout-btn {
    background: transparent;
    border: 1.5px solid #000;
    color: #000;
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.nav-logout-btn:hover {
    border-color: #000;
    color: #000;
}

@media (max-width: 768px) {
    .nav-login-btn {
        display: none;
    }

    .mobile-nav-actions .nav-login-btn {
        display: inline-flex;
    }

    .nav-user-menu {
        display: none;
    }

    .auth-field-row {
        grid-template-columns: 1fr;
    }

    .auth-modal {
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .auth-modal-overlay {
        padding: 12px;
    }

    .auth-modal-header {
        padding: 20px 20px 16px;
    }

    .auth-modal-header h2 {
        font-size: 22px;
    }

    .auth-modal-body {
        padding: 20px 16px 24px;
    }

    .auth-modal-tabs {
        margin: 14px 16px 0;
    }
}
