:root {
    --radius-md: 14px;
    --radius-lg: 24px;
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    overflow-x: clip;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
}

body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) {
    html, body { scrollbar-width: auto; scrollbar-color: auto; }
    *::-webkit-scrollbar { width: 0; height: 0; }
}

a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.ambient::before {
    content: '';
    position: absolute;
    width: 70vmax;
    height: 70vmax;
    top: -20%;
    left: -15%;
    background: radial-gradient(circle, var(--ambient-glow) 0%, transparent 55%);
}

.auth-theme-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2;
}

.auth-page {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 2rem;
}

.auth-back {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--muted);
    transition: color 0.25s;
}
.auth-back:hover { color: var(--text); }

.auth-logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.28em;
    margin-bottom: 2rem;
}

.auth-card {
    width: min(420px, 100%);
    padding: 2.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.auth-card h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.auth-sub {
    font-size: 0.9375rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
}

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

.auth-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 0.45rem;
}

.auth-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.25s;
}
.auth-field input:focus { border-color: var(--border-hover); }
.auth-field input::placeholder { color: var(--dim); }

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
}
.auth-alert.error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #fca5a5;
}
.auth-alert.success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.22);
    color: #86efac;
}
.auth-alert.warn {
    background: var(--accent-dim);
    border: 1px solid rgba(232, 197, 71, 0.35);
    color: var(--accent);
}

.btn-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.9rem 1.25rem;
    background: var(--text);
    color: var(--bg);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    transition: opacity 0.25s, transform 0.25s var(--ease);
}
.btn-submit:hover:not(:disabled) { opacity: 0.92; }
.btn-submit:active:not(:disabled) { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
}
.auth-switch a {
    color: var(--accent);
    font-weight: 500;
}
.auth-switch a:hover { text-decoration: underline; }

@media (max-width: 380px) {
    .auth-theme-btn {
        top: 1rem;
        right: 1rem;
    }
    .auth-back {
        top: 1rem;
        left: 1rem;
    }
}
