/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Fallback (terracota sobre arena) — themes.js sobreescribe en runtime */
  --bg:           #f5ede0;
  --surface:      #eae0c8;
  --card-bg:      #dfd4b8;
  --card-hover:   #d5c8a8;
  --border:       #c8b890;
  --accent:       #c26243;
  --accent-glow:  #c2624340;
  --gold:         #6b6840;
  --gold-glow:    #6b684040;
  --text:         #2c1a0e;
  --text-muted:   #a07050;
  --radius:       14px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Georgia', serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 40px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* ── Main ── */
main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  width: 100%;
}

/* ── Wizard progress bar ── */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.wizard-progress.hidden { display: none; }

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.step-counter {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── Wizard steps ── */
.wizard-step {
  display: none;
  flex-direction: column;
  gap: 28px;
  animation: stepIn 0.28s ease;
}

.wizard-step.active { display: flex; }

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

/* ── Step header ── */
.step-header { text-align: center; }

.step-title {
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  font-weight: normal;
  color: var(--gold);
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.step-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.font-step-text {
  color: var(--accent);
  font-style: italic;
  font-size: 0.95rem;
  font-weight: normal;
}

/* ── Inputs block ── */
.inputs-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#name-input,
.dedication-text {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.15rem;
  padding: 16px 22px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  text-align: center;
}

.dedication-text {
  font-size: 1rem;
  font-style: italic;
  border-style: dashed;
}

#name-input::placeholder,
.dedication-text::placeholder { color: var(--text-muted); opacity: 0.6; }

#name-input:focus,
.dedication-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-style: solid;
}

.dedication-toggle {
  background: none;
  border: 1px dashed var(--text-muted);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: 'Georgia', serif;
  font-size: 0.82rem;
  padding: 7px 18px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  letter-spacing: 0.04em;
}

.dedication-toggle:hover { border-color: var(--accent); color: var(--accent); }

#dedication-inputs {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dedication-row {
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
}

.dedication-row .dedication-text { flex: 1; }

.dedication-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}

.dedication-remove:hover { border-color: var(--accent); color: var(--accent); }

/* ── Dedication cost note ── */
.ded-note {
  width: 100%;
  max-width: 560px;
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.82rem;
  color: var(--gold);
  line-height: 1.5;
  text-align: center;
}

/* ── Step action buttons ── */
.step-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.step-actions-row { justify-content: space-between; }

.step-actions-col {
  flex-direction: column;
  align-items: center;
}

.next-btn {
  background: var(--accent);
  border: none;
  border-radius: 30px;
  color: #fff;
  font-family: 'Georgia', serif;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  padding: 13px 32px;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.next-btn:hover:not(:disabled) { background: var(--gold); transform: translateY(-1px); }
.next-btn:active:not(:disabled) { transform: translateY(0); }
.next-btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.back-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  color: var(--text-muted);
  font-family: 'Georgia', serif;
  font-size: 0.88rem;
  padding: 12px 24px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  letter-spacing: 0.03em;
}

.back-btn:hover { border-color: var(--accent); color: var(--accent); }

.whatsapp-btn {
  background: #25d366;
  border: none;
  border-radius: 30px;
  color: #fff;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  padding: 14px 36px;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s;
  box-shadow: 0 4px 20px #25d36644;
  width: 100%;
  max-width: 340px;
}

.whatsapp-btn:hover  { background: #1db954; transform: translateY(-1px); }
.whatsapp-btn:active { transform: translateY(0); }

/* ── Font grid ── */
.fonts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 540px) { .fonts-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .fonts-grid { grid-template-columns: 1fr 1fr; gap: 20px; } }

/* ── Font card ── */
.font-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 18px 18px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.15s;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.font-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 20%, transparent);
}

.font-card:active { transform: translateY(0); }

.font-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 6px 20px color-mix(in srgb, var(--accent) 20%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--card-bg));
}

.font-card.loading .font-preview { opacity: 0.3; }
.font-card.loading { pointer-events: none; }

/* Selected badge */
.badge-selected {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.62rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Georgia', serif;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  pointer-events: none;
}

/* Font preview text */
.font-preview {
  width: 100%;
  text-align: center;
  word-break: break-word;
  border-radius: 8px;
  padding: 4px 6px;
  color: var(--text);
  line-height: 1.2;
}

.font-name {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: 'Georgia', serif;
}

.font-card.selected .font-name { color: var(--accent); }

/* No-tildes note */
.no-tildes-note {
  font-size: 0.65rem;
  font-family: 'Georgia', serif;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
}

/* ── Summary cards ── */
#summary-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-card-label {
  color: var(--text-muted);
  font-size: 0.70rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.summary-card-fontname {
  color: var(--accent);
  font-size: 0.70rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card-change {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: 'Georgia', serif;
  font-size: 0.70rem;
  padding: 3px 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
  margin-left: auto;
}

.summary-card-change:hover { border-color: var(--accent); color: var(--accent); }

.summary-card-preview {
  text-align: center;
  word-break: break-word;
  color: var(--text);
  line-height: 1.25;
  padding: 6px 4px 2px;
}

.summary-card-preview.no-font {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
