body.auth-screen {
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-top: calc(var(--header-h) + 28px);
    padding-bottom: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-screen .world {
    height: 100%;
    min-height: 100vh;
}

.auth-screen .world-pearl {
    left: 58%;
    top: 6%;
    width: min(72vw, 680px);
    opacity: 0.92;
}

.auth-title {
    font-size: clamp(44px, 8vw, 88px);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.94;
    margin-bottom: 12px;
}

.auth-lead {
    max-width: 420px;
    margin-bottom: 28px;
    font-size: 18px;
    line-height: 1.5;
    color: rgb(var(--muted));
}

.auth-stage .composer {
    width: min(100%, 560px);
    margin: 0;
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-fields[hidden],
.auth-checks[hidden] {
    display: none !important;
}

.auth-fields label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--muted));
}

.auth-fields input {
    width: 100%;
    min-height: 44px;
    padding: 6px 0 10px;
    border: 0;
    border-bottom: 1px solid rgb(var(--line));
    border-radius: 0;
    background: transparent;
    font-size: 17px;
    letter-spacing: -0.02em;
    color: rgb(var(--ink));
    outline: none;
    transition: border-color 0.15s var(--ease);
}

.auth-fields input::placeholder {
    color: rgb(var(--muted));
}

.auth-fields input:focus {
    border-bottom-color: rgb(var(--ink));
}

.auth-error {
    display: none;
    margin: 4px 0 8px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgb(var(--pink) / 0.18);
    color: rgb(var(--ink));
    font-size: 14px;
    line-height: 1.4;
}

.auth-error.visible {
    display: block;
}

.auth-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0 4px;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    margin: 0;
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: -0.015em;
    line-height: 1.45;
    text-transform: none;
    color: rgb(var(--ink));
    cursor: pointer;
}

.auth-check input {
    position: absolute;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.auth-check-box {
    position: relative;
    display: block;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 1.5px solid rgb(var(--line));
    border-radius: 8px;
    background: rgb(var(--paper-field));
    box-shadow: inset 0 1px 0 rgb(var(--white) / 0.7);
    transition:
        background 0.15s var(--ease),
        border-color 0.15s var(--ease),
        box-shadow 0.15s var(--ease),
        transform 0.15s var(--ease);
}

.auth-check-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 7px;
    height: 11px;
    border: 2px solid rgb(var(--white));
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.16s var(--ease);
}

.auth-check:hover .auth-check-box {
    border-color: rgb(var(--cta));
}

.auth-check input:checked + .auth-check-box {
    background: rgb(var(--cta));
    border-color: rgb(var(--cta));
    box-shadow: 0 6px 14px -8px rgb(var(--cta) / 0.8);
}

.auth-check input:checked + .auth-check-box::after {
    transform: rotate(45deg) scale(1);
}

.auth-check input:focus-visible + .auth-check-box {
    box-shadow:
        0 0 0 3px rgb(var(--cta) / 0.28),
        inset 0 1px 0 rgb(var(--white) / 0.7);
}

.auth-check input:checked:focus-visible + .auth-check-box {
    box-shadow:
        0 0 0 3px rgb(var(--cta) / 0.28),
        0 6px 14px -8px rgb(var(--cta) / 0.8);
}

.auth-check a {
    color: inherit;
    font-weight: 550;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-check a:hover {
    opacity: 0.72;
}

.auth-forgot {
    margin: 10px 0 0;
    font-size: 14px;
}

.auth-forgot a {
    color: rgb(var(--ink));
    font-weight: 550;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.auth-forgot a:hover {
    opacity: 0.72;
}

.auth-stage .composer-footer {
    justify-content: space-between;
    align-items: center;
    gap: 14px 20px;
    flex-wrap: wrap;
}

.auth-switch {
    margin: 0;
    max-width: 260px;
    font-size: 14px;
    line-height: 1.4;
    color: rgb(var(--muted));
}

.auth-switch a {
    color: rgb(var(--ink));
    font-weight: 550;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.auth-switch a:hover {
    opacity: 0.72;
}

.auth-code-step {
    margin-top: 4px;
}

.auth-code-step[hidden] {
    display: none !important;
}

.auth-code-note {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.5;
    color: rgb(var(--muted));
}

.auth-code-input {
    letter-spacing: 0.42em;
    text-align: center;
    font-size: 28px;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
}

.auth-code-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 16px 0 4px;
}

.auth-resend {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    color: rgb(var(--ink));
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.auth-resend:hover {
    opacity: 0.72;
}

.auth-resend:disabled {
    opacity: 0.45;
    cursor: default;
    text-decoration: none;
}

.auth-screen .site-footer {
    margin-top: 0;
}

.auth-screen .footer-bottom {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

@media (max-width: 740px) {
    .auth-title {
        font-size: clamp(36px, 12vw, 56px);
    }

    .auth-lead {
        font-size: 16px;
        margin-bottom: 22px;
    }

    .auth-code-input {
        font-size: 24px;
        letter-spacing: 0.28em;
    }

    .auth-switch {
        max-width: none;
        flex: 1 1 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-check-box,
    .auth-check-box::after {
        transition: none;
    }
}
