/* ========================================
   RESULTS.CSS — Auth Modal + Results View
   Inherits all :root vars from styles.css
   ======================================== */

/* ========================================
   AUTH MODAL OVERLAY
   ======================================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========================================
   AUTH CARD (Glassmorphism)
   ======================================== */
.auth-card {
    background: #ffffff;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    padding: 2.5rem 2.5rem 2rem;
    text-align: center;
    max-width: 440px;
    width: 92%;
    position: relative;
    box-shadow:
        0 24px 80px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: scale(0.92) translateY(24px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-overlay.active .auth-card {
    transform: scale(1) translateY(0);
}

/* Close button */
.auth-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.auth-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* ========================================
   AUTH HEADER
   ======================================== */
.auth-header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

/* ========================================
   AUTH FORM
   ======================================== */
.auth-form {
    text-align: left;
    margin-bottom: 0.5rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.auth-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.auth-field input::placeholder {
    color: var(--text-muted);
}

/* Auth error */
.auth-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    animation: shakeAuth 0.4s ease;
}

@keyframes shakeAuth {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

/* Submit button */
.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.auth-submit-btn:hover::after {
    left: 100%;
}

.auth-submit-btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
}

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

.auth-submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.auth-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Forgot password link */
.auth-forgot {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-forgot a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Divider with OR */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

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

.auth-divider span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Google Button (Moved down) */
.auth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.auth-google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-google-btn svg {
    flex-shrink: 0;
}

/* Footer Link (Create new account) */
.auth-footer-link {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.auth-footer-link a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9375rem;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* ========================================
   AUTH MODAL LEGAL AGREEMENT (ACTIVE)
   ======================================== */
.auth-legal-container {
    margin: 1.5rem 0 1.25rem;
    padding: 0 0.125rem;
    text-align: left;
    animation: fadeInLegal 0.3s ease;
}

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

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    flex-shrink: 0;
    height: 18px;
    width: 18px;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 5px;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.checkbox-wrapper:hover input ~ .checkmark {
    border-color: var(--primary-blue);
    background-color: #f1f5f9;
}

.checkbox-wrapper input:checked ~ .checkmark {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper input:checked ~ .checkmark:after {
    display: block;
}

.legal-text a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

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

/* Disabled state */
.auth-submit-btn:disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.7;
}

/* ========================================
   HEADER AUTH STATE
   ======================================== */
.nav-auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    overflow: hidden;
}

.user-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-info-mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-weight: 500;
    color: var(--text-primary);
}

/* Results state styles removed per request. */


/* ========================================
   PREMIUM TOAST NOTIFICATIONS (Top-Center)
   ======================================== */
#toastContainer {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    width: 100%;
    max-width: 420px;
    padding: 0 1rem;
}

.toast {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1e293b;
    font-size: 0.9375rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1),
               toastFadeOut 0.5s ease forwards 4.5s;
}

.toast-info { border-left: 4px solid #3b82f6; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-success { border-left: 4px solid #10b981; }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}