/* ========================================
   VIRELY OPS - AUTHENTICATION STYLES
   Isolated auth UI styles - does not affect main app
   ======================================== */

/* Auth Container - Full screen overlay */
/* Start hidden to prevent flash before auth state is determined */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0a0f1a 0%, #1a1f35 50%, #0f172a 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}

/* Show auth container when auth state is determined and user is not logged in */
.auth-container.auth-ready {
    display: flex;
}

.auth-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34,197,94,0.03) 0%, transparent 70%);
    pointer-events: none;
    animation: authGradientPulse 8s ease-in-out infinite;
}

@keyframes authGradientPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Animated background orbs */
.auth-container::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: authOrbFloat 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 50px) scale(1.1); }
    66% { transform: translate(30px, -30px) scale(0.95); }
}

.auth-container.hidden {
    display: none !important;
}

/* Auth Card */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 
        0 25px 80px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.03) inset,
        0 2px 0 rgba(255,255,255,0.05) inset;
    animation: authCardSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo Section */
.auth-logo {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 
        0 8px 32px rgba(59,130,246,0.35),
        0 0 0 1px rgba(255,255,255,0.1) inset;
    position: relative;
    overflow: hidden;
}

.auth-logo-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
    border-radius: 20px 20px 0 0;
}

.auth-logo-v {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.auth-brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.5px;
}

.auth-brand-tagline {
    font-size: 13px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 400;
}

/* Auth Title */
.auth-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #f8fafc;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 32px;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-input-group {
    position: relative;
}

.auth-input-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.auth-required {
    color: #ef4444;
    font-weight: 600;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 12px;
    color: #f8fafc;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input::placeholder {
    color: #475569;
}

.auth-input:focus {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.auth-input:hover:not(:focus) {
    border-color: rgba(148,163,184,0.25);
}

/* Password Toggle */
.auth-password-wrapper {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    transition: color 0.2s;
}

.auth-password-toggle:hover {
    color: #94a3b8;
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    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-btn:hover::before {
    left: 100%;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(59,130,246,0.45);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-google {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(148,163,184,0.2);
    color: #f8fafc;
}

.auth-btn-google:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(148,163,184,0.3);
}

.auth-btn-google svg {
    width: 20px;
    height: 20px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(148,163,184,0.15);
}

.auth-divider-text {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Links */
.auth-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #94a3b8;
}

.auth-forgot-password {
    text-align: right;
    margin-top: -12px;
}

.auth-forgot-password .auth-link {
    font-size: 13px;
}

/* Error & Success Messages */
.auth-message {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: authMessageSlide 0.3s ease;
}

@keyframes authMessageSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-message-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-message-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}

.auth-message-success {
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.25);
    color: #86efac;
}

.auth-message-info {
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.25);
    color: #93c5fd;
}

.auth-message-warning {
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.25);
    color: #fcd34d;
}

/* Loading Spinner */
.auth-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* Email Verification Screen */
.auth-verification {
    text-align: center;
}

.auth-verification-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: authVerificationBounce 2s ease-in-out infinite;
}

@keyframes authVerificationBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.auth-verification-email {
    font-family: 'Fira Code', monospace;
    background: rgba(59,130,246,0.1);
    padding: 8px 14px;
    border-radius: 8px;
    color: #60a5fa;
    font-size: 14px;
    display: inline-block;
    margin: 12px 0 24px;
    border: 1px solid rgba(59,130,246,0.2);
}

.auth-resend-timer {
    font-size: 13px;
    color: #64748b;
    margin-top: 16px;
}

/* Password Requirements */
.auth-password-requirements {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
    padding-left: 4px;
}

.auth-password-requirements ul {
    margin: 8px 0 0 16px;
    list-style: none;
}

.auth-password-requirements li {
    margin: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-password-requirements li::before {
    content: '○';
    font-size: 8px;
}

.auth-password-requirements li.valid {
    color: #22c55e;
}

.auth-password-requirements li.valid::before {
    content: '●';
}

/* Checkbox */
.auth-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
    margin-top: 2px;
}

.auth-checkbox-label {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 36px 24px;
        border-radius: 20px;
        margin: 16px;
    }
    
    .auth-logo-box {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }
    
    .auth-logo-v {
        font-size: 30px;
    }
    
    .auth-brand-name {
        font-size: 24px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .auth-input-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Screen transitions */
.auth-screen {
    display: none;
}

.auth-screen.active {
    display: block;
    animation: authScreenFade 0.3s ease;
}

@keyframes authScreenFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Logout button as nav item in sidebar */
.auth-logout-nav-item {
    background: rgba(239,68,68,0.08) !important;
    border: 1px solid rgba(239,68,68,0.15) !important;
    color: #f87171 !important;
    margin-top: 4px !important;
    position: relative !important;
}

.auth-logout-nav-item::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 16px;
    right: 16px;
    height: 1px;
    background: rgba(148,163,184,0.1);
}

.auth-logout-nav-item:hover {
    background: rgba(239,68,68,0.15) !important;
    border-color: rgba(239,68,68,0.3) !important;
    color: #fca5a5 !important;
    transform: translateX(2px) !important;
}

.auth-logout-nav-item .nav-icon {
    color: #f87171 !important;
}

.auth-logout-nav-item .nav-label {
    color: #f87171 !important;
    font-weight: 600 !important;
}

/* User info display */
.auth-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(59,130,246,0.08);
    border-radius: 10px;
    border: 1px solid rgba(59,130,246,0.15);
}

.auth-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.auth-user-email {
    font-size: 13px;
    color: #94a3b8;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hide main app when not authenticated */
.app-container.auth-hidden {
    display: none !important;
}

/* Toast Notification System */
.auth-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    pointer-events: none;
}

.auth-toast {
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.5),
        0 0 0 1px rgba(148,163,184,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 420px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.auth-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.auth-toast-error::before {
    background: #ef4444;
}

.auth-toast-success::before {
    background: #22c55e;
}

.auth-toast-info::before {
    background: #3b82f6;
}

.auth-toast-warning::before {
    background: #f59e0b;
}

.auth-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.auth-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.auth-toast-message {
    flex: 1;
    color: #f8fafc;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
}

.auth-toast-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.auth-toast-close:hover {
    background: rgba(148,163,184,0.1);
    color: #94a3b8;
}

.auth-toast-error {
    border-left: 4px solid #ef4444;
}

.auth-toast-error .auth-toast-icon {
    color: #fca5a5;
}

.auth-toast-success {
    border-left: 4px solid #22c55e;
}

.auth-toast-success .auth-toast-icon {
    color: #86efac;
}

.auth-toast-info {
    border-left: 4px solid #3b82f6;
}

.auth-toast-info .auth-toast-icon {
    color: #93c5fd;
}

.auth-toast-warning {
    border-left: 4px solid #f59e0b;
}

.auth-toast-warning .auth-toast-icon {
    color: #fcd34d;
}

/* Mobile responsiveness for toasts */
@media (max-width: 480px) {
    .auth-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .auth-toast {
        min-width: auto;
        max-width: none;
    }
}


