/* Adult / Continuing Education Portal
   ---------------------------------------------------------------------------
   Palette is cool and institutional; the one accent is a deep pine used only
   for confirmation and primary action. Anything the machine produced — a
   reference number, a duration, a count, a config key, a log line — is set in
   monospace. That is the whole visual rule, and it is what ties the reference
   on an error page to the same string in the log viewer.

   No webfonts: the checkout path should not make a third-party request, and
   the container should not need the network to render.
   ------------------------------------------------------------------------- */

:root {
  --ink: #16202a;
  --slate: #5c6b7a;
  --rule: #dce2e7;
  --page: #f4f6f7;
  --surface: #ffffff;
  --accent: #0b6e5a;
  --accent-soft: #e6f0ed;
  --signal: #b4530a;
  --signal-soft: #fbefe3;
  --danger: #a02020;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --radius: 4px;
  --measure: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

/* --- Structure ---------------------------------------------------------- */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner,
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.masthead-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  flex-wrap: wrap;
}

.wordmark {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.masthead-nav {
  display: flex;
  gap: 20px;
  font-size: 0.875rem;
}

.masthead-nav a {
  color: var(--slate);
  text-decoration: none;
}

.masthead-nav a:hover,
.masthead-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

main {
  padding-block: 44px 72px;
}

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 20px 40px;
  color: var(--slate);
  font-size: 0.8125rem;
}

/* --- Type --------------------------------------------------------------- */

h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 680;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  font-weight: 650;
  margin: 0 0 4px;
}

p {
  margin: 0 0 16px;
  max-width: var(--measure);
}

.lede {
  font-size: 1.0625rem;
  color: var(--slate);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 10px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.875em;
}

/* --- Reference number: the signature element ---------------------------- */

.reference {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

/* --- Cards and panels --------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-narrow {
  max-width: 420px;
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 28px;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
}

.card p {
  margin: 0;
  color: var(--slate);
  font-size: 0.9375rem;
}

.card-soon {
  color: var(--slate);
}

/* --- Status list -------------------------------------------------------- */

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.status-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 4px 20px;
  padding: 14px 18px 14px 15px;
  border-left: 3px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row[data-state="ok"] {
  border-left-color: var(--accent);
}

.status-row[data-state="pending"] {
  border-left-color: var(--signal);
}

.status-row[data-state="error"] {
  border-left-color: var(--danger);
}

.status-row[data-state="error"] .status-value {
  color: var(--danger);
}

.status-label {
  font-size: 0.8125rem;
  color: var(--slate);
}

.status-value {
  font-weight: 600;
}

.status-detail {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--slate);
}

/* --- Forms -------------------------------------------------------------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field-hint {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--slate);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9375rem;
}

.checkbox input {
  width: auto;
  margin: 0;
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 32px;
}

.fieldset legend {
  padding: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 14px;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: #095a4a;
  border-color: #095a4a;
}

.btn-quiet {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule);
}

.btn-quiet:hover {
  background: var(--page);
  border-color: var(--slate);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Messages ----------------------------------------------------------- */

.notice {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--signal);
  background: var(--signal-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9375rem;
  margin-bottom: 20px;
}

.notice-ok {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.notice-error {
  border-left-color: var(--danger);
  background: #fbecec;
}

/* --- Log viewer --------------------------------------------------------- */

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.75rem;
  overflow-x: auto;
}

.log-row {
  display: grid;
  grid-template-columns: 160px 62px 90px 1fr;
  gap: 12px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--rule);
  min-width: 720px;
}

.log-row:last-child {
  border-bottom: 0;
}

.log-time {
  color: var(--slate);
}

.log-level {
  font-weight: 600;
}

.log-level[data-level="WARNING"] {
  color: var(--signal);
}

.log-level[data-level="ERROR"],
.log-level[data-level="CRITICAL"] {
  color: var(--danger);
}

.log-ref a {
  color: var(--accent);
  letter-spacing: 0.06em;
}

.log-detail {
  color: var(--slate);
  overflow-wrap: anywhere;
}

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-bar .field {
  margin: 0;
  min-width: 220px;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--slate);
  font-size: 0.9375rem;
}

/* --- Small screens ------------------------------------------------------ */

@media (max-width: 620px) {
  .status-row {
    grid-template-columns: 1fr;
  }

  .status-detail {
    grid-column: 1;
  }
}

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

.raw-body {
  margin-top: 10px;
}

.raw-body summary {
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--slate);
}

.raw-body pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.probe-note {
  display: inline-block;
  margin-top: 6px;
  color: var(--slate);
  font-size: 0.75rem;
}
