:root {
  --bg: #f6efe1;
  --bg-soft: #efe4cf;
  --paper: #fffaf0;
  --ink: #2b2320;
  --ink-soft: #5a4f45;
  --muted: #8a7d6e;
  --gold: #a9843f;
  --gold-soft: #d9c297;
  --wine: #6b2737;
  --wine-dark: #4e1c29;
  --line: #ded0b0;
  --shadow: 0 10px 30px rgba(43, 35, 32, 0.12);
  --radius: 14px;
  --serif: ui-serif, Georgia, 'Times New Roman', Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130f;
    --bg-soft: #1d1913;
    --paper: #211c16;
    --ink: #ece3d2;
    --ink-soft: #cabfa9;
    --muted: #8f8371;
    --gold: #c9a15f;
    --gold-soft: #7a6636;
    --wine: #b5556a;
    --wine-dark: #8a3b4c;
    --line: #3a3226;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

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

body {
  background: radial-gradient(ellipse at top, var(--bg-soft), var(--bg) 60%);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 36px;
  position: relative;
}

@media (max-width: 520px) {
  .card { padding: 32px 22px; }
}

.ornament {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--gold);
  opacity: 0.85;
}
.ornament svg { width: 34px; height: 34px; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: 0.01em;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  text-align: center;
  line-height: 1.3;
}

.subtitle {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0 0 26px;
}

p { color: var(--ink-soft); margin: 0 0 16px; }

.lead {
  color: var(--ink-soft);
  font-size: 0.98rem;
  white-space: pre-line;
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 28px;
}

.btn {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 15px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn-primary {
  background: var(--wine);
  color: #fff8ef;
  box-shadow: 0 6px 18px rgba(107, 39, 55, 0.28);
}
.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);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }

.btn-block { width: 100%; }

/* Progreso */
.progress-label {
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.progress-track {
  height: 5px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 30px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold));
  border-radius: 999px;
  transition: width 0.45s ease;
}

/* Pasos del formulario */
.step {
  animation: stepIn 0.4s ease both;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.step[hidden] { display: none; }

.step-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
}

.step h2 { font-size: 1.3rem; }

.help-text {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
  margin-top: -6px;
  margin-bottom: 14px;
}

label.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 130px; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 132, 63, 0.18);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option:hover { border-color: var(--gold-soft); }
.option input { margin-top: 3px; accent-color: var(--wine); width: 18px; height: 18px; flex-shrink: 0; }
.option.checked { border-color: var(--gold); background: rgba(169, 132, 63, 0.08); }
.option-text { font-size: 0.98rem; }
.option-text small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

.error-text {
  color: var(--wine);
  font-size: 0.86rem;
  margin-top: -8px;
  margin-bottom: 14px;
  min-height: 1.1em;
}

.field { margin-bottom: 20px; }

.anecdote-section {
  background: linear-gradient(160deg, rgba(169,132,63,0.08), transparent 60%);
  border: 1px dashed var(--gold-soft);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.consent-block {
  margin-bottom: 24px;
}
.consent-block .field-label { margin-bottom: 12px; }

.summary-item {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}
.summary-item:last-child { border-bottom: none; }
.summary-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}
.summary-value { color: var(--ink); white-space: pre-line; }
.summary-value.empty { color: var(--muted); font-style: italic; }

.thanks-icon { text-align: center; margin-bottom: 18px; color: var(--gold); }
.thanks-icon svg { width: 52px; height: 52px; }

.center { text-align: center; }

a.link { color: var(--wine); }

.footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 24px;
}

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

.qr-card {
  text-align: center;
}
.qr-card img, .qr-card .qr-svg-holder {
  max-width: 280px;
  width: 100%;
  margin: 0 auto 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
