/* ==========================================================================
   CaseReview — "Case File Intake" visual identity

   Signature concept: the site reads as an actual case-intake ticket, not a
   generic marketing form. Legal-pad paper (yellow, ruled, red margin line),
   a typed file number in a typewriter face, a perforated step tracker, and
   a rubber-stamp treatment for the primary action and the final result.

   Type roles:
     - Zilla Slab      → headlines (the "case file" authority voice)
     - Courier Prime    → file numbers, step labels, meta (the "typed" voice)
     - IBM Plex Sans    → body copy, inputs, buttons (the working voice)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Zilla+Slab:wght@500;700&family=Courier+Prime:wght@400;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --pad-yellow: #f7efc3;
  --pad-yellow-deep: #ecdf9c;
  --paper-white: #fffdf3;
  --rule-blue: #a9c2dd;
  --margin-red: #b23a32;
  --margin-red-dark: #8f2c26;
  --ink-navy: #1b2740;
  --ink-muted: #5a6a85;
  --border-soft: rgba(27, 39, 64, 0.14);
  --shadow-stack: 0 1px 0 #fff, 0 10px 24px rgba(27, 39, 64, 0.16);
  --radius: 3px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink-navy);
  line-height: 1.55;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(169, 194, 221, 0.35) 32px
    ),
    var(--pad-yellow);
  background-attachment: fixed;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* ---------- header: navy strip + typed file number ---------- */

.site-header {
  background: var(--ink-navy);
  color: var(--pad-yellow);
  padding: 16px 0 22px;
  position: relative;
}
.site-header .wrap { display: flex; justify-content: space-between; align-items: baseline; }
.logo {
  font-family: 'Zilla Slab', serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
}
.logo strong { color: #f0c94a; }
.file-number {
  font-family: 'Courier Prime', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  opacity: 0.85;
  text-align: right;
}
.file-number .fn-label { display: block; font-size: 0.65rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.12em; }

/* torn-paper perforation between header and body */
.perforation {
  height: 14px;
  background: var(--ink-navy);
  -webkit-mask-image: radial-gradient(circle at 10px 0, transparent 6px, black 6.5px);
  mask-image: radial-gradient(circle at 10px 0, transparent 6px, black 6.5px);
  -webkit-mask-size: 20px 14px;
  mask-size: 20px 14px;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}

/* ---------- ticket-stub step tracker ---------- */

.wizard-shell { padding: 34px 0 60px; }

.ticket-tracker {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
  padding: 0 2px;
}
.ticket-stub {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ink-navy);
  background: var(--paper-white);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Courier Prime', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-navy);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ticket-stub.done { background: var(--ink-navy); color: var(--pad-yellow); }
.ticket-stub.current { border-color: var(--margin-red); color: var(--margin-red); background: var(--paper-white); box-shadow: 0 0 0 3px rgba(178, 58, 50, 0.15); }
.ticket-perf {
  flex: 1;
  height: 0;
  border-top: 2px dashed var(--border-soft);
  margin: 0 4px;
}
.ticket-perf.done { border-top-color: var(--ink-navy); }

.progress-label {
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 20px;
}

/* ---------- the "legal pad page" card ---------- */

.step {
  display: none;
  position: relative;
  background: var(--paper-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-stack);
  padding: 30px 26px 26px 40px;
  border-left: 3px solid var(--margin-red);
  animation: pageIn 0.28s ease;
}
.step.active { display: block; }

/* stacked-papers illusion behind the active card */
.step::before, .step::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px;
  height: 100%;
  background: var(--paper-white);
  border-radius: var(--radius);
  z-index: -1;
  box-shadow: 0 1px 0 rgba(27,39,64,0.08);
}
.step::before { top: 6px; opacity: 0.7; }
.step::after { top: 11px; opacity: 0.4; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px) rotate(-0.4deg); }
  to { opacity: 1; transform: translateY(0) rotate(-0.3deg); }
}
.step { transform: rotate(-0.3deg); }
.step .field, .step h1, .step .sub, .step .step-actions, .step .consent-block, .step .optional-block {
  transform: rotate(0.3deg); /* counter-rotate content so text stays level; only the card edge looks papery */
}

h1 {
  font-family: 'Zilla Slab', serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: var(--ink-navy);
}
.sub { color: var(--ink-muted); margin: 0 0 20px; font-size: 0.95rem; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--ink-navy);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"], input[type="date"], select {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--border-soft);
  border-radius: 2px;
  font-size: 1rem;
  font-family: 'IBM Plex Sans', sans-serif;
  background: #fff;
  color: var(--ink-navy);
}
input::placeholder { color: #9aa5b8; }
input:focus, select:focus, button:focus-visible {
  outline: 3px solid #f0c94a;
  outline-offset: 1px;
  border-color: var(--ink-navy);
}

.locked-label {
  font-family: 'Courier Prime', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 13px;
  background: var(--pad-yellow-deep);
  border: 1.5px dashed var(--margin-red);
  border-radius: 2px;
  margin: 0;
}

.field-error {
  color: var(--margin-red);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 6px 0 0;
}
input.invalid, select.invalid {
  border-color: var(--margin-red);
  background: #fdf4f3;
}
input.invalid:focus, select.invalid:focus {
  outline-color: var(--margin-red);
}

/* ---------- rubber-stamp buttons ---------- */

.btn-primary, .btn-secondary {
  font-family: 'Courier Prime', monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 15px 20px;
  border-radius: 2px;
  cursor: pointer;
  width: 100%;
}
.btn-primary {
  background: var(--margin-red);
  color: var(--paper-white);
  border: 2px solid var(--margin-red-dark);
  box-shadow: 0 3px 0 var(--margin-red-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}
.btn-primary:hover { background: var(--margin-red-dark); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--margin-red-dark); }
.btn-primary:disabled { background: #b8a98a; border-color: #a89878; box-shadow: none; cursor: not-allowed; }

.step-actions { display: flex; gap: 12px; margin-top: 6px; }
.btn-secondary {
  background: transparent;
  color: var(--ink-muted);
  border: 1.5px solid var(--border-soft);
  flex: 0 0 110px;
  box-shadow: none;
}
.btn-secondary:hover { border-color: var(--ink-navy); color: var(--ink-navy); }
.step-actions .btn-primary { flex: 1; }

.optional-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-soft);
}

