/* ==========================================================================
   AUTHENTICATION & USER SESSION STYLING (4-DIGIT OTP & LOGOUT)
   ========================================================================== */

/* Header User Profile & Logout Bar */
.user-auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 0.88rem;
    color: #f1f5f9;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: all 0.25s ease;
}

.user-auth-pill:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.15);
}

.user-auth-avatar {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(56, 189, 248, 0.3);
}

.user-auth-email {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.2px;
}

.btn-logout-header {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #fca5a5;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 2px;
    flex-shrink: 0;
}

.btn-logout-header:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

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

/* Auth Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 18, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.auth-card {
    background: linear-gradient(180deg, rgba(26, 34, 52, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 36px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #38bdf8);
    background-size: 200% 100%;
    animation: authGlow 4s linear infinite;
}

@keyframes authGlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #94a3b8;
    margin: 0 0 26px 0;
}

/* Email Step Form */
.auth-input-group {
    position: relative;
    margin-bottom: 18px;
    text-align: left;
}

.auth-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

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

.auth-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    color: #64748b;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 13px 16px 13px 44px;
    font-size: 0.95rem;
    color: #f8fafc;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 1);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* 4-Digit OTP PIN Inputs */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 20px 0;
}

.otp-box {
    width: 58px;
    height: 64px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: #38bdf8;
    font-family: 'Courier New', Courier, monospace;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.otp-box:focus {
    border-color: #38bdf8;
    background: rgba(30, 41, 59, 1);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
}

.otp-box.filled {
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(30, 41, 59, 0.8);
}

.auth-target-email {
    color: #38bdf8;
    font-weight: 700;
    word-break: break-all;
}

.auth-secondary-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    font-size: 0.82rem;
}

.btn-auth-link {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.82rem;
    padding: 4px;
    transition: color 0.2s ease;
}

.btn-auth-link:hover {
    color: #38bdf8;
}

.btn-auth-link:disabled {
    color: #475569;
    text-decoration: none;
    cursor: not-allowed;
}

.auth-resend-timer {
    color: #64748b;
    font-size: 0.8rem;
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    animation: shakeError 0.3s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.auth-success-msg {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

/* Email Sent Status Banner on Results Screen */
.results-email-status-banner {
    margin: 16px 0 24px 0;
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: fadeInBanner 0.4s ease;
}

@keyframes fadeInBanner {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.email-status-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.email-status-icon {
    font-size: 1.5rem;
}

.email-status-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.email-status-desc {
    font-size: 0.8rem;
    color: #94a3b8;
}

.btn-email-resend {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-email-resend:hover {
    background: #38bdf8;
    color: #0f172a;
}
