/* The account screens (design-system "Account screens"): forgot / reset / set up a password, the
   outcomes of those links, access denied. One card on the brand gradient, every colour a token, so
   they follow the device's theme like the app and wear the same type, radius and buttons.
   Loaded by Views/Shared/_AuthHead.cshtml; Login.cshtml keeps its own card (it is branded per
   school) but reads the same head. */

body.auth {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
    font-family: var(--font-sans);
    color: var(--text-color);
}

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(var(--space-4), env(safe-area-inset-top, 0px)) max(var(--space-4), env(safe-area-inset-right, 0px))
             max(var(--space-4), env(safe-area-inset-bottom, 0px)) max(var(--space-4), env(safe-area-inset-left, 0px));
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
    overflow: hidden;
}

.auth-header {
    padding: var(--space-8) var(--space-6) var(--space-6);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

/* The one picture on the card: what this screen is about, in a round tile of its tone. */
.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: var(--space-3);
    border-radius: var(--radius-full);
    background: var(--entity-brand-bg);
    color: var(--entity-brand-fg);
    font-size: var(--icon-lg);
}

.auth-icon--success { background: var(--status-paid-bg); color: var(--status-paid-fg); }
.auth-icon--warning { background: var(--status-overdue-bg); color: var(--status-overdue-fg); }
.auth-icon--danger { background: var(--status-urgent-bg); color: var(--status-urgent-fg); }

.auth-title {
    margin: 0 0 var(--space-1);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-color);
    text-wrap: balance;
}

.auth-subtitle {
    margin: 0;
    font-size: var(--text-base);
    color: var(--text-muted);
}

.auth-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-6);
}

.auth-body > * {
    margin-bottom: 0;
}

.auth-body p {
    margin: 0;
    line-height: var(--leading-normal);
}

/* A quiet note: what happens next, what to check. Never a status colour. */
.auth-note {
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.auth-note ul,
.auth-note ol {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
}

.auth-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.auth-alert--danger { background: var(--status-urgent-bg); color: var(--status-urgent-fg); }
.auth-alert--success { background: var(--status-paid-bg); color: var(--status-paid-fg); }
.auth-alert--info { background: var(--status-pending-bg); color: var(--status-pending-fg); }

.auth-alert ul {
    margin: var(--space-1) 0 0;
    padding-left: var(--space-5);
}

.auth-card .form-label {
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-color);
}

/* 16px text so iOS never zooms into a field; 48px tall for a thumb. */
.auth-card .form-control {
    min-height: 3rem;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem var(--focus-ring);
}

.auth-card .form-control::placeholder {
    color: var(--text-muted);
}

.auth-card .form-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.auth-card .field-validation-error,
.auth-card .text-danger {
    display: block;
    margin-top: var(--space-1);
    color: var(--status-urgent-fg) !important;
    font-size: var(--text-sm);
}

.auth-card .input-validation-error {
    border-color: var(--status-urgent-fg);
}

/* These screens don't load custom.css (the app's brand override layer), so Bootstrap 5.1's compiled
   blue would show: the brand is pinned here for the buttons they use. */
.auth-card .btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus,
.auth-card .btn-primary:active {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.auth-card .btn:focus,
.auth-card .btn:focus-visible {
    box-shadow: 0 0 0 0.25rem var(--focus-ring);
}

.auth-card .btn-outline-secondary {
    color: var(--text-color);
    border-color: var(--border);
}

.auth-card .btn-outline-secondary:hover {
    background-color: var(--surface);
    color: var(--text-color);
    border-color: var(--border);
}

/* The one action: a full-width brand button, 48px tall. */
.auth-submit {
    width: 100%;
    min-height: 3rem;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.auth-back {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-muted);
    font-size: var(--text-sm);
    text-decoration: none;
}

.auth-back:hover,
.auth-back:focus-visible {
    color: var(--text-color);
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .auth-header {
        padding: var(--space-6) var(--space-4) var(--space-4);
    }

    .auth-body {
        padding: var(--space-5) var(--space-4);
    }
}

/* Google's rendered button (installed Android app) sits in a frame whose page is light. A dark page
   around a light frame makes the browser paint the frame's box white, so the container matches the
   frame and the frame stays see-through (design-system "Google's own button follows the theme too"). */
.g_id_signin {
    color-scheme: light;
    display: flex;
    justify-content: center;
}
