/* ══ AUTH MODAL OVERLAY ═════════════════════════════════════════════════════ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.auth-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ══ MODAL BOX ══════════════════════════════════════════════════════════════ */
.auth-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.22), 0 1px 0 rgba(255,255,255,0.5);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.auth-overlay.open .auth-box {
    transform: translateY(0) scale(1);
}

/* ══ HEADER ══════════════════════════════════════════════════════════════════ */
.auth-header {
    background: linear-gradient(160deg, #232323 0%, #1C1C1C 100%);
    padding: 28px 28px 24px;
    position: relative;
    text-align: center;
    border-bottom: 1px solid rgba(200,168,75,0.2);
}

.auth-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.4px;
    text-shadow: 0 0 20px rgba(200,168,75,0.3);
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.auth-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    transform: scale(1.1);
}
.auth-close:active { transform: scale(0.92); }

/* ══ SCREENS ════════════════════════════════════════════════════════════════ */
.auth-screen {
    display: none;
    padding: 28px 28px 24px;
    animation: authSlideIn 0.28s cubic-bezier(0.22,0.61,0.36,1) both;
}
.auth-screen.active { display: block; }

@keyframes authSlideIn {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ══ TABS (Login / Register) ════════════════════════════════════════════════ */
.auth-tabs {
    display: flex;
    background: #F5F0E8;
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 22px;
}

.auth-tab {
    flex: 1;
    padding: 9px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: background 0.22s, color 0.22s, box-shadow 0.22s;
}
.auth-tab.active {
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ══ FORM ════════════════════════════════════════════════════════════════════ */
.auth-field {
    margin-bottom: 14px;
}

.auth-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #E5DDD0;
    border-radius: 10px;
    font-size: 14px;
    color: #222;
    background: #FAFAF8;
    outline: none;
    transition: border-color 0.22s, box-shadow 0.22s, background 0.2s;
}
.auth-input:focus {
    border-color: var(--gold);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(200,168,75,0.14);
}
.auth-input::placeholder { color: #bbb; }

/* Password wrapper with toggle */
.auth-input-wrap {
    position: relative;
}
.auth-input-wrap .auth-input {
    padding-right: 44px;
}
.auth-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    padding: 4px;
    transition: color 0.2s;
    line-height: 1;
}
.auth-eye:hover { color: var(--gold-btn); }

/* ══ ERROR ══════════════════════════════════════════════════════════════════ */
.auth-error {
    display: none;
    background: #FFF0F0;
    border: 1px solid #FFC0C0;
    border-radius: 8px;
    color: #C0392B;
    font-size: 13px;
    padding: 9px 12px;
    margin-bottom: 14px;
    line-height: 1.4;
}

/* ══ BUTTON ═════════════════════════════════════════════════════════════════ */
.auth-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: box-shadow 0.25s, transform 0.15s, filter 0.2s;
}
.auth-btn:active { transform: scale(0.97); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-btn-primary {
    background: linear-gradient(135deg, #D4A030 0%, var(--gold-btn) 60%, #AD7A1A 100%);
    background-size: 200% 100%;
    background-position: 0% 0;
    color: #fff;
    box-shadow: 0 3px 12px rgba(192,144,48,0.35);
}
.auth-btn-primary:hover:not(:disabled) {
    background-position: 100% 0;
    box-shadow: 0 5px 18px rgba(192,144,48,0.5);
    transform: translateY(-1px);
}

.auth-btn-outline {
    background: transparent;
    color: var(--gold-btn);
    border: 1.5px solid var(--gold-btn);
    margin-top: 8px;
}
.auth-btn-outline:hover:not(:disabled) {
    background: #fdf8ee;
    box-shadow: 0 3px 10px rgba(192,144,48,0.2);
    transform: translateY(-1px);
}

/* ══ LINKS ══════════════════════════════════════════════════════════════════ */
.auth-link-row {
    text-align: center;
    margin-top: 16px;
}
.auth-link {
    background: none;
    border: none;
    color: var(--gold-btn);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
    padding: 0;
}
.auth-link:hover { color: var(--gold-dark); }

/* ══ VERIFY CODE INPUTS ═════════════════════════════════════════════════════ */
.code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 18px 0;
}

.code-digit {
    width: 48px;
    height: 56px;
    border: 2px solid #E5DDD0;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #1a1a1a;
    background: #FAFAF8;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    caret-color: var(--gold);
}
.code-digit:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(200,168,75,0.14);
    transform: scale(1.06);
}
.code-digit.filled {
    border-color: var(--gold);
    background: #fdf8ee;
}

/* ══ VERIFY HINT ════════════════════════════════════════════════════════════ */
.verify-hint {
    text-align: center;
    font-size: 13.5px;
    color: #666;
    line-height: 1.55;
    margin-bottom: 4px;
}
.verify-email-bold {
    font-weight: 700;
    color: #1a1a1a;
}

.verify-timer {
    text-align: center;
    font-size: 12.5px;
    color: #aaa;
    margin-top: 6px;
}
.verify-timer span {
    color: var(--gold-btn);
    font-weight: 600;
}

/* ══ SUCCESS SCREEN ═════════════════════════════════════════════════════════ */
.auth-success-icon {
    text-align: center;
    font-size: 54px;
    margin-bottom: 12px;
}
.auth-success-title {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.auth-success-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ══ USER DROPDOWN ══════════════════════════════════════════════════════════ */
.user-dropdown {
    position: fixed;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.14);
    border: 1.5px solid rgba(0,0,0,0.06);
    min-width: 210px;
    z-index: 500;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22,0.61,0.36,1);
}
.user-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.user-dropdown-header {
    padding: 14px 16px 12px;
    background: linear-gradient(160deg, #fdf8ee 0%, #f9f2e2 100%);
    border-bottom: 1px solid #EEE8DC;
}
.user-dropdown-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}
.user-dropdown-email {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-dropdown-divider {
    height: 1px;
    background: #F0EDE6;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 13.5px;
    color: #444;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    text-align: left;
}
.user-dropdown-item:hover {
    background: #FFF5F5;
    color: #C42B2B;
}

/* ── Mini avatar in header button ── */
.user-avatar-mini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-btn) 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-name-mini {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ══ TOAST ══════════════════════════════════════════════════════════════════ */
.auth-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
}
.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ══ RESPONSIVE ═════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .auth-overlay { align-items: flex-end; padding: 0; }
    .auth-box {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        transform: translateY(40px);
    }
    .auth-overlay.open .auth-box { transform: translateY(0); }
    .auth-header { padding: 22px 22px 18px; }
    .auth-screen { padding: 22px 20px 20px; }
    .code-digit { width: 42px; height: 50px; font-size: 20px; }
}
