/* ══════════════════════════════════════════════════════════
   Sign-in pages — login, register, password reset, verification,
   invitation, checkout done: a card in the middle of the page. They
   are the builder's: tokens and components (ui-label, ui-input, ui-btn,
   ui-alert); this is only the page around them.
   ══════════════════════════════════════════════════════════ */

@layer pages {
    .auth-page,
    .auth-hero {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-9);
        padding: var(--space-10) var(--space-8);
        background: var(--surface-1) radial-gradient(1100px 420px at 50% -160px, var(--primary-soft), transparent)
            no-repeat;
    }

    .auth-hero-brand {
        font-size: 1.55rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        color: var(--text-strong);
        text-decoration: none;
    }
    .auth-hero-brand span {
        color: var(--primary);
    }

    .auth-card {
        width: 100%;
        max-width: 410px;
        padding: 2.25rem;
        background: var(--surface-2);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-md);
    }

    .auth-hero-back {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        font-size: var(--fs-md);
        font-weight: 500;
        color: var(--text-secondary);
        text-decoration: none;
        transition: color var(--trans-fast);
    }
    .auth-hero-back:hover {
        color: var(--primary);
    }

    .auth-title {
        margin: 0 0 var(--space-2);
        font-size: 1.55rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        color: var(--text-strong);
    }
    .auth-subtitle {
        margin: 0 0 var(--space-9);
        font-size: 0.95rem;
        color: var(--text-muted);
    }

    .auth-form {
        display: flex;
        flex-direction: column;
        gap: var(--space-7);
    }
    .auth-field .ui-label {
        display: block;
        margin-bottom: var(--space-2);
    }
    .auth-label-row {
        display: flex !important;
        justify-content: space-between;
        align-items: baseline;
    }
    .auth-check {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        font-size: var(--fs-md);
        color: var(--text);
    }
    .auth-check input {
        accent-color: var(--primary);
    }

    .auth-submit {
        width: 100%;
        margin-top: var(--space-2);
    }

    .auth-footer {
        margin: var(--space-9) 0 0;
        padding-top: var(--space-7);
        border-top: 1px solid var(--border);
        text-align: center;
        font-size: var(--fs-md);
        color: var(--text-muted);
    }
    .auth-footer a {
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
    }
    .auth-footer a:hover {
        text-decoration: underline;
    }
    /* The code page's foot: a line, and under it the way out (a logout form, looking like a link) */
    .auth-footer--stack {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-2);
    }
    .auth-link-btn {
        padding: 0;
        border: 0;
        background: none;
        font: inherit;
        font-weight: 600;
        color: var(--primary);
        cursor: pointer;
    }
    .auth-link-btn:hover {
        text-decoration: underline;
    }
    /* The code: big, spaced digits */
    .auth-code {
        font-size: 1.4rem;
        letter-spacing: 0.4em;
        text-align: center;
        font-variant-numeric: tabular-nums;
    }

    /* The round icon of the result pages (verified, reset, invitation) */
    .auth-icon-wrap {
        width: 52px;
        height: 52px;
        margin: 0 0 var(--space-7);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
    }
    .auth-icon-wrap svg {
        width: 26px;
        height: 26px;
    }
    .auth-icon-wrap--success {
        background: var(--success-bg);
        color: var(--success);
    }
    .auth-icon-wrap--error {
        background: var(--danger-bg);
        color: var(--danger);
    }
    .auth-icon-wrap--info {
        background: var(--info-bg);
        color: var(--info);
    }

    .auth-hint {
        margin: 0 0 var(--space-7);
        font-size: var(--fs-sm);
        line-height: 1.5;
        color: var(--text-muted);
    }

    .auth-forgot {
        font-size: var(--fs-sm);
        font-weight: 400;
        color: var(--text-muted);
        text-decoration: none;
    }
    .auth-forgot:hover {
        color: var(--primary);
        text-decoration: underline;
    }
}
