/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --c-primary:   #7B3F2A;
  --c-primary-d: #5C2E1B;
  --c-secondary: #C4704F;
  --c-accent:    #D4A853;
  --c-dark:      #1A0F07;
  --c-cream:     #F7F1E8;
  --c-cream-d:   #EDE4D3;
  --c-sage:      #5A7A5E;
  --c-sage-l:    #EAF0EA;
  --c-text:      #2D1810;
  --c-text-l:    #7A5A4A;
  --c-border:    #D8CCC0;
  --c-white:     #FFFFFF;
  --c-error:     #C0392B;
  --c-wa:        #25D366;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow:     0 4px 24px rgba(26, 15, 7, 0.08);
  --shadow-lg:  0 8px 40px rgba(26, 15, 7, 0.14);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --step-trans: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h:      72px;
  --prog-h:     64px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--c-cream);
  color: var(--c-text);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ── Progress bar ──────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  padding: 10px 24px 12px;
  height: var(--prog-h);
  display: none;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
}
.progress-bar-wrap.visible { display: flex; }

.progress-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.progress-step-name {
  font-size: 13px;
  color: var(--c-text-l);
  font-weight: 400;
}
.progress-track {
  background: var(--c-cream-d);
  border-radius: 99px;
  height: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ── App shell ─────────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Steps wrapper ─────────────────────────────────────────────────────────── */
.steps-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
}

/* ── Step base ─────────────────────────────────────────────────────────────── */
.step {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity var(--step-trans), transform var(--step-trans);
  padding-bottom: calc(var(--nav-h) + 16px);
}
.step.active {
  opacity: 1;
  transform: translateX(0) !important;
  pointer-events: all;
  z-index: 2;
}
.step.exit-left {
  opacity: 0;
  transform: translateX(-60px) !important;
  pointer-events: none;
  z-index: 1;
}
.step.exit-right {
  opacity: 0;
  transform: translateX(60px) !important;
  pointer-events: none;
  z-index: 1;
}
/* Posición de entrada para navegación hacia atrás (viene desde la izquierda) */
.step.entering-back {
  transform: translateX(-60px) !important;
  opacity: 0;
}

/* ── Step inner container ──────────────────────────────────────────────────── */
.step-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 24px;
}
.step-inner--wide {
  max-width: 680px;
}

/* ── Step header ───────────────────────────────────────────────────────────── */
.step-header {
  text-align: center;
  margin-bottom: 36px;
}
.step-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  line-height: 1;
}
.step-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 4vw, 30px);
  color: var(--c-dark);
  margin-bottom: 8px;
  line-height: 1.2;
}
.step-subtitle {
  font-size: 15px;
  color: var(--c-text-l);
  line-height: 1.5;
}
.step-subtitle strong { color: var(--c-primary); }

/* ── Form fields ───────────────────────────────────────────────────────────── */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-l);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.input-field {
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--c-text);
  background: var(--c-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.input-field:focus {
  border-color: var(--c-secondary);
  box-shadow: 0 0 0 3px rgba(196, 112, 79, 0.12);
}
.input-field--center { text-align: center; text-transform: uppercase; letter-spacing: 0.1em; }
.input-field--big { font-size: 20px; padding: 18px 20px; }
.input-field.error { border-color: var(--c-error); }
.input-error {
  font-size: 12px;
  color: var(--c-error);
  min-height: 16px;
  font-weight: 500;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  transition: all var(--transition);
  line-height: 1;
}
.btn--full { width: 100%; }
.btn--primary {
  background: var(--c-primary);
  color: var(--c-white);
  box-shadow: 0 4px 16px rgba(123, 63, 42, 0.28);
}
.btn--primary:hover {
  background: var(--c-primary-d);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(123, 63, 42, 0.35);
}
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  color: var(--c-text-l);
  background: transparent;
}
.btn--ghost:hover { color: var(--c-primary); }
.btn--whatsapp {
  background: var(--c-wa);
  color: var(--c-white);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}
