/* Sign-in style pages (login, accept invitation): same language as the site and admin. */
/* Same language as the public site and admin: charcoal, KGP light blue, Poppins + DM Sans */
:root {
    --ink: #212226;
    --ink-2: #34363b;
    --sky: #add8e6;
    --sky-strong: #276f87;
    --sky-text: #1f5f75;
    --bg: #f4f6f7;
    --surface: #ffffff;
    --border: #cfd6db;
    --text: #212226;
    --muted: #5b6168;
    --ok: #1d7a46; --ok-bg: #e4f5ea;
    --bad: #b42318; --bad-bg: #fde8e7;
    --info-bg: #e6f4f9;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
h1, h2 { font-family: 'Poppins', 'DM Sans', sans-serif; margin: 0; letter-spacing: -0.01em; }
a { color: var(--sky-text); }
:focus-visible { outline: 2px solid var(--sky-strong); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* Brand panel */
.brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    color: #fff;
    background: var(--ink) url('/assets/images/backgrounds/breadcrumb-v1-bg.jpg') center / cover no-repeat;
    isolation: isolate;
    overflow: hidden;
}
.brand::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(33, 34, 38, 0.72) 0%, rgba(33, 34, 38, 0.86) 55%, rgba(33, 34, 38, 0.96) 100%);
}
.brand__top { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand__top img { width: 48px; height: 48px; border-radius: 50%; background: #fff; padding: 3px; }
.brand__top span { font-family: 'Poppins', sans-serif; font-size: 18px; font-weight: 500; }
.brand__copy { max-width: 480px; }
.brand__eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sky); margin: 0 0 14px; }
.brand__copy h1 { font-size: clamp(40px, 4.6vw, 64px); font-weight: 700; line-height: 1.05; color: #fff; }
.brand__copy h1 span { color: var(--sky); }
.brand__copy p { margin: 18px 0 0; font-size: 17px; color: rgba(255, 255, 255, 0.82); max-width: 420px; }
.brand__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 15px; color: rgba(255, 255, 255, 0.78); }
.brand__foot a { color: #fff; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 999px; transition: background-color 150ms ease, border-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .brand__foot a:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; } }

/* Form side */
.panel { display: flex; flex-direction: column; padding: 28px 48px; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; font-weight: 500; text-decoration: none; padding: 6px 2px; transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--text); } }
.form-wrap { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }

.mode-logo {
    display: inline-flex; width: 56px; height: 56px; margin-bottom: 20px; padding: 0;
    border: 0; border-radius: 50%; background: #fff; cursor: pointer;
    box-shadow: 0 0 0 1px var(--border);
    transition: transform 160ms var(--ease-out), box-shadow 160ms ease;
}
.mode-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; padding: 3px; }
.mode-logo:active { transform: scale(0.96); }
.heading h2 { font-size: 30px; font-weight: 600; line-height: 1.2; }
.heading p { margin: 8px 0 0; color: var(--muted); }
.mode-badge { display: inline-block; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px; background: var(--ink); color: var(--sky); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.alert { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.45; }
.alert i { margin-top: 3px; }
.alert--danger, .alert--warning { background: var(--bad-bg); color: var(--bad); }
.alert--success { background: var(--ok-bg); color: var(--ok); }
.alert--info { background: var(--info-bg); color: var(--sky-text); }
.alert p { margin: 0; flex: 1; overflow-wrap: anywhere; }

form { margin-top: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 15px; }
.control {
    display: flex; align-items: center;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.control:focus-within { border-color: var(--sky-strong); box-shadow: 0 0 0 3px rgba(173, 216, 230, 0.55); }
.control.is-invalid { border-color: var(--bad); }
.control.is-invalid:focus-within { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16); }
.control > i { width: 46px; flex-shrink: 0; text-align: center; color: #80868c; }
.control .prefix { margin-left: 14px; margin-right: 10px; padding-right: 10px; border-right: 1px solid #e3e7ea; color: var(--muted); font-weight: 500; white-space: nowrap; }
.control input {
    flex: 1; min-width: 0; height: 50px; padding: 0 14px 0 0;
    border: 0; background: transparent; font: inherit; color: var(--text);
}
.control input:focus { outline: none; }
.control input:first-child { padding-left: 14px; }
.control input::placeholder { color: #8a9096; }
.control input:disabled { color: var(--muted); }
.control.is-locked { background: #eef1f3; }
.reveal { width: 46px; height: 46px; border: 0; background: none; color: #80868c; cursor: pointer; border-radius: 10px; }
@media (hover: hover) and (pointer: fine) { .reveal:hover { color: var(--text); } }
.hint { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.error { display: block; margin-top: 6px; font-size: 14px; color: var(--bad); }
.error:empty { display: none; }

.otp { margin: 4px 0 18px; padding: 16px; border-radius: 14px; background: var(--info-bg); }
.otp p { margin: 0 0 12px; font-size: 15px; color: var(--sky-text); }
.otp .control input { letter-spacing: 0.45em; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.otp__actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.linkish { padding: 4px 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--sky-text); cursor: pointer; }
.linkish:disabled { color: var(--muted); cursor: default; }
@media (hover: hover) and (pointer: fine) { .linkish:not(:disabled):hover { text-decoration: underline; } }

.remember { display: flex; align-items: center; gap: 10px; margin: 4px 0 22px; font-size: 15px; color: var(--muted); cursor: pointer; width: fit-content; }
.remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }

.btn-primary {
    width: 100%; height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: 12px; background: var(--ink); color: #fff;
    font: 600 16px/1 'DM Sans', sans-serif; cursor: pointer;
    transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .btn-primary:hover:not(:disabled) { background: var(--ink-2); } }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.switch-mode { margin-top: 22px; text-align: center; font-size: 15px; color: var(--muted); }
.join-cta { display: none; margin-top: 28px; padding-top: 20px; border-top: 1px solid #e3e7ea; text-align: center; font-size: 15px; color: var(--muted); }
.join-cta a { font-weight: 700; }

@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .brand { min-height: auto; padding: 18px 20px; padding-top: max(18px, env(safe-area-inset-top)); flex-direction: row; align-items: center; }
    .brand__copy, .brand__foot { display: none; }
    .brand__top img { width: 40px; height: 40px; }
    .brand__top span { font-size: 16px; }
    .panel { padding: 16px 20px 32px; }
    .form-wrap { margin: 0 auto; padding: 12px 0 0; }
    .join-cta { display: block; }
    /* The header band already shows the logo; staff sign-in stays reachable through the link below the form */
    .mode-logo { display: none; }
    /* Keep the last line clear of the floating accessibility button */
    .panel { padding-bottom: 84px; }
    .heading h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
