/*
 * All styling for USS Phone Prompt. Loaded by base.html.
 *
 * Dark theme, built around the two colours in the United Systems logo: the green
 * (#30A824) and the blue (#006CC0). Both are lightened slightly for use as text or
 * borders, because a colour chosen to sit on white is usually too dark to read on a
 * near-black background.
 *
 * Change the custom properties in :root and the whole portal follows. Nothing below
 * hard-codes a colour.
 *
 * There is no CSS framework and no build step. The Content-Security-Policy in main.py
 * forbids inline styles, so a style="" attribute in a template is silently ignored by
 * the browser -- add a class here instead.
 *
 * Sections, in order: palette, layout and header, typography, forms and buttons,
 * notices, prompt lists and history, then the administrator console and change log.
 */

:root {
  /* Surfaces, from the page backdrop up to raised cards. */
  --bg: #14181d;
  --card: #1c2229;
  --raised: #232b34;
  --line: #2f3944;

  /* Text. --ink is deliberately off-white; pure white on near-black glares. */
  --ink: #e4e8ec;
  --muted: #97a2ad;

  /* Brand. --green and --blue are the logo colours; the -soft variants are lightened
     for text and borders, where the originals are too dark to read on this background. */
  --green: #30a824;
  --green-soft: #4cc63f;
  --green-dark: #26861d;
  --blue: #006cc0;
  --blue-soft: #4aa3e8;

  /* Notices. Backgrounds are dark tints so they sit in the page rather than glowing. */
  --ok: #4cc63f;
  --ok-bg: #17301a;
  --warn: #e0b341;
  --warn-bg: #332a12;
  --bad: #f07168;
  --bad-bg: #3a1d1b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: inherit; }
.brand img { display: block; height: 26px; width: auto; }
.brand-name {
  font-weight: 600;
  letter-spacing: 0.01em;
  padding-left: 0.85rem;
  border-left: 1px solid var(--line);
}
.who { color: var(--muted); font-size: 0.9rem; }

.container { max-width: 46rem; margin: 0 auto; padding: 1.5rem; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2rem 1rem 3rem; }

h1 { font-size: 1.6rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.lede { color: var(--muted); margin: 0 0 1.25rem; }
.meta { color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 0; }
.crumb { margin: 0 0 0.75rem; }
.crumb a { color: var(--blue-soft); }
.brand:hover .brand-name { color: var(--green-soft); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.card-narrow { max-width: 26rem; margin: 3rem auto; text-align: center; }

/* The wordmark on the sign-in page. Capped by height so the aspect ratio is never
   distorted, whatever the source image dimensions happen to be. */
.hero { display: block; margin: 0 auto 1.5rem; max-width: 100%; height: auto; }

label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; text-align: left; }
input, textarea, select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: inherit;
  font: inherit;
}
textarea { resize: vertical; }
/* Lightened until it clears WCAG AA body contrast against --raised; the
   obvious grey for a placeholder sits at about 3.2 and is too dim. */
input::placeholder, textarea::placeholder { color: #8b96a1; }
input:focus, textarea:focus, select:focus, .btn:focus-visible {
  outline: 2px solid var(--green-soft);
  outline-offset: 1px;
  border-color: var(--green-soft);
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); background: #29323c; }
.btn-primary { background: var(--green); border-color: var(--green); color: #08120a; font-weight: 600; }
.btn-primary:hover { background: var(--green-soft); border-color: var(--green-soft); }
.btn-quiet { margin-top: 0; padding: 0.35rem 0.75rem; font-size: 0.9rem; }

.notice { padding: 0.7rem 0.9rem; border-radius: 8px; margin: 0 0 1.25rem; border: 1px solid transparent; }
.notice-ok { background: var(--ok-bg); border-color: #2a5c2f; color: var(--ok); }
.notice-warn { background: var(--warn-bg); border-color: #5c4a1d; color: var(--warn); }
.notice-bad { background: var(--bad-bg); border-color: #6b322d; color: var(--bad); }

.slot-list, .history { list-style: none; padding: 0; margin: 0; }
.slot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.slot h2 { margin: 0; }
.slot h2 a { color: inherit; text-decoration: none; }
.slot h2 a:hover { color: var(--green-soft); }
.slot .btn { margin-top: 0; flex: none; }
.current { margin: 0.35rem 0 0; }

.history li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.history li:first-child { border-top: 0; }
.history p { margin: 0; }
.row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.row-actions .btn { margin-top: 0; }

.status {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 0.3rem !important;
  color: var(--muted);
}
.status-published { color: var(--green-soft); }
.status-draft { color: var(--blue-soft); }

blockquote {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--green);
  color: var(--muted);
  background: var(--raised);
  border-radius: 0 8px 8px 0;
}

/* The browser's default audio player is light and looks wrong here. Dimming it slightly
   is the only control available without replacing the player wholesale. */
audio { width: 100%; max-width: 22rem; margin-top: 0.5rem; filter: invert(0.9) hue-rotate(180deg); }

/* ---- navigation and administrator console ---- */
.site-nav { display: flex; align-items: center; gap: 1rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.site-nav a:hover { color: var(--green-soft); }
.site-nav form { display: flex; align-items: center; gap: 0.75rem; margin: 0; }

.acting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.5rem;
  background: var(--warn-bg);
  color: var(--warn);
  border-bottom: 1px solid #5c4a1d;
  font-size: 0.9rem;
}
.acting form { margin: 0; }
.acting strong { color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 1rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; margin-top: 1rem; }
.check input { width: auto; }
code { background: var(--bg); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85em; color: var(--blue-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; }
.filters > div { flex: 1 1 9rem; }
.filters label { margin-top: 0; }
.filter-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }
.filter-actions .btn { margin-top: 0; }

.log { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.log th, .log td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.log th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.log .nowrap { white-space: nowrap; }
.log .wording { max-width: 24rem; }
.log .row-failed { background: var(--bad-bg); }
.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

@media (max-width: 34rem) {
  .slot, .history li { flex-direction: column; align-items: flex-start; }
  .row-actions { align-items: flex-start; }
  .brand-name { display: none; }
}
