:root {
  --bg: #0e1116;
  --card: #171b22;
  --card-2: #1f242d;
  --line: #2a313c;
  --text: #eef2f7;
  --muted: #9aa6b5;
  --primary: #25d366;     /* verde WhatsApp */
  --primary-d: #1ea952;
  --accent: #4aa8ff;
  --danger: #ff6b6b;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  color: var(--muted);
  margin-bottom: 10px;
}
.progress { display: flex; align-items: center; gap: 10px; }
.progress-bar {
  flex: 1;
  height: 7px;
  background: var(--card-2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width .35s ease;
}
.progress-text { font-size: 12px; color: var(--muted); min-width: 42px; text-align: right; }

/* ── Stage ── */
.stage {
  flex: 1;
  padding: 26px 18px 30px;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(74,168,255,.12);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 14px;
}
.q-label {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
}
.q-help {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
}

/* ── Intro ── */
.intro-title { font-size: 27px; font-weight: 800; margin: 6px 0 14px; line-height: 1.25; }
.intro-body { color: var(--text); font-size: 17px; white-space: pre-line; }

/* ── Inputs ── */
.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
input[type="text"], textarea {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
  padding: 14px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 110px; resize: vertical; }
::placeholder { color: #5d6877; }

select.grp-input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
  padding: 14px;
  border-radius: var(--radius);
  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='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa6b5' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
select.grp-input:focus { border-color: var(--primary); }

/* ── Option buttons (single / multi) ── */
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
  user-select: none;
}
.option:active { transform: scale(.99); }
.option:hover { border-color: #3a4453; }
.option.selected { border-color: var(--primary); background: rgba(37,211,102,.10); }
.option .marker {
  width: 24px; height: 24px;
  flex: 0 0 24px;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  color: var(--bg);
  font-size: 14px; font-weight: 900;
}
.option.single .marker { border-radius: 50%; }
.option.multi .marker { border-radius: 6px; }
.option.selected .marker { background: var(--primary); border-color: var(--primary); }
.option .opt-label { font-size: 16px; line-height: 1.35; }

/* ── Repeater ── */
.repeater-item {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 6px;
  margin-bottom: 14px;
}
.repeater-item .item-num {
  font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 10px;
}
.repeater-item .remove {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; color: var(--danger);
  font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn-add {
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--line);
  color: var(--accent);
  padding: 14px;
  border-radius: var(--radius);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.btn-add:hover { border-color: var(--accent); }

/* ── Footer / buttons ── */
.footbar {
  position: sticky; bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 12px;
}
.btn {
  border: none; border-radius: var(--radius);
  font-size: 17px; font-weight: 700;
  padding: 15px 20px; cursor: pointer;
  transition: opacity .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #04210f; flex: 1; }
.btn-primary:hover { background: var(--primary-d); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: var(--card-2); color: var(--text); }
.btn-ghost:disabled { opacity: 0; pointer-events: none; }

.error-msg { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 18px; }

/* ── Estado final / enviado ── */
.center-screen {
  text-align: center;
  padding: 40px 10px;
}
.center-screen .big-emoji { font-size: 64px; margin-bottom: 10px; }
.spinner {
  width: 42px; height: 42px;
  border: 4px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ── Ubicación / mapa ── */
.online-toggle {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
  cursor: pointer; font-size: 15px;
}
.online-toggle input { width: 20px; height: 20px; accent-color: var(--primary); }
.loc-search { display: flex; gap: 8px; margin-bottom: 10px; }
.loc-search input { flex: 1; }
.loc-search button {
  background: var(--accent); color: #04210f; border: none;
  border-radius: var(--radius); padding: 0 18px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn-geoloc {
  width: 100%; background: var(--card-2); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; margin-bottom: 12px;
}
.btn-geoloc:hover { border-color: var(--accent); }
.map {
  height: 260px; width: 100%;
  border-radius: var(--radius); overflow: hidden;
  border: 1.5px solid var(--line); margin-bottom: 14px;
  background: var(--card-2);
}
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; padding: 16px; text-align: center; }
.leaflet-container { font: inherit; }

/* ── Horarios ── */
.sched-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sched-shortcuts button {
  background: rgba(74,168,255,.12); color: var(--accent);
  border: 1.5px solid rgba(74,168,255,.35); border-radius: 99px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sched-shortcuts button:hover { background: rgba(74,168,255,.22); }
.day-row { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.day-name { font-weight: 700; font-size: 16px; }
.day-row.is-closed { opacity: .9; }
.day-row.is-closed .day-name { color: var(--muted); }
.day-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 99px; overflow: hidden; }
.seg {
  background: transparent; border: none; color: var(--muted);
  padding: 8px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg[data-open="1"][aria-pressed="true"] { background: var(--primary); color: #04210f; }
.seg[data-open="0"][aria-pressed="true"] { background: var(--card-2); color: var(--text); }
.day-turnos { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.turno { display: flex; align-items: center; gap: 8px; }
.turno input[type="time"] {
  flex: 1; background: var(--card-2); border: 1.5px solid var(--line); color: var(--text);
  font-size: 16px; font-family: inherit; padding: 10px; border-radius: 10px; outline: none;
}
.turno input[type="time"]:focus { border-color: var(--primary); }
.turno-a { color: var(--muted); font-size: 14px; }
.turno-del { background: none; border: none; color: var(--danger); font-size: 16px; cursor: pointer; padding: 4px 8px; }
.turno-add { align-self: flex-start; background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0; }

/* ── Redes ── */
.social-field label { color: var(--text); }

/* ── Ejemplos sugeridos (chips repeater + cards textarea) ── */
.sug-title {
  font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.4;
}
.suggestions {
  background: rgba(74,168,255,.07);
  border: 1px solid rgba(74,168,255,.18);
  border-radius: var(--radius);
  padding: 14px; margin-bottom: 16px;
}
.sug-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sug-chip {
  background: var(--card); color: var(--text);
  border: 1.5px solid rgba(74,168,255,.4); border-radius: 99px;
  padding: 9px 14px; font-size: 14px; cursor: pointer; text-align: left;
  transition: background .15s, border-color .15s;
}
.sug-chip:hover { background: rgba(74,168,255,.15); border-color: var(--accent); }

.examples { margin-top: 14px; }
.ex-cards { display: flex; flex-direction: column; gap: 10px; }
.ex-card {
  text-align: left; width: 100%;
  background: var(--card); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px; font-size: 15px; line-height: 1.45; cursor: pointer;
  font-family: inherit; white-space: pre-line;
  transition: border-color .15s, background .15s;
}
.ex-card:hover { border-color: var(--primary); background: rgba(37,211,102,.08); }
.ex-card::before { content: "👉 "; opacity: .7; }
