/* ==========================
   SAT AI AUTH - Premium Style
   Dark Theme Authentication
========================== */

/* ==========================
   ROOT VARIABLES
========================== */
:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --secondary-light: #a78bfa;
    --dark-bg: #050816;
    --dark-surface: rgba(15, 23, 42, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(59, 130, 246, 0.4);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #eab308;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

/* ==========================
   RESET & BASE
========================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* ==========================
   AURORA BACKGROUND
========================== */
body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(180px);
    z-index: -2;
    pointer-events: none;
    animation: auroraFloat 10s ease-in-out infinite;
}

body::before {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
    top: -350px;
    right: -250px;
}

body::after {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
    bottom: -300px;
    left: -200px;
    animation-delay: 5s;
}

@keyframes auroraFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.08); }
    66% { transform: translate(-20px, 15px) scale(1.04); }
}

/* Grid Overlay */
body::after {
    /* Preserved for aurora, grid added separately */
}

.grid-bg {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
}

/* ==========================
   AUTH CONTAINER
========================== */
.auth-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(37, 99, 235, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 70%);
    top: -100px;
    right: -100px;
    pointer-events: none;
    border-radius: 50%;
}

.auth-card::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.06), transparent 70%);
    bottom: -80px;
    left: -80px;
    pointer-events: none;
    border-radius: 50%;
}

/* ==========================
   LOGO & HEADER
========================== */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.auth-logo svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.auth-logo h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.auth-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================
   FORM STYLES
========================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.form-group {
    position: relative;
}

/* Floating Label */
.form-group .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.form-group:focus-within .form-label {
    color: var(--primary-light);
}

/* Input Field */
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition);
    outline: none;
}

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

.form-input:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.12);
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.1);
}

/* Password Field with Toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Error Message */
.error-message {
    font-size: 11px;
    color: var(--error);
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 4px;
}

.error-message.show {
    display: flex;
}

/* Success Message */
.success-message {
    font-size: 11px;
    color: var(--success);
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 4px;
}

.success-message.show {
    display: flex;
}

/* ==========================
   PASSWORD STRENGTH
========================== */
.password-strength {
    margin-top: 8px;
    display: flex;
    gap: 4px;
}

.strength-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: background 0.3s;
}

.strength-bar.weak { background: #ef4444; }
.strength-bar.medium { background: #eab308; }
.strength-bar.strong { background: #22c55e; }

.strength-text {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}

.strength-text.weak { color: #ef4444; }
.strength-text.medium { color: #eab308; }
.strength-text.strong { color: #22c55e; }

/* ==========================
   CHECKBOX
========================== */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.3s;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-group label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    cursor: pointer;
}

.checkbox-group label a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s;
}

.checkbox-group label a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* ==========================
   REMEMBER ME + FORGOT ROW
========================== */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 13px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* ==========================
   BUTTONS
========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.35);
    animation: btnGradient 3s ease-in-out infinite;
}

@keyframes btnGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.5);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-google {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* Loading State */
.btn-loading {
    cursor: wait;
}

.btn-loading .btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================
   DIVIDER
========================== */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================
   FOOTER LINK
========================== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* ==========================
   ALERT / TOAST
========================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    animation: slideDown 0.3s ease;
}

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

.alert.show {
    display: flex;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }

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

    .auth-logo h1 {
        font-size: 20px;
    }
}

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

    .auth-card {
        padding: 28px 18px;
    }

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

    .form-input {
        padding: 12px 14px;
        font-size: 13px;
    }

    .btn {
        padding: 13px 20px;
        font-size: 14px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ==========================
   ACCESSIBILITY
========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: rgba(37, 99, 235, 0.4);
    color: #fff;
}