/*
 * Sign-in (accounts/login.html), the one public page. One markup, two
 * layouts.
 *
 * Phone (below 768px): the campus photo is the page. The seal and the
 * certification strip sit in a dark band over its top; the lower part is a
 * glass panel — the same photo blurred, fading from dark at its lip to
 * nearly clear at the bottom — with the form straight on it, no card.
 * Everything, footer included, fits one 740px screen.
 *
 * Web (768px up): split screen. The photo fills the left half edge to
 * edge; the right half is a light panel holding one centred column — the
 * logos, the greeting, the form, the footer — in ink on off-white.
 *
 * Tokens come from app.css (core/base.html loads it). Poppins throughout:
 * regular weight for text, semibold only where a thing is pressed or named.
 */

.auth-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: #fff;
    /* The photo scaled past the screen and pulled up, so the building — not
       the sky above it — is what the top of a portrait screen shows. */
    background: #0d1b1e url("../images/reg.jpeg") center 118% / auto 118% no-repeat;
}

/* ── Logos: over the photo band on a phone, atop the column on the web ──── */
.auth-logos {
    position: absolute;
    left: 0; right: 0; top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 16px 0;
}
.auth-seal {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
}
.auth-strip {
    /* The strip is 4.2:1; on a phone it takes the width left beside the seal
       (about 70px tall on a 390px screen) so the four marks stay readable. */
    width: min(100% - 62px, 320px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

/* ── Phone: the photo band ───────────────────────────────────────────────── */
.auth-photo {
    position: relative;
    height: 40vh;
    height: 40dvh;
    flex: 0 0 auto;
}
.auth-photo::before {
    /* The dark band the logos sit in. */
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 46%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 30%, rgba(0, 0, 0, 0));
}

/* ── Phone: the glass panel and the footer under it ──────────────────────── */
.auth-side {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.auth-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: -16px;                       /* the panel's rounded lip rides over the photo */
    padding: 18px 22px 16px;
    border-radius: 20px 20px 0 0;
    border-top: 2px solid var(--brand-600);  /* the one line of brand green */
    /* Darkest at the lip, and more and more of the photo toward the bottom. */
    background: linear-gradient(to bottom, rgba(10, 24, 28, 0.58) 0%, rgba(10, 24, 28, 0.42) 45%, rgba(10, 24, 28, 0.24) 100%);
    -webkit-backdrop-filter: blur(18px) saturate(0.9);
    backdrop-filter: blur(18px) saturate(0.9);
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
@supports not (backdrop-filter: blur(1px)) {
    .auth-panel { background: linear-gradient(to bottom, rgba(10, 24, 28, 0.9), rgba(10, 24, 28, 0.78)); }
}

.auth-form {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 2px;
    color: #fff;
}
.auth-lead {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 14px;
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.auth-field { position: relative; margin-bottom: 12px; }
.auth-field-icon {
    position: absolute;
    left: 14px;
    top: 23px;
    transform: translateY(-50%);
    color: var(--ink-500);
    font-size: 0.9rem;
    pointer-events: none;
    text-shadow: none;
}
.auth-input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px 0 40px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    background: #fff;
    font-size: 16px;                         /* no iOS zoom on focus */
    font-weight: 400;
    font-family: inherit;
    color: var(--ink-900);
    text-shadow: none;
}
.auth-input::placeholder { color: var(--ink-500); font-weight: 400; }
.auth-input:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.auth-input.is-invalid { border-color: #ffb4a8; }
.auth-field-error { font-size: 0.78rem; color: #ffd0c8; margin-top: 4px; }

.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 12px;
    line-height: 1.35;
}
.auth-terms input { width: 18px; height: 18px; margin-top: 0; flex-shrink: 0; accent-color: #fff; }
.auth-terms a { color: #fff; font-weight: 600; }

/* ── Buttons and the lines under them ────────────────────────────────────── */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: var(--brand-800);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-shadow: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.auth-btn:hover, .auth-btn:focus-visible { background: #e6f4f1; color: var(--brand-900); }
.auth-btn:active { transform: scale(0.98); }

.auth-aside {
    text-align: center;
    margin-top: 10px;
    font-size: 0.8rem;
}
.auth-aside a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.auth-notice {
    font-size: 0.76rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}
.auth-notice i { margin-right: 4px; }
.auth-notice b { color: #fff; }

.auth-alt {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    text-align: center;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.8);
}
.auth-alt button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    text-shadow: inherit;
}

/* ── Footer: one line on a phone, two on the web ─────────────────────────── */
.auth-footer {
    flex: 0 0 auto;
    text-align: center;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom, 0px));
    font-size: 0.66rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.7);
    background: var(--ink-800);
}
.auth-footer-line {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 12px;
    margin-bottom: 2px;
}
.auth-footer-line a, .auth-footer-line span { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.auth-footer-line a:hover { color: #fff; }
.auth-footer-line .social { font-size: 0.8rem; }
.auth-footer-long { display: none; }
.auth-footer-short { display: block; }

/* ── The account modal: a checklist that unlocks the last step ───────────── */
.howto-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.howto-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    background: var(--surface-1);
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.howto-step label { display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; width: 100%; }
.howto-step input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--brand-600); }
.howto-step:has(input:checked) { background: var(--brand-50); border-color: var(--brand-600); }
.howto-num {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--ink-200);
    color: var(--ink-700);
}
.howto-text { font-size: 0.9rem; line-height: 1.4; color: var(--ink-900); }
.howto-text b { display: block; font-weight: 600; }
.howto-final { opacity: 0.45; }
.howto-final.is-ready { opacity: 1; background: var(--brand-50); border-color: var(--brand-600); }
.howto-final.is-ready .howto-num { background: var(--brand-600); color: #fff; }
.howto-hint { font-size: 0.78rem; color: var(--ink-500); margin: 10px 0 0; }
.howto-final.is-ready ~ .howto-hint { display: none; }

/* ── Web: split screen, light column on the right ────────────────────────── */
@media (min-width: 768px) {
    .auth-page {
        flex-direction: row;
        background: #f4f7f7;
        color: var(--ink-900);
    }
    /* The logos share the form's column, so the seal's left edge and the
       fields' left edge are the same line. */
    .auth-page { --auth-col: 440px; --auth-pad: 48px; }
    .auth-logos {
        position: relative;
        justify-content: flex-start;
        width: min(100%, calc(var(--auth-col) + 2 * var(--auth-pad)));
        margin: 0 auto;
        padding: 26px var(--auth-pad) 0;
        gap: 16px;
        flex: 0 0 auto;
    }
    .auth-seal { width: 56px; height: 56px; border-color: var(--brand-200); }
    .auth-strip { width: auto; height: 64px; max-width: min(100%, 420px); filter: none; }

    .auth-photo {
        flex: 0 0 50%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        background: url("../images/reg.jpeg") center / cover no-repeat;
    }
    .auth-photo::before {
        top: auto;
        bottom: 0;
        height: 30%;
        background: linear-gradient(to top, rgba(0, 30, 26, 0.55), rgba(0, 0, 0, 0));
    }

    .auth-side { flex: 1 1 50%; }
    .auth-panel {
        margin: 0;
        padding: 24px var(--auth-pad) 32px;
        border: 0;
        border-radius: 0;
        background: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        text-shadow: none;
        overflow: visible;
    }
    .auth-form { max-width: var(--auth-col); }

    .auth-title { font-size: 2.2rem; color: var(--ink-900); margin-bottom: 4px; }
    .auth-lead { font-size: 1.05rem; color: var(--ink-700); margin-bottom: 26px; }

    .auth-field { margin-bottom: 14px; }
    .auth-field-icon { top: 24px; }
    .auth-input {
        min-height: 48px;
        font-size: 17px;
        border: 1px solid var(--ink-200);
        background: #fff;
    }
    .auth-input:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-200); }
    .auth-input.is-invalid { border-color: var(--err-ink); }
    .auth-field-error { color: var(--err-ink); }

    .auth-terms { font-size: 0.92rem; color: var(--ink-700); margin-bottom: 18px; }
    .auth-terms input { accent-color: var(--brand-600); }
    .auth-terms a { color: var(--brand-700); }

    .auth-btn { background: var(--brand-600); color: #fff; font-size: 1rem; }
    .auth-btn:hover, .auth-btn:focus-visible { background: var(--brand-700); color: #fff; }

    .auth-aside { font-size: 0.92rem; margin-top: 14px; }
    .auth-aside a { color: var(--brand-700); }
    .auth-notice {
        font-size: 0.88rem;
        color: var(--warn-ink);
        background: var(--warn-tint);
        border-radius: 10px;
        padding: 9px 12px;
        text-align: left;
    }
    .auth-notice b { color: inherit; }

    .auth-alt { border-top-color: var(--ink-200); color: var(--ink-700); font-size: 0.95rem; margin-top: 22px; padding-top: 18px; }
    .auth-alt button { color: var(--brand-700); }

    .auth-footer { font-size: 0.74rem; padding: 10px 24px; }
    .auth-footer-line { display: flex; }
    .auth-footer-long { display: block; }
    .auth-footer-short { display: none; }
}

@media (min-width: 1200px) {
    .auth-page { --auth-col: 460px; --auth-pad: 64px; }
    .auth-logos { padding-top: 32px; }
    .auth-panel { padding-bottom: 40px; }
    .auth-title { font-size: 2.5rem; }
}
