:root {
  --teal: #023d40;
  --teal-2: #0b5357;
  --orange: #f37230;
  --orange-2: #e05f1d;
  --orange-soft: #fde6d8;
  --ink: #13181e;
  --muted: #5b6670;
  --line: #dfe3e3;
  --bg: #f6f4f1;
  --card: #ffffff;
  --danger: #c62828;
  --ok: #1f7a4d;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(2, 61, 64, .06), 0 12px 32px -12px rgba(2, 61, 64, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(243, 114, 48, .10) 0 120px, transparent 121px),
    radial-gradient(circle at 96% 30%, rgba(2, 61, 64, .07) 0 160px, transparent 161px),
    radial-gradient(circle at 85% 95%, rgba(243, 114, 48, .08) 0 90px, transparent 91px),
    var(--bg);
  line-height: 1.5;
}

.page { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }

.brand { display: flex; justify-content: center; padding: 8px 0 20px; }
.brand img { width: min(260px, 70vw); height: auto; display: block; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
@media (min-width: 560px) { .card { padding: 36px 40px; } }

.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--orange-2); background: var(--orange-soft);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 10px;
}
h1 { font-size: clamp(24px, 6vw, 32px); line-height: 1.15; margin: 0 0 8px; color: var(--teal); font-weight: 900; }
h2 { font-size: 22px; line-height: 1.2; margin: 0 0 8px; color: var(--teal); font-weight: 900; }
.lead { margin: 0 0 24px; color: var(--muted); font-size: 16px; }
.lead strong { color: var(--orange-2); }

/* ── Formulario ── */
.grid { display: grid; gap: 16px; }
@media (min-width: 560px) { .grid.two { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: 14px; }
.field label .opt { font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; font-size: 16px; color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23023d40' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
  white-space: normal;
}
.field select:invalid { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(2, 61, 64, .12);
}
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: 13px; font-weight: 700; min-height: 0; }
.field .hint { color: var(--muted); font-size: 13px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orange); flex: none; }
.check.invalid { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 900; font-size: 17px;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 14px 28px; min-height: 52px;
  background: var(--orange); color: #fff;
  transition: background .15s, transform .1s, opacity .15s;
  text-decoration: none;
}
.btn:hover { background: var(--orange-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--teal); }
.btn.secondary:hover { background: var(--teal-2); }
.btn.ghost { background: transparent; color: var(--teal); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #f1f4f4; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); font-weight: 800; text-decoration: underline; cursor: pointer; }

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

.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 700; margin: 0 0 16px; }
.alert.error { background: #fdecec; color: var(--danger); }
.alert.info { background: #e8f2f2; color: var(--teal); }
.alert.ok { background: #e6f4ec; color: var(--ok); }
[hidden] { display: none !important; }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }

/* ── Ruleta ── */
.code-row { display: flex; gap: 10px; }
.code-row input {
  flex: 1; min-width: 0;
  text-transform: uppercase; letter-spacing: .18em; font-weight: 900; text-align: center; font-size: 20px;
}
.code-row .btn { flex: none; padding: 14px 22px; }

.wheel-wrap { position: relative; width: min(340px, 100%); margin: 24px auto 8px; aspect-ratio: 1; }
.wheel-wrap.locked .wheel { filter: grayscale(.6) opacity(.55); }
.wheel { width: 100%; height: 100%; display: block; transform: rotate(0deg); }
.wheel.spinning { transition: transform 5.2s cubic-bezier(.12, .7, .08, 1); }
.wheel text { font-family: "Nunito", system-ui, sans-serif; font-weight: 900; }
.pointer {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  width: 34px; height: 44px; z-index: 2; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25));
}
.lock-badge {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.lock-badge span {
  background: rgba(2, 61, 64, .92); color: #fff; font-weight: 800; font-size: 14px;
  border-radius: 999px; padding: 8px 16px;
}
@media (prefers-reduced-motion: reduce) { .wheel.spinning { transition-duration: 1.2s; } }

.result { text-align: center; padding-top: 8px; }
.result .big {
  font-size: clamp(56px, 18vw, 84px); line-height: 1; font-weight: 900; color: var(--orange);
  margin: 6px 0 4px;
}
.price-box {
  display: grid; gap: 4px; justify-items: center;
  background: var(--orange-soft); border-radius: 14px; padding: 14px; margin: 16px 0;
}
.price-box .old { color: var(--muted); text-decoration: line-through; font-weight: 700; }
.price-box .new { color: var(--teal); font-size: 28px; font-weight: 900; }
.actions { display: grid; gap: 10px; margin-top: 16px; }

/* ── Suscripción ── */
.plan { border: 1.5px solid var(--line); border-radius: 16px; padding: 20px; margin-top: 8px; }
.plan-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.badge { background: var(--orange); color: #fff; font-weight: 900; border-radius: 999px; padding: 4px 12px; font-size: 14px; white-space: nowrap; }
.rows { margin: 16px 0; display: grid; gap: 8px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; }
.rows .total { border-top: 1.5px dashed var(--line); padding-top: 10px; font-weight: 900; font-size: 20px; color: var(--teal); }
.rows .disc { color: var(--orange-2); font-weight: 800; }

/* Confeti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }
