/* FetchApp — the account pages of the platform host: direct signup (/signup, "Check your email",
   "Confirm your email", its refusals) and the FetchApp ID pages of the app (/sso/*: the account
   picker, the enrol gate, the link confirmation, the errors, "Signed out everywhere").
   The same shell as the FetchApp ID pages they alternate with (dev/fetchapp-id
   ui/priv/static/assets/app.css): the mark + wordmark header, the palette (the admin design
   system's tokens), type, card, buttons, focus ring and footer — so the journey from signup to
   the admin never changes look. One file, served by the app (FetchappWeb.AccountLayout); the
   pages' CSP names exactly this file and the mark. System fonts only; no third-party request.
   Hand-written, no build step. */

:root {
  color-scheme: light;
  --text: #172e38;
  --muted: #435c65;
  --ground: #f3f6f7;
  --card: #ffffff;
  --line: #d6e0e4;
  --line-strong: #a9bcc4;
  --accent: #07536c;
  --accent-ink: #ffffff;
  --danger: #a3172c;
  --notice-bg: #fff5d6;
  --notice-line: #e3c768;
  --info-bg: #e9f3f6;
  --info-line: #b5d0d9;
  font-family: system-ui, sans-serif;
  color: var(--text);
  background: var(--ground);
}

* { box-sizing: border-box; }
body { margin: 0; padding: 2rem 1rem; line-height: 1.6; }
header.brand, main, footer { max-width: 36rem; margin-left: auto; margin-right: auto; }
header.brand { display: flex; align-items: center; gap: .6rem; padding: 0 .25rem 1rem; }
header.brand .wordmark { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
header.brand img { width: 1.75rem; height: 1.75rem; display: block; }

section { padding: 1.5rem; margin-bottom: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: .75rem; }
h1, h2, p, ul, ol { margin-top: 0; }
h1 { font-size: 1.6rem; line-height: 1.25; margin-bottom: .5rem; }
p:last-child, ul:last-child, ol:last-child, form:last-child, .field:last-child { margin-bottom: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: .1rem .35rem; background: var(--ground); border-radius: .25rem; font-size: .95em; }
a { color: var(--accent); text-underline-offset: .2em; }
h1, h2, p, a, code, li, label { overflow-wrap: anywhere; }

.hint { font-size: .9rem; color: var(--muted); margin: .25rem 0 0; }
.error { font-size: .95rem; color: var(--danger); margin: .25rem 0 0; font-weight: 600; }
.notice { padding: .6rem .9rem; border-radius: .5rem; margin: 0 0 1rem; background: var(--notice-bg); border: 1px solid var(--notice-line); }

form { margin: 0 0 1rem; }
.field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=email] {
  font: inherit; color: inherit; padding: .5rem .75rem; border: 1px solid var(--line-strong); border-radius: .5rem; width: 100%; background: var(--card);
}
input[aria-invalid=true] { border-color: var(--danger); }
form.inline-field input[type=text] { margin-bottom: .75rem; }

button, a.btn {
  display: inline-block; font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: .5rem; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; text-align: center;
}
a.btn.ghost, button.ghost { background: transparent; color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.actions:last-child { margin-bottom: 0; }

/* signup: the admin address field, the challenge, the honeypot */
.address { display: flex; align-items: center; gap: .35rem; }
.address input { flex: 1 1 8rem; min-width: 0; }
.address span { color: var(--muted); white-space: nowrap; }
.challenge { margin-bottom: 1rem; }
.also { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* the account picker */
ul.accounts { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
ul.accounts a { display: block; padding: .75rem 1rem; border: 1px solid var(--line-strong); border-radius: .6rem; text-decoration: none; font-weight: 600; background: var(--card); }
ul.accounts a:hover { border-color: var(--accent); }
ul.accounts a span { font-weight: 400; color: var(--muted); }

/* who is signed in (#175: SsoHTML.who/2): under a page's own actions, or (.top) right under its heading */
.who { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.who.top { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--info-line); border-radius: .5rem; background: var(--info-bg); }
.who p { margin-bottom: .6rem; }
.who form { margin: 0; }

footer { font-size: .9rem; padding: .5rem 1rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 30rem) {
  body { padding: 1.25rem .75rem; }
  section { padding: 1.15rem; }
  h1 { font-size: 1.4rem; }
}
