/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --color-black: #000000;
  --color-tan: #86745c;
  --color-light-tan: #c2baab;
  --color-dark-tan: #6a5c48;
  --color-white: #ffffff;
  --color-black-63: rgba(0, 0, 0, 0.63);
  --color-black-80: rgba(0, 0, 0, 0.8);
  --color-black-88: rgba(0, 0, 0, 0.88);
  --color-gold: #b19977;
  --color-accent: #b19977;
  --color-accent-light: #c2baab;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", Arial, sans-serif;

  --paper: #fbf9f6;
  --radius-s: 4px;
  --radius-m: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-black-88);
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--color-dark-tan) 0%, transparent 60%),
    linear-gradient(160deg, var(--color-black) 0%, #1c1712 38%, var(--color-dark-tan) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.binder {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-height: 100vh;
  padding: 48px 24px;
}

/* ---------------- Tab rail (desktop) ---------------- */
.tab-rail {
  position: relative;
  width: 216px;
  flex-shrink: 0;
  padding-top: 64px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tab-rail-line {
  display: none;
}

.tab {
  position: relative;
  font-family: var(--font-display);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  font-weight: 500;
  color: var(--color-light-tan);
  background: rgba(0, 0, 0, 0.18);
  padding: 13px 18px;
  border-radius: var(--radius-s) 0 0 var(--radius-s);
  margin-right: -1px;
  transition: background 0.35s ease, color 0.35s ease, transform 0.35s ease, padding 0.35s ease;
  cursor: default;
  border: 1px solid rgba(255,255,255,0.06);
  border-right: none;
}

.tab span { display: block; }

.tab.is-done {
  background: rgba(194, 186, 171, 0.16);
  color: var(--color-light-tan);
}

.tab.is-active {
  background: var(--paper);
  color: var(--color-dark-tan);
  font-weight: 600;
  padding-right: 26px;
  transform: translateX(0);
  box-shadow: -6px 6px 18px rgba(0,0,0,0.28);
}

.tab.is-active::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--color-gold);
}

/* ---------------- Mobile progress ---------------- */
.mobile-progress {
  display: none;
}

/* ---------------- Page frame (the "paper") ---------------- */
.page-frame {
  background: var(--paper);
  width: 100%;
  max-width: 720px;
  min-height: 640px;
  border-radius: var(--radius-m);
  box-shadow: 0 30px 60px rgba(0,0,0,0.45), 0 2px 0 rgba(255,255,255,0.4) inset;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.page-inner {
  padding: 44px 52px 34px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  border-bottom: 1px solid var(--color-light-tan);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-tan);
  margin: 0 0 6px;
}

.masthead h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--color-black-88);
}

.masthead-meta {
  font-size: 13.5px;
  color: var(--color-tan);
  display: flex;
  gap: 10px;
  align-items: center;
}

.masthead-meta strong {
  color: var(--color-dark-tan);
  font-weight: 600;
  margin-right: 4px;
}

.masthead-meta .dot { color: var(--color-light-tan); }

/* ============================================================
   STAGE / SLIDES
   ============================================================ */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.slide {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: rise 0.4s ease;
}

.slide.is-active { display: flex; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-kicker {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0;
}

.slide-prompt {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 23px;
  line-height: 1.35;
  color: var(--color-black-88);
  margin: 0;
}

.slide-hint {
  font-size: 13px;
  color: var(--color-black-63);
  margin: -10px 0 0;
}

/* Inputs */
input[type="text"],
input[type="date"],
textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-black-88);
  background: var(--color-white);
  border: 1.5px solid var(--color-light-tan);
  border-radius: var(--radius-s);
  padding: 13px 15px;
  width: 100%;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea { min-height: 130px; line-height: 1.5; }

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(177, 153, 119, 0.22);
}

label.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-dark-tan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  display: block;
}

.field-group { display: flex; flex-direction: column; gap: 6px; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Checkboxes */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background 0.2s ease;
}

.check-item:hover { background: rgba(194, 186, 171, 0.18); }

.check-item input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--color-gold);
  flex-shrink: 0;
}

.check-item span { font-size: 15px; color: var(--color-black-88); }

.other-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 12px 8px 12px;
}
.other-row span { font-size: 15px; color: var(--color-black-88); white-space: nowrap; }

/* Multiline (norms) blanks */
.blank-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.blank-index {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-gold);
  font-size: 18px;
  width: 22px;
  flex-shrink: 0;
  text-align: center;
}

/* Intro / Review specific */
.intro-copy, .review-copy {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-black-80);
  margin: 0;
}

.review-list {
  border-top: 1px solid var(--color-light-tan);
  margin-top: 4px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 6px;
}

.review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-light-tan);
}

.review-item .rq {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-dark-tan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}

.review-item .ra {
  font-size: 14.5px;
  color: var(--color-black-88);
  margin: 0;
  white-space: pre-wrap;
}

.review-item .ra.empty {
  color: var(--color-black-63);
  font-style: italic;
}

.download-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.download-status {
  font-size: 13px;
  color: var(--color-tan);
}

/* ============================================================
   FOOTER CONTROLS
   ============================================================ */
.page-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  margin-top: auto;
  border-top: 1px solid var(--color-light-tan);
}

.page-tally {
  font-size: 12.5px;
  color: var(--color-tan);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.btn {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-gold);
  color: var(--color-white);
  box-shadow: 0 8px 18px rgba(177, 153, 119, 0.4);
}
.btn-primary:hover { background: var(--color-dark-tan); }
.btn-primary:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--color-tan);
  border: 1.5px solid var(--color-light-tan);
}
.btn-ghost:hover { border-color: var(--color-tan); color: var(--color-dark-tan); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-download {
  background: var(--color-black);
  color: var(--color-white);
}
.btn-download:hover { background: #262019; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .tab-rail { display: none; }

  .mobile-progress {
    display: block;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 14px;
  }

  .mobile-progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--color-light-tan);
    margin-bottom: 8px;
    padding: 0 4px;
  }

  #mobile-count { color: rgba(255,255,255,0.55); font-family: var(--font-body); }

  .mobile-progress-track {
    height: 5px;
    background: rgba(255,255,255,0.14);
    border-radius: 4px;
    overflow: hidden;
  }

  .mobile-progress-fill {
    height: 100%;
    background: var(--color-gold);
    width: 0%;
    transition: width 0.4s ease;
  }

  .binder {
    flex-direction: column;
    padding: 20px 14px 40px;
  }
}

@media (max-width: 560px) {
  .page-inner { padding: 30px 22px 24px; }
  .masthead h1 { font-size: 24px; }
  .slide-prompt { font-size: 19px; }
  .two-up { grid-template-columns: 1fr; }
  .page-frame { min-height: 560px; }
}
