/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --ink:        #2C241C;
  --ink-soft:   #6B5E4F;
  --cream:      #F7F0E3;
  --cream-2:    #EFE4CE;
  --paper:      #FFFCF6;
  --wine:       #6E2B39;
  --wine-dark:  #531F2A;
  --ochre:      #C7963C;
  --ochre-soft: #E7CE99;
  --sage:       #5C6B4F;
  --line:       #DCCEAF;
  --danger:     #A63A2B;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow-card: 0 30px 60px -30px rgba(44,36,28,0.35), 0 2px 8px rgba(44,36,28,0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 15% 8%, rgba(199,150,60,0.14), transparent 45%),
    radial-gradient(circle at 85% 92%, rgba(110,43,57,0.10), transparent 50%);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.5;
}

.paper-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(44,36,28,0.015) 0px, rgba(44,36,28,0.015) 1px, transparent 1px, transparent 3px);
  z-index: 0;
}

:focus-visible {
  outline: 2.5px solid var(--wine);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ============================================================
   LAYOUT / WIZARD
   ============================================================ */
.wizard {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 48px) clamp(16px, 5vw, 24px) 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   BRAND / LOGO
   ============================================================ */
.site-header {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.site-logo {
  height: 80px;
  width: 80px;
  object-fit: cover;
  background: var(--paper);
  box-shadow: 0 6px 16px -8px rgba(44,36,28,0.3);
}

.welcome-logo {
  display: block;
  height: 72px;
  width: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--ochre-soft);
  box-shadow: 0 10px 22px -10px rgba(44,36,28,0.4);
  margin-bottom: 18px;
}

.step { display: none; }
.step.is-active {
  display: block;
  animation: stepIn 0.5s var(--ease);
}

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

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 6vw, 44px) clamp(20px, 6vw, 40px) clamp(28px, 5vw, 40px);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(110,43,57,0.14);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

/* ============================================================
   PROGRESS RAIL
   ============================================================ */
.progress-rail {
  max-width: 640px;
  margin: 0 auto 18px;
  padding: 0 2px;
}
.progress-track {
  height: 6px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--ochre), var(--wine));
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}
.progress-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 10px;
  font-weight: 500;
}

.headline {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(34px, 8vw, 46px);
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--wine-dark);
}

.step-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 5.5vw, 30px);
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--wine-dark);
}

.lede {
  font-size: 16.5px;
  color: var(--ink);
  margin: 0 0 8px;
  max-width: 46ch;
}
.lede-soft { color: var(--ink-soft); }

.step-sub {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 26px;
  max-width: 48ch;
}
/* ============================================================
   DIVIDER — perforated ticket edge
   ============================================================ */
.divider-perforated {
  height: 1px;
  margin: 24px 0;
  background-image: linear-gradient(90deg, var(--line) 60%, transparent 0%);
  background-size: 12px 1px;
  background-repeat: repeat-x;
}

/* ============================================================
   LEGAL NOTE
   ============================================================ */
.legal-note {
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ochre);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 26px;
}
.legal-note p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0 0 8px;
  line-height: 1.55;
}
.legal-note p:last-child { margin-bottom: 0; }
.legal-note strong { color: var(--ink); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  border-radius: 999px;
  padding: 14px 26px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--wine);
  color: var(--cream);
  box-shadow: 0 10px 24px -10px rgba(110,43,57,0.55);
}
.btn-primary:hover { background: var(--wine-dark); }
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 14px 18px;
}
.btn-ghost:hover { color: var(--ink); }

.btn-block { width: 100%; margin-top: 4px; }
.btn-arrow { transition: transform 0.2s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}
.step-nav .btn-primary { flex: 1; }

/* ============================================================
   GUEST COUNTER
   ============================================================ */
.counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 20px 0 6px;
}
.counter-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--wine);
  background: var(--paper);
  color: var(--wine);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.counter-btn:hover { background: var(--cream-2); }
.counter-btn:active { transform: scale(0.92); }

.counter-value {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 600;
  color: var(--wine-dark);
  min-width: 70px;
  text-align: center;
}
.counter-caption {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 6px;
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
}
.field-wide { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  width: 100%;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus {
  border-color: var(--wine);
  background: var(--paper);
  outline: none;
}
input:invalid:not(:placeholder-shown) { }
input.field-error, select.field-error {
  border-color: var(--danger);
  background: #FBF1EE;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236E2B39' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ============================================================
   REVIEW LIST
   ============================================================ */
.review-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.review-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.review-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.review-card-head h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0;
  color: var(--wine-dark);
}
.review-edit {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--wine);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 13.5px;
}
.review-grid dt {
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.review-grid dd {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  cursor: pointer;
}
.checkbox-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--wine); flex-shrink: 0; }
.consent-note { margin: 4px 0 0; }

.submit-error {
  color: var(--danger);
  font-size: 13.5px;
  margin-top: 14px;
  text-align: center;
}

/* ============================================================
   DONE STATE
   ============================================================ */
.card-done { text-align: center; display: flex; flex-direction: column; align-items: center; }
.card-welcome .stamp-badge,
.card-done .stamp-badge { align-self: center; }
.card-done .step-sub { max-width: 42ch; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .field-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr 1fr; }
  .step-nav { flex-direction: column-reverse; }
  .step-nav .btn-ghost { width: 100%; }
  .counter { gap: 20px; }
}

@media (min-width: 640px) {
  .wizard { padding-top: 56px; }
}