.btn--whatsapp:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Welcome screen ────────────────────────────────────────────────────────── */
.step--welcome {
  background: var(--c-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}
.welcome-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(196, 112, 79, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(212, 168, 83, 0.15) 0%, transparent 60%),
    var(--c-dark);
  z-index: 0;
}
.welcome-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.7s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.logo-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-secondary), var(--c-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--c-white);
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(196, 112, 79, 0.4);
}
.welcome-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 7vw, 48px);
  color: var(--c-white);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.welcome-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 40px;
}
.code-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  backdrop-filter: blur(12px);
}
.code-hint {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.code-card .input-label {
  color: rgba(255,255,255,0.6);
}
.code-card .input-field {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: var(--c-white);
}
.code-card .input-field::placeholder { color: rgba(255,255,255,0.25); }
.code-card .input-field:focus {
  border-color: var(--c-secondary);
  box-shadow: 0 0 0 3px rgba(196, 112, 79, 0.2);
}
.code-card .btn--primary { margin-top: 20px; }
.code-card .input-error { color: #FF8A80; }

/* ── Counter (asistentes) ──────────────────────────────────────────────────── */
.counter-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 20px auto 16px;
}
.counter-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-white);
  border: 2px solid var(--c-border);
  font-size: 28px;
  color: var(--c-primary);
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}
.counter-btn:hover:not(:disabled) {
  border-color: var(--c-primary);
  background: var(--c-cream-d);
  transform: scale(1.05);
}
.counter-btn:disabled { opacity: 0.3; cursor: default; }
.counter-display {
  text-align: center;
  min-width: 80px;
}
.counter-num {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  color: var(--c-primary);
  line-height: 1;
  font-weight: 600;
  transition: all 0.2s;
}
.counter-label {
  font-size: 14px;
  color: var(--c-text-l);
  letter-spacing: 0.06em;
}
.counter-hint {
  text-align: center;
  font-size: 13px;
  color: var(--c-text-l);
  min-height: 20px;
  transition: color 0.2s;
}

/* ── Time slots ────────────────────────────────────────────────────────────── */
.time-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.time-slot {
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  transition: all var(--transition);
  background: var(--c-white);
}
.time-slot:hover {
  border-color: var(--c-secondary);
  background: var(--c-cream);
}
.time-slot.selected {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: var(--c-white);
}
.time-slot-time {
  display: block;
  font-size: 17px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
}
.time-slot-range {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.65;
  letter-spacing: 0.02em;
}

/* ── Selector de lada (WhatsApp) ───────────────────────────────────────────── */
.phone-row {
  display: flex;
  gap: 8px;
}
.country-select-wrap {
  flex-shrink: 0;
}
.country-select {
  height: 100%;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--c-white);
  color: var(--c-text);
  cursor: pointer;
  min-width: 96px;
  transition: border-color var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%237A5A4A'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}
.country-select:focus {
  border-color: var(--c-primary);
}
.phone-input {
  flex: 1;
  min-width: 0;
}

/* ── Paquete badge (paso 3 cuando está fijo) ─────────────────────────────── */
.pkg-badge {
  margin-top: 24px;
  padding: 16px 24px;
  background: var(--c-sage-l);
  border: 1.5px solid var(--c-sage);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.pkg-badge-label {
  font-weight: 700;
  font-size: 16px;
  color: var(--c-sage);
  letter-spacing: 0.08em;
  font-family: 'Playfair Display', serif;
}
.pkg-badge-sub {
  font-size: 13px;
  color: var(--c-text-l);
}

/* ── Summary pkg sub ─────────────────────────────────────────────────────── */
.summary-pkg-sub {
  display: block;
  font-size: 12px;
  color: var(--c-text-l);
  margin-top: 3px;
}

/* ── Attendee blocks (drinks / snacks) ─────────────────────────────────────── */
.attendee-block {
  margin-bottom: 32px;
}
.attendee-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--c-cream-d);
}
.attendee-block-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-primary);
  color: var(--c-white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.attendee-block-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
}
.attendee-error {
  font-size: 12px;
  color: var(--c-error);
  margin-top: 6px;
  min-height: 16px;
  font-weight: 500;
  display: none;
}
.attendee-error.visible { display: block; }

