/* Sign-in pages. Tokens and rules: docs/brand.md. Only --brand and --on-brand come
   from the product (set inline by hub/auth/base.html); everything else is Iorwerth. */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght.938c6e8019b6.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Marcellus";
  src: url("../fonts/marcellus-latin-400.d8d78c8d074b.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ior-blue: #163A7A;       /* Keep Blue: primary, default brand, footer wordmark */
  --ior-blue-2: #2B5BB7;     /* Signal Blue: links */
  --ior-mist: #DCE6F6;       /* tints, notices */
  --ior-parchment: #F7F5F0;  /* page background */
  --ior-night: #0E1E3E;      /* dark ground; not used on auth pages yet */
  --ior-ink: #171A21;        /* body text */
  --brand: var(--ior-blue);
  --on-brand: #FFFFFF;
  --display: "Marcellus", Georgia, serif;
  --text: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ior-parchment);
  color: var(--ior-ink);
  font: 400 16px/1.5 var(--text);
}
a { color: var(--ior-blue-2); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.auth {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 16px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.auth-header { text-align: center; }
.auth-logo { max-height: 48px; max-width: 220px; }
.auth-name { margin: 0; font: 400 28px/1.2 var(--display); color: var(--brand); }

.auth-card {
  background: #FFFFFF;
  border: 1px solid var(--ior-mist);
  border-radius: 12px;
  padding: 24px 20px;
}
.auth-card h1 {
  margin: 0 0 12px;
  font: 700 22px/1.3 var(--text);
  border-left: 4px solid var(--brand);
  padding-left: 10px;
}
.auth-card p { margin: 0 0 16px; }
.auth-card label { display: block; font-weight: 600; margin-bottom: 4px; }
.auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  border: 1px solid #B9C2D0;
  border-radius: 8px;
  background: #FFFFFF;
}
.auth-card input:focus-visible { border-color: var(--brand); }
.auth-card .helptext, .auth-card .hint { display: block; font-size: 14px; color: #4A5261; }
.auth-card ul.errorlist { list-style: none; margin: 0 0 4px; padding: 0; color: #A4161A; font-size: 14px; }

.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand);
  font: 600 16px/1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}
.btn-outline { background: transparent; color: var(--ior-ink); }
.btn-link { background: none; border-color: transparent; color: var(--ior-blue-2); text-decoration: underline; }
.auth-card hr { border: 0; border-top: 1px solid var(--ior-mist); margin: 20px 0; }
.auth-card div:has(> .btn) { display: flex; flex-direction: column; gap: 8px; }
.auth-links { font-size: 14px; }

.auth-messages { list-style: none; margin: 0 0 16px; padding: 10px 12px; background: var(--ior-mist); border-radius: 8px; }
[aria-live]:empty { display: none; }
.notice { background: var(--ior-mist); border-radius: 8px; padding: 8px 12px; font-size: 14px; }

.auth-footer { margin-top: auto; text-align: center; font-size: 14px; color: #4A5261; }
.auth-footer p { margin: 0 0 8px; }
.powered { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.powered .wordmark { font-family: var(--display); color: var(--ior-blue); font-size: 15px; }

/* Django renders the label before the checkbox; show them as one row, box first. */
.auth-card p:has(> input[type="checkbox"]) {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.auth-card p:has(> input[type="checkbox"]) label { margin: 0; font-weight: 400; }
.auth-card input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.auth-card .helptext ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: #4A5261; }

/* Account management pages (allauth's "manage" layout): wider, with a menu. */
.manage .auth { max-width: 640px; }
.manage-nav { display: flex; flex-wrap: wrap; gap: 0; justify-content: center; }
.manage-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px;
  border-radius: 8px; color: var(--ior-ink); text-decoration: none; font-weight: 600;
}
.manage-nav a:hover { background: var(--ior-mist); }
.manage-nav a[aria-current="page"] { background: #FFFFFF; box-shadow: inset 0 -3px 0 var(--brand); }
.manage .actions, .manage .auth-card div:has(> .btn) { flex-direction: row; flex-wrap: wrap; }
.manage .btn { width: auto; }

/* The staff Manage UI (hub.manage): the same frame, wide enough for its tables. */
.staff .auth { max-width: 1040px; }
.staff .filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.staff table.events td { vertical-align: top; overflow-wrap: anywhere; }
.staff dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
.staff dd { margin: 0; }
/* Read by screen readers, not shown: the search box's label. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.auth-card h2 { margin: 24px 0 8px; font: 700 18px/1.3 var(--text); }
.auth-card section:first-of-type h2 { margin-top: 8px; }
.auth-card section > ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-card strong[title], .auth-card h1 + p strong { font-weight: 600; }
.auth-card table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 14px; }
.auth-card th, .auth-card td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--ior-mist); vertical-align: top; }
.auth-card th { font-weight: 600; color: #4A5261; }
.auth-card td strong {
  display: inline-block; margin: 0 4px 2px 0; padding: 1px 8px; border-radius: 999px;
  background: var(--ior-mist); font-size: 12px; font-weight: 600;
}
/* allauth puts radios before their label, unlike checkboxes. */
.auth-card p:has(> input[type="radio"]) { display: flex; align-items: center; gap: 10px; }
.auth-card p:has(> input[type="radio"]) label { margin: 0; font-weight: 400; }
.auth-card input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.auth-card details { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--ior-mist); border-radius: 8px; }
.auth-card summary { cursor: pointer; font-weight: 600; }
.auth-card img:not(.iorwerth-mark) { display: block; max-width: 220px; margin: 12px auto; }
.auth-card textarea { width: 100%; font: 14px/1.5 ui-monospace, monospace; padding: 8px; border: 1px solid #B9C2D0; border-radius: 8px; }
.auth-card pre, .auth-card code { font-family: ui-monospace, monospace; font-size: 14px; }