/* ---------- consent block ---------- */

.consent-block { margin: 18px 0 22px; }
.checkbox-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.76rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.checkbox-label input { margin-top: 3px; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--margin-red); }
.checkbox-label a { color: var(--margin-red); }

/* ---------- result screen: the rubber stamp moment ---------- */

#resultContent { text-align: center; padding: 10px 0 4px; }

.spinner {
  width: 34px; height: 34px;
  border: 4px solid var(--border-soft);
  border-top-color: var(--margin-red);
  border-radius: 50%;
  margin: 6px auto 22px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#resultMessage { font-size: 1.05rem; margin-top: 4px; }

.stamp {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 4px double var(--margin-red);
  color: var(--margin-red);
  border-radius: 8px;
  transform: rotate(-6deg) scale(1);
  margin-bottom: 18px;
  animation: stampIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stamp.muted { color: var(--ink-navy); border-color: var(--ink-navy); }

@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-6deg) scale(1.6); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: rotate(-6deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
  .step { animation: none; }
}

.error-banner {
  background: #fdecec;
  color: #8f2c26;
  border: 1px solid #e3a5a0;
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ---------- footer ---------- */

.site-footer {
  color: var(--ink-muted);
  font-size: 0.76rem;
  padding: 24px 0 40px;
  text-align: center;
  font-family: 'IBM Plex Sans', sans-serif;
}
.footer-copy { margin: 0 0 10px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 20px;
}
.footer-links a { white-space: nowrap; }
.site-footer a { color: var(--ink-muted); text-decoration: underline; }

@media (max-width: 480px) {
  .field-row { flex-direction: column; gap: 0; }
  .step { padding: 24px 18px 22px 30px; }
  h1 { font-size: 1.3rem; }
}

/* ==========================================================================
   Marketing homepage — same case-file identity, different layout needs
   (not a step wizard, so no ticket tracker / stamp / choice-toggle styles
   apply here; this section is additive to everything above).
   ========================================================================== */

.header-cta {
  font-family: 'Courier Prime', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pad-yellow);
  border: 1.5px solid var(--pad-yellow);
  padding: 8px 14px;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
}
.header-cta:hover { background: var(--pad-yellow); color: var(--ink-navy); }

.marketing-shell .wrap { max-width: 900px; }

/* Rubber-stamp CTA button, but sized for marketing use (inline, not full-width) */
.btn-cta {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 2px;
  background: var(--margin-red);
  color: var(--paper-white);
  border: 2px solid var(--margin-red-dark);
  box-shadow: 0 3px 0 var(--margin-red-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}
.btn-cta:hover { background: var(--margin-red-dark); }
.btn-cta:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--margin-red-dark); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 48px; text-align: center; }
.hero h1 {
  font-family: 'Zilla Slab', serif;
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1.25;
  color: var(--ink-navy);
  margin: 0 0 18px;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-muted);
  max-width: 620px;
  margin: 0 auto 30px;
}
.hero-ctas { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-secondary-link {
  font-size: 0.9rem;
  color: var(--ink-navy);
  text-decoration: underline;
}

/* ---------- how it works ---------- */
.how-it-works { padding: 40px 0; }
.how-it-works h2, .categories h2, .about h2, .final-cta h2 {
  font-family: 'Zilla Slab', serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ink-navy);
  text-align: center;
  margin: 0 0 28px;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step-card {
  background: var(--paper-white);
  border-left: 3px solid var(--margin-red);
  border-radius: 3px;
  box-shadow: var(--shadow-stack);
  padding: 22px 20px;
}
.step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink-navy);
  color: var(--pad-yellow);
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.step-card h3 { font-size: 1.05rem; margin: 0 0 8px; color: var(--ink-navy); }
.step-card p { font-size: 0.9rem; color: var(--ink-muted); margin: 0; }

/* ---------- categories ---------- */
.categories { padding: 40px 0; }
.categories .sub { text-align: center; margin-bottom: 24px; }
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.category-pill {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-navy);
  background: var(--pad-yellow-deep);
  border: 1.5px solid transparent;
  padding: 10px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.category-pill:hover { border-color: var(--margin-red); }
.category-pill-more {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--ink-muted);
}

/* ---------- trust band ---------- */
.trust-band {
  background: var(--ink-navy);
  padding: 28px 0;
  margin: 40px 0;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.trust-item {
  color: var(--pad-yellow);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
.trust-mark { color: #6fd18f; margin-right: 4px; }

/* ---------- about ---------- */
.about { padding: 20px 0 40px; }
.about p { color: var(--ink-muted); font-size: 0.95rem; text-align: center; max-width: 680px; margin: 0 auto; }
.about a { color: var(--margin-red); }

/* ---------- final CTA ---------- */
.final-cta { text-align: center; padding: 20px 0 60px; }

@media (max-width: 720px) {
  .steps-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.6rem; }
  .header-cta { font-size: 0.68rem; padding: 6px 10px; }
}