/* ── Selection cards ───────────────────────────────────────────────────────── */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.sel-card {
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 14px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--c-white);
  position: relative;
}
.sel-card:hover {
  border-color: var(--c-secondary);
  background: var(--c-cream);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.sel-card.selected {
  border-color: var(--c-primary);
  background: var(--c-sage-l);
}
.sel-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-sage);
}
.sel-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--c-text);
  margin-bottom: 4px;
  display: block;
}
.sel-card-desc {
  font-size: 11px;
  color: var(--c-text-l);
  line-height: 1.4;
}

/* ── Summary ───────────────────────────────────────────────────────────────── */
.summary-section {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--c-border);
}
.summary-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-l);
  margin-bottom: 14px;
}
.summary-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-cream-d);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row-label {
  color: var(--c-text-l);
  min-width: 90px;
  flex-shrink: 0;
}
.summary-row-value { font-weight: 500; }
.summary-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.summary-badge--normal { background: var(--c-sage-l); color: var(--c-sage); }
.summary-badge--birthday { background: #FFF3CD; color: #856404; }

.summary-attendee {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-cream-d);
}
.summary-attendee:last-child { border-bottom: none; }
.summary-att-name { font-weight: 600; font-size: 14px; }
.summary-att-detail { font-size: 13px; color: var(--c-text-l); }

.summary-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--c-cream-d);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  color: var(--c-text-l);
  line-height: 1.5;
  margin-top: 8px;
}

/* ── Success ───────────────────────────────────────────────────────────────── */
.success-animation {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.success-circle {
  width: 88px;
  height: 88px;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.success-svg { display: block; }
.success-circle-bg {
  stroke: var(--c-sage);
  stroke-width: 2;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: drawCircle 0.5s 0.2s ease forwards;
}
.success-check {
  stroke: var(--c-sage);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawCheck 0.4s 0.6s ease forwards;
}
@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.success-title {
  text-align: center;
  margin-bottom: 6px;
}
.success-sub {
  text-align: center;
  color: var(--c-text-l);
  font-size: 15px;
  margin-bottom: 24px;
}
.success-booking-id {
  background: var(--c-cream-d);
  border-radius: var(--radius);
  padding: 10px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--c-text-l);
  margin-bottom: 20px;
  letter-spacing: 0.06em;
}
.success-booking-id strong {
  color: var(--c-primary);
  font-size: 16px;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}
.success-detail-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.success-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
}
.success-detail-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.success-detail-text { color: var(--c-text); line-height: 1.4; }
.success-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.success-warnings {
  margin-top: 20px;
  font-size: 12px;
  color: var(--c-text-l);
  text-align: center;
  line-height: 1.6;
}

/* ── Navigation bar ────────────────────────────────────────────────────────── */
.nav-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--c-white);
  border-top: 1px solid var(--c-border);
  padding: 12px 20px;
  height: var(--nav-h);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(26, 15, 7, 0.06);
}
.nav-bar.visible { display: flex; }
.nav-bar .btn--primary { min-width: 140px; }

/* ── Loader ────────────────────────────────────────────────────────────────── */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 15, 7, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}
.loader-overlay.visible { display: flex; }
.loader-card {
  background: var(--c-white);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}
.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--c-cream-d);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loader-text {
  font-size: 15px;
  color: var(--c-text-l);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .time-slots { grid-template-columns: 1fr 1fr; }
  .selection-grid { grid-template-columns: 1fr 1fr; }
  .step-inner { padding: 28px 16px; }
  .counter-num { font-size: 52px; }
  .country-select { min-width: 82px; font-size: 13px; }
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
.step::-webkit-scrollbar { width: 4px; }
.step::-webkit-scrollbar-track { background: transparent; }
.step::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 99px; }

/* ── When progress is visible, push content ─────────────────────────────────── */
body.has-progress .step-inner { padding-top: calc(var(--prog-h) + 28px); }
body.has-progress .step--welcome { min-height: 100dvh; }
