@keyframes authFil {
    0%, 100% { opacity: .7; }
    50% { opacity: 1; }
}

@keyframes authBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes authHalo {
    0%, 100% { opacity: .5; }
    50% { opacity: .9; }
}

@keyframes authSparkA {
    0% { transform: translate(0, 0) scale(.6); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translate(-54px, -96px) scale(.3); opacity: 0; }
}

@keyframes authSparkB {
    0% { transform: translate(0, 0) scale(.5); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(46px, -112px) scale(.25); opacity: 0; }
}

@keyframes authSparkC {
    0% { transform: translate(0, 0) scale(.7); opacity: 0; }
    18% { opacity: 1; }
    100% { transform: translate(-14px, -134px) scale(.3); opacity: 0; }
}

@keyframes authSparkD {
    0% { transform: translate(0, 0) scale(.5); opacity: 0; }
    22% { opacity: 1; }
    100% { transform: translate(72px, -70px) scale(.2); opacity: 0; }
}

@keyframes authSparkE {
    0% { transform: translate(0, 0) scale(.6); opacity: 0; }
    16% { opacity: 1; }
    100% { transform: translate(-78px, -52px) scale(.25); opacity: 0; }
}

/* No global border-box in reset.css — components opt in. */
.auth-page {
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    padding: 1.5rem;
    overflow: hidden;
    background: var(--color-bg);
    font-family: var(--font-body);
    transition: background-color .2s ease;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    background: var(--color-halo);
    opacity: .35;
    pointer-events: none;
}

.auth-blob--a {
    top: 12%;
    left: -8%;
    width: 220px;
    height: 220px;
    animation: authBob 9s ease-in-out infinite;
}

.auth-blob--b {
    bottom: 10%;
    right: -9%;
    width: 260px;
    height: 260px;
    animation: authBob 12s ease-in-out infinite;
}

.auth-brand {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 1;
    height: 44px;
}

.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-strong);
    cursor: pointer;
    transition: border-color .15s ease, background-color .2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: var(--color-accent);
}

.theme-toggle__icon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: opacity .15s ease, transform .2s ease;
}

.theme-toggle__icon--sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-toggle__icon--moon {
    opacity: 0;
    transform: scale(.6) rotate(-30deg);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle__icon--sun {
        opacity: 0;
        transform: scale(.6) rotate(30deg);
    }

    :root:not([data-theme="light"]) .theme-toggle__icon--moon {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
    opacity: 0;
    transform: scale(.6) rotate(30deg);
}

:root[data-theme="dark"] .theme-toggle__icon--moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.auth-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.75rem;
    width: 100%;
    text-align: center;
}

.auth-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 210px;
}

.auth-icon__halo {
    position: absolute;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--color-halo), transparent);
    animation: authHalo 3.6s ease-in-out infinite;
}

.auth-icon__bulb {
    position: relative;
    width: 128px;
    height: 176px;
}

.auth-icon__filament {
    animation: authFil 2.4s ease-in-out infinite;
}

.auth-spark {
    position: absolute;
    border-radius: 50%;
    background: var(--color-bulb-stroke);
}

.auth-spark--a { left: 88px; top: 64px; width: 7px; height: 7px; animation: authSparkA 3.4s ease-out infinite; }
.auth-spark--b { left: 96px; top: 52px; width: 5px; height: 5px; animation: authSparkB 4.2s ease-out .6s infinite; }
.auth-spark--c { left: 82px; top: 44px; width: 6px; height: 6px; animation: authSparkC 3.8s ease-out 1.2s infinite; }
.auth-spark--d { left: 104px; top: 74px; width: 4px; height: 4px; animation: authSparkD 4.6s ease-out 1.8s infinite; }
.auth-spark--e { left: 74px; top: 78px; width: 5px; height: 5px; animation: authSparkE 4s ease-out 2.4s infinite; }

.auth-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .875rem;
}

.auth-headline {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.05;
    color: var(--color-text-strong);
}

.auth-subtext {
    margin: 0;
    max-width: 270px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.auth-card__error {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: .75rem 1rem;
    border-radius: .75rem;
    background: oklch(58% 0.18 25 / 0.12);
    color: oklch(58% 0.18 25);
    font-size: .9375rem;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    width: 100%;
}

.auth-oauth-btn {
    gap: .625rem;
    width: 100%;
    max-width: 360px;
    height: 50px;
    border-radius: 16px;
    font-size: 1rem;
    box-shadow: 0 10px 24px -4px color-mix(in oklab, var(--color-accent) 45%, transparent);
    transition: background-color .15s ease, transform .15s ease;
}

.auth-oauth-btn:active {
    transform: translateY(1px);
}

.auth-oauth-btn__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    /* Google's multi-color mark needs a fixed white backdrop, not the theme's
       on-accent color — that flips to near-black in dark mode. */
    background: #FFF;
}

.auth-oauth-btn__badge svg {
    width: 14px;
    height: 14px;
}

/* Facebook's mark is already a self-contained blue circle — no extra backdrop needed. */
.auth-oauth-btn__badge--facebook {
    background: none;
}

.auth-oauth-btn__badge--facebook svg {
    width: 22px;
    height: 22px;
}

.auth-legal-links {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: var(--color-text-subtle);
}

.auth-legal-links a {
    color: var(--color-text-subtle);
    text-decoration: underline;
}

.auth-dev-login {
    width: 100%;
    max-width: 360px;
    font-size: .8125rem;
    color: var(--color-text-subtle);
}

.auth-dev-login summary {
    cursor: pointer;
    text-align: center;
}

.auth-dev-login__form {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .75rem;
}

.auth-dev-login__form label {
    font-size: .75rem;
}

.auth-dev-login__form input {
    box-sizing: border-box;
    width: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: .625rem;
    background: var(--color-surface);
    color: var(--color-text-strong);
    font-size: .9375rem;
}

.auth-dev-login__submit {
    height: 44px;
    border-radius: .625rem;
    font-size: .9375rem;
}

@media (min-width: 1024px) {
    .auth-page {
        padding: 2.5rem;
    }

    .auth-card {
        max-width: 800px;
        gap: 3rem;
    }

    .auth-headline {
        font-size: 2.5rem;
    }

    .auth-subtext {
        max-width: 300px;
        font-size: 1.0625rem;
    }

    .auth-oauth-btn {
        height: 54px;
        font-size: 1.0625rem;
    }
}
