:root {
  --bg: #FFFAF3;
  --bg-deep: #FFF1E0;
  --surface: #FFFFFF;
  --ink: #16110D;
  --ink-soft: #6E625A;
  --ink-faint: #A89C92;
  --brand: #F26722;
  --brand-deep: #C9521A;
  --brand-soft: #FFE2CC;
  --accent: #FEE266;
  --line: #ECE2D5;
  --line-strong: #D9CCBA;
  --success: #1F8B4C;
  --success-soft: #DCEFE2;
  --error: #B65A3F;
  --error-soft: #FBEDE4;
  --error-border: #E8C4B0;
  --header-h: 60px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(22, 17, 13, 0.04), 0 8px 24px rgba(22, 17, 13, 0.06);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px rgba(242, 103, 34, 0.28);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html, body {
  height: 100%;
  overscroll-behavior-y: contain;
}
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Raleway', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ============ HEADER ============ */
.app-header {
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  padding: 0 16px;
}
.brand-mark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

/* ============ PROGRESS ============ */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--line);
  overflow: hidden;
}
.progress::after {
  content: '';
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--brand), #F58A4B);
  border-radius: 0 3px 3px 0;
  transition: width 0.45s var(--ease);
}

/* ============ STAGE / SCREENS ============ */
.stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  transform: translate3d(40px, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.36s var(--ease), opacity 0.32s var(--ease);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}
.screen.exit-left {
  transform: translate3d(-40px, 0, 0);
  opacity: 0;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 32px;
}
.page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 0 24px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.headline {
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  color: var(--ink);
}
.headline em { font-style: normal; }
.sub {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 36ch;
}

/* ============ INTRO OPTIONS (screen 0), big, tappable, calm ============ */
.intro-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}
.intro-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 32px 24px;
  background: #FFF6EC;
  border: 1.5px solid #F2DCC4;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  min-height: 168px;
  box-shadow: 0 1px 2px rgba(22, 17, 13, 0.04), 0 10px 24px rgba(217, 168, 110, 0.18);
  position: relative;
  color: var(--ink);
}
.intro-option:hover {
  border-color: var(--brand);
  background: #FFF1E3;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(22, 17, 13, 0.05), 0 14px 30px rgba(217, 168, 110, 0.26);
}
.intro-option:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(22, 17, 13, 0.05), 0 6px 14px rgba(217, 168, 110, 0.18);
}

/* Mail-in gets a slightly different warm hue so the two tiles stay distinguishable */
.intro-option[data-mode="mail-in"] {
  background: #FFF9E4;
  border-color: #EEDFAB;
  box-shadow: 0 1px 2px rgba(22, 17, 13, 0.04), 0 10px 24px rgba(212, 188, 110, 0.18);
}
.intro-option[data-mode="mail-in"]:hover {
  background: #FFF5D2;
  border-color: var(--brand);
  box-shadow: 0 2px 4px rgba(22, 17, 13, 0.05), 0 14px 30px rgba(212, 188, 110, 0.26);
}

.intro-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  color: var(--brand);
  border: 1.5px solid rgba(242, 103, 34, 0.18);
}
.intro-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.intro-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.intro-main {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.15;
  color: var(--ink);
}
.intro-sub {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
}
.intro-chevron {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
  opacity: 0.5;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.intro-option:hover .intro-chevron {
  transform: translateX(6px);
  opacity: 1;
}

@media (max-width: 380px) {
  .intro-option {
    padding: 26px 18px;
    gap: 14px;
    min-height: 148px;
  }
  .intro-icon { width: 56px; height: 56px; border-radius: 14px; }
  .intro-icon svg { width: 28px; height: 28px; }
  .intro-main { font-size: 20px; }
  .intro-sub { font-size: 13.5px; }
  .intro-chevron { font-size: 20px; bottom: 6px; right: 10px; }
}

/* ============ ADDRESS CARD (mail-in confirmation) ============ */
.address-card {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-deep) 100%);
  border: 1.5px solid var(--brand-soft);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  margin: 0 0 22px;
  box-shadow: var(--shadow-card);
}
.address-card .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.address-card .address {
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}
.address-card .hint {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: 10px;
}
.address-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.address-copy:hover { border-color: var(--brand); color: var(--brand-deep); }
.address-copy.copied { border-color: var(--success); color: var(--success); background: var(--success-soft); }

