/* ============================================================
   Foresight Schools, Ikom — staff sign-in

   One page, so one stylesheet. A single card on a tinted ground.
   Every colour comes from the theme tokens the panel and the
   website already share, so a change in Appearance reaches this
   screen too rather than leaving it as the one door in the
   building painted a different maroon.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
input, button { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--color-primary, #800000); }

/* icon() emits an inline <svg class="ico"> sized by its own attributes; this
   just stops it being squashed inside a flex row. */
.ico { flex: none; }

body.sign {
    min-height: 100vh; min-height: 100dvh;
    display: grid; place-items: center;
    padding: 28px 16px 40px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px; line-height: 1.6;
    color: var(--color-text, #1a1a1a);
    /* A soft wash of the school's colour at the top, fading into the page
       ground — enough to place the card without competing with it. */
    background:
        radial-gradient(1200px 560px at 50% -12%,
            color-mix(in srgb, var(--color-primary, #800000) 26%, transparent), transparent 72%),
        var(--color-bg, #f4f6f9);
    -webkit-font-smoothing: antialiased;
}

/* ── The card ─────────────────────────────────────────────── */
.sign__card {
    width: min(408px, 100%);
    padding: 36px 34px 28px;
    text-align: center;
    background: var(--color-surface, #fff);
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(16, 20, 26, .04),
        0 22px 56px rgba(16, 20, 26, .13);
}

/* The crest, given room: it is the school's mark and the first thing a member
   of staff should recognise on the screen. */
.sign__crest {
    width: 104px; height: auto;
    margin: 0 auto 18px;
}

.sign__school {
    font-size: 19px; font-weight: 700; line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--color-primary, #800000);
}
.sign__kicker {
    margin-bottom: 26px; padding-bottom: 20px;
    border-bottom: 1px solid var(--color-line, #eceff2);
    font-size: 11.5px; font-weight: 650; letter-spacing: .15em;
    text-transform: uppercase; color: var(--color-slate, #708090);
}

/* ── Messages ─────────────────────────────────────────────── */
.sign__msg {
    display: flex; gap: 9px; align-items: flex-start; text-align: left;
    margin-bottom: 20px; padding: 12px 14px;
    border-radius: 10px; font-size: 13.5px; line-height: 1.5;
}
.sign__msg svg { margin-top: 1px; }
.sign__msg--err { background: #FEF3F2; border: 1px solid #FECDCA; color: #B42318; }
.sign__msg--ok  { background: #ECFDF3; border: 1px solid #ABEFC6; color: #067647; }

/* ── Fields ───────────────────────────────────────────────── */
.sign__field { margin-bottom: 16px; text-align: left; }
.sign__field label {
    display: block; margin-bottom: 7px;
    font-size: 12.5px; font-weight: 650;
}
.sign__field input {
    width: 100%; padding: 12px 14px;
    font-size: 15px;
    background: #fff;
    color: var(--color-text, #1a1a1a);
    border: 1px solid var(--color-line, #dfe3e8);
    border-radius: 10px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.sign__field input::placeholder { color: #a8b0b8; }
.sign__field input:focus {
    outline: none;
    border-color: var(--color-primary, #800000);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #800000) 15%, transparent);
}

/* A password box with an eye in it. The button sits inside the field's box, and
   the input is given room on the right so a long password never runs under it. */
.sign__pw { position: relative; }
.sign__pw input { padding-right: 46px; }

.sign__peek {
    position: absolute; top: 50%; right: 6px;
    transform: translateY(-50%);
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 8px;
    color: var(--color-slate, #708090);
    transition: color .16s ease, background .16s ease;
}
.sign__peek:hover { color: var(--color-primary, #800000); background: var(--color-line, #f1f3f5); }
.sign__peek:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-primary, #800000) 45%, transparent);
    outline-offset: 1px;
}

/* Both icons are in the button; this shows one. The script then only ever
   flips a class, which means it needs nothing from PHP and can therefore be
   an ordinary file — which is what this app's script-src 'self' requires.
   The button is a grid with one cell, so the two spans stack rather than
   sitting side by side and shifting the layout as they swap. */
.sign__peek-on, .sign__peek-off { grid-area: 1 / 1; display: grid; place-items: center; }
.sign__peek-off { display: none; }
.sign__peek.is-shown .sign__peek-on  { display: none; }
.sign__peek.is-shown .sign__peek-off { display: grid; }

.sign__go {
    display: flex; gap: 9px; align-items: center; justify-content: center;
    width: 100%; margin-top: 10px; padding: 13px 20px;
    font-size: 15px; font-weight: 650; color: #fff;
    background: var(--color-primary, #800000);
    border-radius: 10px;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--color-primary, #800000) 24%, transparent);
    transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}
.sign__go:hover  { filter: brightness(1.09); }
.sign__go:active { transform: translateY(1px); box-shadow: 0 3px 10px color-mix(in srgb, var(--color-primary, #800000) 22%, transparent); }
.sign__go:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-primary, #800000) 42%, transparent);
    outline-offset: 2px;
}

.sign__foot {
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid var(--color-line, #eceff2);
    font-size: 12.5px; line-height: 1.55;
    color: var(--color-slate, #708090);
}

@media (max-width: 420px) {
    .sign__card  { padding: 28px 22px 24px; border-radius: 14px; }
    .sign__crest { width: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    .sign__go, .sign__field input { transition: none; }
    .sign__go:active { transform: none; }
}
