:root {
    --bg: #000000;
    --surface: #09090b;
    --surface-hover: #18181b;
    --border: #27272a;
    --border-hover: #3f3f46;
    --border-focus: #71717a;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --primary: #ffffff;
    --primary-text: #000000;
    --primary-hover: #e4e4e7;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.4s ease-out;
}

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    margin-bottom: 2rem;
    transition: color 0.2s;
    font-weight: 500;
}

.back-link:hover {
    color: var(--text-main);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

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

.input-icon {
    position: absolute;
    left: 0.875rem;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: color 0.2s;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 40px;
    padding: 0 1rem 0 2.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.input-wrapper input:hover {
    border-color: var(--border-hover);
}

.input-wrapper input:focus {
    background: var(--surface);
    border-color: var(--border-focus);
}

.input-wrapper input:focus + .input-icon {
    color: var(--text-main);
}

.btn-primary {
    width: 100%;
    height: 40px;
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.switch-auth {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.switch-auth a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

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

.alert {
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert.error {
    background: #450a0a;
    color: #fecaca;
    border: 1px solid #7f1d1d;
}

.alert.success {
    background: #064e3b;
    color: #a7f3d0;
    border: 1px solid #065f46;
}

/* Autofill fixes */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
        border: none;
        box-shadow: none;
    }
}

/* ─── Google OAuth Button ─────────────────────────────────────────────────── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 1.25rem;
}

.btn-google:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

/* ─── Divider ─────────────────────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
