/* Sign-in, register, and password-reset pages */

body.auth {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--ink-50);
}

body.auth .site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

body.auth .site-header-inner {
    padding-top: .75rem;
    padding-bottom: .75rem;
}

body.auth .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    max-width: none;
}

.auth-flash {
    background: var(--ok-bg);
    border-bottom: 1px solid #bbf7d0;
    color: var(--ink-800);
    padding: .75rem 1.25rem;
    text-align: center;
    font-size: .92rem;
}

.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem 2rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(37, 99, 235, .08), transparent),
        var(--ink-50);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem 2rem 1.75rem;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    display: inline-flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    text-decoration: none;
}

.auth-logo:hover {
    text-decoration: none;
    opacity: .92;
}

.auth-logo img {
    height: 36px;
    width: auto;
}

.auth-card-header h1 {
    margin: 0 0 .4rem;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-lede {
    margin: 0;
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.45;
}

.auth-form .field {
    margin-bottom: 1rem;
}

.auth-form .field label {
    font-size: .88rem;
}

/* Keep controls inside their box/grid track (prevents two-column overflow) */
.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
    box-sizing: border-box;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    padding: .7rem .85rem;
    font-size: 1rem;
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: .25rem 0 1.25rem;
}

.auth-form-row .field.inline {
    margin-bottom: 0;
}

.auth-form-row .field.inline label {
    font-weight: 500;
    font-size: .88rem;
    color: var(--ink-700);
    cursor: pointer;
}

.auth-forgot {
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.auth-forgot:hover {
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    padding: .75rem 1rem;
    font-size: 1rem;
}

.auth-card-footer {
    margin-top: 1.5rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .92rem;
    color: var(--ink-700);
}

.auth-card-footer a {
    font-weight: 600;
}

.auth-form .errors {
    background: var(--error-bg);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: .65rem .85rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .88rem;
}

.auth-footer nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-footer a {
    color: var(--ink-600);
    font-weight: 500;
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1.25rem 1.35rem;
    }

    .auth-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .65rem;
    }

    .auth-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.auth-card-wide {
    max-width: 480px;
}

.auth-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

/* Allow grid/flex items to shrink so inputs don't push past their track */
.auth-form-row-2 > .field,
.auth-form-row .field {
    min-width: 0;
}

.auth-hint {
    font-size: .85rem;
    margin: -.25rem 0 1rem;
}

.auth-message {
    margin-bottom: 1.5rem;
    line-height: 1.55;
}

.auth-actions-stack {
    display: grid;
    gap: .75rem;
}

.auth-actions-stack .btn {
    width: 100%;
    text-align: center;
}

.auth-code-input {
    font-size: 1.35rem;
    letter-spacing: .25rem;
    text-align: center;
    font-weight: 600;
}

.auth-inline-form {
    display: inline;
}

.auth-footer-divider {
    margin: 0 .5rem;
    color: var(--ink-400);
}

@media (max-width: 480px) {
    .auth-form-row-2 {
        grid-template-columns: 1fr;
    }
}
