/* strgtools.com. Tokens mirror strg-sso's BRAND_CSS, which styles
   auth.southtexasradiologygroup.com, by way of the schedule app's strg.css.
   Keep them in step. Square corners everywhere: the brand has no rounded
   corners -- card, button and input are all square on the login page. */
:root {
  --navy-900: #0b1f3a;
  --navy-700: #14355e;
  --navy-600: #1b3854;
  --navy-500: #24476a;
  --navy-400: #2f5c88;
  --ink: #20344c;
  --ink-soft: #46586e;
  --ink-mute: #5a6b80;
  --on-navy: #eef1f5;
  --footer: #8a94a6;
  --hairline: #e4e7ec;
  --surface: #ffffff;
  --wash: #f6f8fa;
  --info: #24476a;
  --warning: #b06f00;
  --critical: #c9190b;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--navy-900);
  background-image: radial-gradient(
    ellipse 90% 70% at 50% 30%, var(--navy-700) 0%, var(--navy-900) 65%
  );
  background-attachment: fixed;
}

/* ── Header ─────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
}
.masthead__logo { display: block; width: 208px; height: auto; }
.masthead__nav { display: flex; gap: 22px; margin-left: auto; }
.masthead__nav a,
.masthead__session a,
.masthead__session button {
  color: var(--on-navy);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
}
.masthead__nav a:hover,
.masthead__nav a:focus-visible,
.masthead__session button:hover { border-bottom-color: var(--footer); }
.masthead__nav a[aria-current="page"] { border-bottom-color: var(--on-navy); }
.masthead__session {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: var(--footer);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.masthead__session form { margin: 0; }

/* ── Layout ─────────────────────────────────────────────────────── */
.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px 48px; }
.shell--narrow { max-width: 520px; }
.card {
  background: var(--surface);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card + .card { margin-top: 24px; }

h1, h2 {
  margin: 0;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.lede { margin: 0; color: var(--ink-soft); }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── Controls ───────────────────────────────────────────────────── */
.button {
  display: inline-block;
  border: 0;
  border-radius: 0;
  padding: 14px 30px;
  background: var(--navy-500);
  color: var(--surface);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
/* `color` is repeated on every state, and that is not redundancy. The generic
   `a:hover` rule further down is (0,1,1) and outranks `.button`'s (0,1,0), so
   an <a class="button"> -- which is what Sign in is -- took navy-400 text on a
   navy-400 hover background and the label vanished on mouseover. Same colour,
   not a fade. Stating the colour per state is what keeps the anchor rule from
   winning. */
.button:hover, .button:focus-visible {
  background: var(--navy-400);
  color: var(--surface);
}
.button:active { background: var(--navy-600); color: var(--surface); }
.button--quiet {
  background: transparent;
  color: var(--navy-500);
  border: 1px solid var(--hairline);
  padding: 8px 16px;
  font-weight: 500;
}
.button--quiet:hover { background: var(--hairline); color: var(--navy-500); }
.button--danger { background: var(--critical); }
.button--danger:hover { background: #a5150a; }

input[type="text"], input[type="url"], input[type="number"],
input[type="datetime-local"], select, textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink-mute);
  border-radius: 0;
  padding: 8px 2px;
  font: inherit;
  color: var(--ink);
  background: transparent;
}
textarea { min-height: 6rem; resize: vertical; }
:focus-visible { outline: 2px solid var(--navy-400); outline-offset: 2px; }
a { color: var(--navy-500); }
a:hover { color: var(--navy-400); }

/* ── Tiles ──────────────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--hairline);
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}
.tile:hover { border-color: var(--navy-400); background: var(--wash); }
.tile__name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tile__blurb { color: var(--ink-soft); font-size: 0.9rem; }
.tile__host {
  margin-top: auto;
  color: var(--ink-mute);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.tile--soon { opacity: 0.55; cursor: default; pointer-events: none; }
.tile__flag {
  align-self: flex-start;
  padding: 2px 8px;
  background: var(--hairline);
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Notices ────────────────────────────────────────────────────── */
.notices { display: flex; flex-direction: column; gap: 16px; }
.notice {
  padding: 14px 20px;
  border-left: 3px solid var(--info);
  background: var(--wash);
}
.notice--warning { border-left-color: var(--warning); }
.notice--critical { border-left-color: var(--critical); }
.notice__title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* pre-wrap, not a markdown renderer: message bodies are plain text on
   purpose, so line breaks survive without an HTML injection surface. */
.notice__body { margin: 6px 0 0; white-space: pre-wrap; }
.notice__meta { margin: 8px 0 0; color: var(--ink-mute); font-size: 0.8rem; }

.is-empty { color: var(--ink-mute); }
.error { padding: 16px 20px; border-left: 3px solid var(--critical); background: var(--wash); }

/* Read by screen readers, never painted. `display: none` would remove it from
   the accessibility tree too, which is the opposite of the point. Used to say
   "opens in a new tab" on the application tiles, since target="_blank" is a
   visual convention that announces itself to nobody. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The admin screens' 4xx region (templates/admin/base.html). It sits above the
   first card and is empty until htmx swaps a message into it, so the gap has
   to appear with the message -- otherwise the error bar renders flush against
   the card below it. :empty is exact here: the server renders the div with no
   child nodes at all. */
#admin-error:not(:empty) { margin-bottom: 24px; }

/* ── Tables (admin) ─────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
th {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:hover { background: var(--wash); }
.rowhead { font-weight: 600; white-space: nowrap; }
.rowactions { display: flex; gap: 8px; white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.fieldrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ── Footer ─────────────────────────────────────────────────────── */
.sitefoot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  color: var(--footer);
  font-size: 0.78rem;
}
.sitefoot a { color: var(--footer); }
.sitefoot__org { margin: 0; }

/* HTMX shows this while a request is in flight. Defined here rather than
   injected: the CSP is style-src 'self'. */
.indicator { opacity: 0; transition: opacity 0.15s; }
.htmx-request .indicator { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