/* ============ STEPPER (large items count) ============ */
.stepper-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 20px 0 8px;
}
.stepper-display {
  font-size: clamp(72px, 22vw, 120px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  transition: transform 0.18s var(--ease);
}
.stepper-display.bump { transform: scale(1.08); }
.stepper-controls {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-card);
}
.stepper-controls button {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.08s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stepper-controls button:hover { background: var(--bg-deep); color: var(--brand-deep); }
.stepper-controls button:active { transform: scale(0.92); }
.stepper-controls button:disabled { color: var(--ink-faint); cursor: not-allowed; background: transparent; }
.stepper-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  margin: 0 6px;
}

/* ============ FIELDS ============ */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field-label .optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}
.field input,
.field textarea {
  width: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); font-weight: 500; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #FFFCF8;
  box-shadow: 0 0 0 4px rgba(242, 103, 34, 0.14);
}
.field textarea {
  resize: none;
  min-height: 140px;
  line-height: 1.55;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field.error input,
.field.error textarea {
  border-color: var(--error-border);
  background: var(--error-soft);
}
.field.error input:focus,
.field.error textarea:focus {
  border-color: var(--error);
  background: #FFFCF8;
  box-shadow: 0 0 0 4px rgba(182, 90, 63, 0.12);
}
.field.error .field-label::after {
  content: ' \2217';
  color: var(--error);
  font-weight: 800;
  letter-spacing: 0;
  margin-left: 4px;
  animation: gentleFade 0.25s var(--ease);
  display: inline-block;
}
@keyframes gentleFade {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ REQUIRED-FIELDS BANNER ============ */
.required-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--error-soft);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  padding: 12px 14px 12px 14px;
  margin: 18px 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--error);
  line-height: 1.4;
  animation: gentleFade 0.28s var(--ease);
}
.required-banner[hidden] { display: none; }
.required-banner .icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* ============ FIELD HINT ============ */
.field-hint {
  font-size: 12.5px;
  color: var(--ink-faint);
  font-style: italic;
  margin-top: 8px;
  line-height: 1.4;
}

/* ============ TEST MODE BADGE ============ */
.test-badge {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 1px solid rgba(242, 103, 34, 0.35);
  padding: 4px 8px;
  border-radius: 999px;
}

/* ============ ACTIONS ============ */
.actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}
.actions .btn-primary { flex: 1; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 20px 28px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.08s var(--ease), box-shadow 0.18s var(--ease);
  min-height: 64px;
  box-shadow: var(--shadow-btn);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:active { transform: translateY(1px) scale(0.995); }
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary .arrow {
  transition: transform 0.2s var(--ease);
  display: inline-block;
}
.btn-primary:hover .arrow { transform: translateX(3px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 20px 18px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
  min-height: 64px;
  -webkit-tap-highlight-color: transparent;
}
.btn-ghost:hover { color: var(--ink); background: var(--bg-deep); }

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ SUBMIT ERROR ============ */
.submit-error {
  display: none;
  background: var(--error-soft);
  border: 1px solid var(--error-border);
  color: var(--error);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 14px;
  line-height: 1.45;
}
.submit-error.visible { display: block; animation: gentleFade 0.25s var(--ease); }

/* ============ CONFIRMATION ============ */
.done .page-body {
  justify-content: center;
  align-items: stretch;
  text-align: left;
  gap: 4px;
}
.done .headline { text-align: left; }

.done-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  animation: pop 0.45s var(--ease);
}
.done-mark svg { width: 28px; height: 28px; }
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.claim-card {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-deep) 100%);
  border: 1.5px solid var(--brand-soft);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  margin: 22px 0 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.claim-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px dashed rgba(242, 103, 34, 0.25);
  margin: 6px;
}
.claim-card .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.claim-card .number {
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.claim-card .hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 14px;
}

.next-steps {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  margin-bottom: 16px;
}
.next-steps h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.step-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  align-items: flex-start;
}
.step-item + .step-item { border-top: 1px solid var(--line); }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-text {
  font-size: 14.5px;
  color: var(--ink);
  padding-top: 3px;
  line-height: 1.45;
}

/* ============ MICROCOPY ============ */
.kbd-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 10px;
  text-align: center;
}
.kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--ink-soft);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 380px) {
  .brand-mark { letter-spacing: 3px; font-size: 12px; }
  .page { padding: 20px 18px 24px; }
  .stepper-display { font-size: 84px; }
  .field input, .field textarea { padding: 14px 16px; font-size: 16px; }
}

@media (min-width: 768px) {
  .page { padding: 56px 32px 40px; max-width: 580px; }
  .page-body { padding: 24px 0 32px; }
  .actions { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .progress::after, .btn-primary, .btn-primary .arrow, .stepper-display, .done-mark {
    transition: none !important;
    animation: none !important;
  }
}
