/* Class Check-In — "Bulldog" UI. Tokens per BRAND.md; colors AA-verified there. */

@font-face {
  font-family: "Oswald";
  src: url("/vendor/fonts/oswald-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --red: #c41230;
  --red-dark: #931023;
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1c1b1a;
  --muted: #5c5854;
  --border: #e4dfd8;
  --ring: #c41230;
  --ok-text: #114d22;
  --ok-bg: #e7f6e7;
  --ok-strong: #1a7f37;
  --warn-text: #8a5a00;
  --warn-bg: #fff4e0;
  --danger-text: #8f1313;
  --danger-bg: #ffe9e9;
  --font-display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 1px 2px rgba(28, 27, 26, 0.05), 0 8px 24px rgba(147, 16, 35, 0.07);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(60rem 24rem at 50% -12rem, rgba(196, 18, 48, 0.06), transparent 70%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

/* Identity band */
.band {
  background: linear-gradient(100deg, var(--red-dark), var(--red) 55%, #d61c3c);
  color: #fff;
  padding: 1rem 1.25rem 0.9rem;
  position: relative;
  overflow: hidden;
}
.band::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -3rem;
  width: 9rem;
  height: 180%;
  background: rgba(255, 255, 255, 0.08);
  transform: skewX(-18deg);
}
.band h1 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.5rem;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.band .sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

main { max-width: 28rem; margin: 0 auto; padding: 1.25rem; width: 100%; flex: 1; }

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  color: var(--text);
}
h2 .tick { color: var(--red); }

label { display: block; font-weight: 600; margin: 0.85rem 0 0.3rem; font-size: 0.95rem; }

input, select, button {
  font-size: 1.05rem;
  font-family: inherit;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid #b9b2a8;
  background: var(--surface);
  color: var(--text);
  min-height: 48px;
}
input:focus-visible, select:focus-visible, button:focus-visible,
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

button {
  background: var(--red);
  color: #fff;
  border: none;
  margin-top: 1.1rem;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 150ms var(--ease), transform 150ms var(--ease);
}
button:hover { background: var(--red-dark); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.65; cursor: wait; transform: none; }
button.secondary {
  background: transparent;
  color: var(--red-dark);
  border: 1.5px solid var(--red);
}
button.secondary:hover { background: rgba(196, 18, 48, 0.06); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.25rem;
  margin-top: 1.1rem;
  box-shadow: var(--shadow);
}

.hint { color: var(--muted); font-size: 0.92rem; margin: 0.1rem 0 0; }

/* Registered identity chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid rgba(26, 127, 55, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

/* Big code input */
.code-input {
  letter-spacing: 0.45em;
  text-align: center;
  font-size: 1.9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-left: calc(0.8rem + 0.45em);
  border-width: 2px;
  border-color: #a99f92;
}
.code-input:focus { border-color: var(--red); }

/* Result panels */
.result {
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  margin-top: 1.1rem;
  font-size: 1.05rem;
  animation: pop-in 450ms var(--ease);
}
.result .big { font-size: 2.6rem; line-height: 1; display: block; margin-bottom: 0.4rem; }
.result strong { font-family: var(--font-display); letter-spacing: 0.02em; }
.ok {
  background: var(--ok-bg);
  border: 2px solid var(--ok-strong);
  color: var(--ok-text);
  font-size: 1.25rem;
}
.warn-amber { background: var(--warn-bg); border: 2px solid var(--warn-text); color: var(--warn-text); }
.warn-red { background: var(--danger-bg); border: 3px solid var(--danger-text); color: var(--danger-text); }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

details.tucked { margin-top: 1.1rem; }
details.tucked summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.4rem 0.2rem;
  border-radius: var(--radius-sm);
}
details.tucked summary:hover { color: var(--red-dark); }

.audit-footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
}

.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .result { animation: none; }
}
