/**
 * Password reset flow - /forgot-password and /reset-password.
 * Single-column auth surface, so container-small (600px) per the layout scale.
 * Everything here references global.css tokens; no raw hex, no forked palette.
 */

body {
    background: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.reset-card {
    width: 100%;
    max-width: 28rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(1.5rem, 5vw, 2.5rem);
}

.reset-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: var(--spacing-xl);
}

.reset-mark {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    margin-bottom: var(--spacing-lg);
}

.reset-mark.is-done {
    background: color-mix(in srgb, var(--success) 14%, transparent);
    color: var(--success);
}

.reset-mark.is-warn {
    background: color-mix(in srgb, var(--warning) 16%, transparent);
    color: var(--warning);
}

.reset-card h1 {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-wrap: balance;
}

.reset-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
    max-width: 32rem;
}

.reset-card p + p {
    margin-top: var(--spacing-sm);
}

.reset-note {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.reset-form {
    margin-top: var(--spacing-xl);
}

.form-field + .form-field {
    margin-top: var(--spacing-md);
}

.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-field input {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.form-field input:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

.form-field input[aria-invalid="true"] {
    border-color: var(--danger);
}

.form-help {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

.reset-form .btn {
    margin-top: var(--spacing-lg);
}

.reset-actions {
    margin-top: var(--spacing-xl);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.reset-footer {
    margin-top: var(--spacing-lg);
    font-size: 0.875rem;
}

/* Link colour must not reach buttons - `.reset-card a` outranks `.btn-primary`
   on specificity and would repaint white button text indigo. */
.reset-card a:not(.btn) {
    color: var(--primary);
}

/* The UA rule for [hidden] is display:none, but only if no author rule sets
   display. Make it explicit so the mismatch message really starts hidden. */
[hidden] {
    display: none !important;
}

.alert {
    margin-top: var(--spacing-lg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.alert-error {
    background: color-mix(in srgb, var(--danger) 12%, var(--bg-primary));
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    border-left: 3px solid var(--danger);
}
