/* Field Orders — manila form-document aesthetic.
 * Palette: desk olive, manila paper, olive-black ink, stamp red.
 */
:root {
  --desk: #383c2e;
  --paper: #e6dfc8;
  --paper-dark: #d9d0b2;
  --ink: #26261c;
  --ink-soft: #55523f;
  --olive: #4c5440;
  --stamp: #9e3b2c;
  --line: #a89e7c;
  --focus: #1f4d8f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--desk);
  /* subtle desk texture via layered gradients */
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.04), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(0, 0, 0, 0.25), transparent 55%);
  color: var(--ink);
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  padding: clamp(12px, 4vw, 48px) 12px;
}

.display {
  font-family: "Saira Stencil One", "Impact", "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--olive);
}

/* ---------- the sheet ---------- */

.sheet {
  background: var(--paper);
  background-image: linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  background-size: 100% 2.1em;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.3);
  animation: sheet-in 0.45s ease-out both;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.fine { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- cover ---------- */

.cover { text-align: left; }

.cover-band {
  border: 2px solid var(--ink);
  border-bottom-width: 6px;
  padding: clamp(20px, 5vw, 36px);
  margin-bottom: 28px;
}

.cover h1 {
  font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: 0.95;
  color: var(--ink);
}

.cover-sub {
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--olive);
}

.cover-body p { margin-bottom: 16px; max-width: 52ch; }

/* ---------- form head / progress ---------- */

.form-head { margin-bottom: 26px; }

.item-count {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.progress {
  height: 8px;
  border: 1px solid var(--ink);
  background: var(--paper-dark);
}

.progress-fill {
  height: 100%;
  background: var(--olive);
  transition: width 0.3s ease;
}

/* ---------- question & options ---------- */

.question { font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.1; }

.question-sub { margin: 8px 0 22px; color: var(--ink-soft); }

.options { display: grid; gap: 10px; margin-bottom: 22px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1.5px solid var(--ink);
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.option:hover { background: var(--paper-dark); }

.option-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid var(--ink);
  position: relative;
}

.option-label { display: block; font-weight: 700; }

.option-note { display: block; font-size: 0.8rem; color: var(--ink-soft); }

/* stamped check — the signature interaction */
.option.selected .option-box::after,
.option.stamped .option-box::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--stamp);
  transform: rotate(-6deg);
}

.option.stamped {
  border-color: var(--stamp);
  color: var(--stamp);
}

.option.stamped .option-box::after { animation: stamp-in 0.28s cubic-bezier(0.2, 1.6, 0.4, 1) both; }

.option.selected { border-width: 2.5px; padding: 12px 15px; }

@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-30deg) scale(2.4); }
  to   { opacity: 1; transform: rotate(-6deg) scale(1); }
}

/* ---------- buttons ---------- */

.btn-primary {
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--olive);
  color: var(--paper);
  border: 2px solid var(--ink);
  padding: 14px 26px;
  cursor: pointer;
  width: 100%;
  transition: filter 0.15s ease;
}

.btn-primary:hover { filter: brightness(1.12); }

.btn-ghost {
  font: inherit;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  padding: 12px 4px 0;
}

.btn-ghost.danger { color: var(--stamp); }

/* ---------- grade interstitial ---------- */

.grade { text-align: center; padding-top: 56px; padding-bottom: 56px; }

.grade-lead { margin: 18px 0 26px; }

.grade-brief { max-width: 46ch; margin: 26px auto 30px; color: var(--ink-soft); }

.stamp {
  display: inline-block;
  font-family: "Saira Stencil One", "Impact", sans-serif;
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  color: var(--stamp);
  border: 4px double var(--stamp);
  padding: 6px 26px;
  transform: rotate(-5deg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 88%, transparent 100%);
          mask-image: radial-gradient(circle at 50% 50%, black 88%, transparent 100%);
}

.stamp-in { animation: stamp-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both; }

.stamp.small { font-size: 1.3rem; padding: 2px 14px; border-width: 3px; }

/* ---------- processing ---------- */

.processing { min-height: 320px; }

.processing h2 { font-size: clamp(1.8rem, 6vw, 2.4rem); margin-bottom: 24px; }

.ticker { list-style: none; }

.ticker li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  animation: line-in 0.3s ease-out both;
}

.ticker li::before { content: "▸ "; color: var(--olive); }

@keyframes line-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- orders (plan) ---------- */

.orders-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.orders-head h2 { font-size: clamp(1.7rem, 6vw, 2.4rem); color: var(--ink); }

.orders-meta { font-size: 0.85rem; color: var(--ink-soft); }

.orders-style {
  border-left: 4px solid var(--olive);
  padding: 6px 12px;
  margin: 14px 0 22px;
  font-style: italic;
  color: var(--ink-soft);
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 12px;
}

.tab {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--paper-dark);
  border: 1.5px solid var(--ink);
  border-bottom: none;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--ink-soft);
}

.tab.active { background: var(--olive); color: var(--paper); }

.week-note { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 22px; }

.day {
  border: 1.5px solid var(--ink);
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.25);
}

.day.done { opacity: 0.55; }

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--paper-dark);
  border-bottom: 1.5px solid var(--ink);
  padding: 10px 14px;
}

.day-head h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }

.day-num {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  padding: 2px 8px;
  margin-right: 6px;
  vertical-align: 2px;
}

.day-check {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.day-check input { width: 16px; height: 16px; accent-color: var(--stamp); cursor: pointer; }

.work { width: 100%; border-collapse: collapse; }

.work th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  padding: 8px 14px 4px;
  border-bottom: 1px solid var(--line);
}

.work td {
  padding: 8px 14px;
  border-bottom: 1px dashed var(--line);
  vertical-align: top;
}

.work tr:last-child td { border-bottom: none; }

.work .num { text-align: right; white-space: nowrap; }

.work .rest { color: var(--ink-soft); font-size: 0.88rem; }

.ex-name details summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.ex-name details summary::after { content: " +"; color: var(--olive); }

.ex-name details[open] summary::after { content: " –"; }

.ex-name details p {
  font-size: 0.84rem;
  color: var(--ink-soft);
  padding-top: 4px;
  max-width: 44ch;
}

.finisher {
  font-size: 0.88rem;
  padding: 10px 14px;
  border-top: 1.5px solid var(--ink);
  background: var(--paper-dark);
}

.block {
  border: 1.5px solid var(--line);
  padding: 10px 14px;
  margin-bottom: 12px;
}

.block summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; }

.block ul { padding: 8px 0 4px 22px; font-size: 0.88rem; }

.orders-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  border-top: 2px solid var(--ink);
}

/* ---------- a11y & motion ---------- */

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

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

/* ---------- print ---------- */

@media print {
  body { background: none; padding: 0; }
  .sheet { box-shadow: none; border: none; max-width: none; animation: none; }
  .tabs, .orders-foot, .day-check, .btn-primary, .btn-ghost { display: none !important; }
  .block, .ex-name details p { display: block; }
  .day { break-inside: avoid; }
}
