/*
 * Log-in and password reset pages (includes/auth_page.php).
 * Colors only through the --auth-* variables in custom.css (schools override them in theme.css).
 */

.auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
    background: var(--auth-page-bg);
    color: var(--auth-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.auth-body *,
.auth-body *::before,
.auth-body *::after {
    box-sizing: border-box;
}

.auth-body form::after {
    content: none; /* custom.css clearfix */
}

/* Card: brand panel + form panel */
.auth-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    width: 100%;
    max-width: 880px;
    min-height: 500px;
    margin: 0 auto;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px 32px 32px;
    background: var(--auth-accent);
    color: var(--auth-on-accent);
}

.auth-brand__logo {
    /* As in the sidebar (.site_title.brand .brand-logo): the logo's own white edge, no backing */
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.auth-brand__text p {
    margin: 0;
}

.auth-brand__name {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.auth-brand__address {
    margin-top: 6px !important;
    font-size: 14px;
    opacity: 0.85;
}

.auth-brand__system {
    margin: auto 0 0;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--auth-on-accent) 25%, transparent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 56px;
}

.auth-panel > * {
    width: 100%;
    max-width: 380px;
}

.auth-panel__heading {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--auth-text);
}

.auth-lead {
    margin: 0 0 28px;
    color: var(--auth-muted);
    font-size: 14.5px;
}

.auth-lead strong {
    color: var(--auth-text);
}

/* Fields */
.auth-field {
    margin-bottom: 18px;
}

.auth-field__label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.auth-field label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-text);
}

.auth-field__hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-capslock {
    color: var(--auth-warning);
}

.auth-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    background: var(--auth-surface);
    color: var(--auth-text);
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 22%, transparent);
}

.auth-password {
    position: relative;
}

.auth-password .auth-input {
    padding-right: 68px;
}

.auth-password__toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    min-width: 56px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--auth-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.auth-password__toggle:hover {
    color: var(--auth-text);
}

.auth-password__toggle:focus-visible {
    outline: 2px solid var(--auth-accent);
}

/* Links and buttons */
.auth-body a {
    color: var(--auth-accent);
    font-weight: 500;
    text-decoration: none;
}

.auth-body a:hover {
    color: var(--auth-accent-hover);
    text-decoration: underline;
}

.auth-link-small {
    font-size: 13.5px;
}

.auth-body .auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin-top: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--auth-accent);
    color: var(--auth-on-accent) !important;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.auth-body .auth-button:hover {
    background: var(--auth-accent-hover);
    text-decoration: none;
}

.auth-button:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
}

.auth-button[aria-busy="true"] {
    opacity: 0.75;
    cursor: progress;
}

.auth-button--secondary {
    background: var(--auth-surface);
    border-color: var(--auth-border);
    color: var(--auth-text) !important;
}

.auth-body .auth-button--secondary:hover {
    background: var(--auth-page-bg);
}

.auth-back {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-border);
    font-size: 14px;
}

/* Messages */
.auth-panel__heading + .auth-alert {
    margin-top: 14px;
}

.auth-alert {
    margin-bottom: 20px;
    padding: 11px 14px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 14px;
}

.auth-alert--danger {
    color: var(--auth-danger);
    background: var(--auth-danger-bg);
    border-color: color-mix(in srgb, var(--auth-danger) 30%, transparent);
}

.auth-alert--success {
    color: var(--auth-success);
    background: var(--auth-success-bg);
    border-color: color-mix(in srgb, var(--auth-success) 30%, transparent);
}

.auth-alert--warning {
    color: var(--auth-warning);
    background: var(--auth-warning-bg);
    border-color: color-mix(in srgb, var(--auth-warning) 30%, transparent);
}

.auth-alert--info {
    color: var(--auth-info);
    background: var(--auth-info-bg);
    border-color: color-mix(in srgb, var(--auth-info) 30%, transparent);
}

.auth-footer {
    margin: 20px 0 0;
    padding: 0;
    background: none;
    border: 0;
    text-align: center;
    font-size: 13px;
    color: var(--auth-muted);
}

/* Phones and narrow tablets: one column, compact brand bar */
@media (max-width: 860px) {
    .auth-body {
        justify-content: flex-start;
        padding-top: 24px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 460px;
        min-height: 0;
    }

    .auth-brand {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 18px 20px;
    }

    .auth-brand__logo {
        width: 52px;
        height: 52px;
        flex: none;
    }

    .auth-brand__name {
        font-size: 16px;
    }

    .auth-brand__address {
        margin-top: 2px !important;
        font-size: 13px;
    }

    .auth-brand__system {
        display: none;
    }

    .auth-panel {
        padding: 28px 24px 32px;
    }
}
