@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/poppins-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/poppins-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/poppins-600-latin.woff2") format("woff2");
}

/* Mismos tokens que magnoliacom.es */
:root {
  --bosque: #1c2b24;
  --bosque-hover: #263a31;
  --magnolia: #3e5a4a;
  --salvia: #c9d4c5;
  --crema: #f7f3ea;
  --marfil: #fffdf8;
  --ink: var(--bosque);
  --ink-3: rgba(28, 43, 36, 0.62);
  --ink-4: rgba(28, 43, 36, 0.42);
  --brand: var(--magnolia);
  --rule: rgba(28, 43, 36, 0.1);
  --field-border: rgba(28, 43, 36, 0.16);
  --focus: 0 0 0 3px rgba(62, 90, 74, 0.16);
  --error: #a33a2b;
  --font: "Poppins", system-ui, sans-serif;
  --r-pill: 999px;
  --r-card: 16px;
  --r-field: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cabecera y tarjeta ---------- */
.cab {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--bosque);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 56px;
}

.card {
  padding: 28px 32px 32px;
  background: var(--marfil);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgba(28, 43, 36, 0.04), 0 12px 40px rgba(28, 43, 36, 0.06);
}

h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 24px;
  color: var(--ink-3);
  line-height: 1.55;
}

a { color: var(--brand); }

/* ---------- Progreso ---------- */
.progress { margin-bottom: 24px; }

.progress__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.progress__meta span:last-child { font-weight: 500; color: var(--brand); }

.progress__bar {
  height: 4px;
  overflow: hidden;
  background: var(--rule);
  border-radius: var(--r-pill);
}

.progress__bar span {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width 0.35s var(--ease);
}

/* ---------- Campos ---------- */
label {
  display: block;
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 500;
}

.opt { color: var(--ink-3); font-weight: 400; }

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 0 14px;
  height: 46px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: var(--r-field);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

textarea {
  height: auto;
  min-height: 92px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

input::placeholder,
textarea::placeholder { color: var(--ink-4); }

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}

/* Desplegable con flecha propia */
.select {
  position: relative;
  display: block;
  margin-top: 6px;
}

.select select {
  margin-top: 0;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select select:invalid,
.select select:has(option[value=""]:checked) { color: var(--ink-4); }

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

input.code {
  height: 56px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-align: center;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  line-height: 1.45;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row > label { min-width: 0; }
.spaced { margin-top: 24px; }

/* ---------- Buscador de Google ---------- */
.search { position: relative; margin-bottom: 18px; }
.search > label { margin-bottom: 0; }

.search__box { position: relative; margin-top: 6px; }

.search__box input {
  margin-top: 0;
  padding-left: 42px;
  height: 50px;
}

.search__box input::-webkit-search-cancel-button { display: none; }

.search__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.search__results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(28, 43, 36, 0.12);
}

.search__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.search__item:hover,
.search__item[aria-selected="true"] { background: var(--crema); }

.search__main { font-size: 0.92rem; font-weight: 500; }
.search__secondary { font-size: 0.8rem; color: var(--ink-3); }

.search__empty {
  padding: 12px;
  font-size: 0.85rem;
  color: var(--ink-3);
}

.place {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--crema);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.place__name { margin: 0 0 2px; font-weight: 600; }
.place__line { margin: 0; font-size: 0.85rem; color: var(--ink-3); line-height: 1.5; }
.place__line:empty { display: none; }

/* ---------- Casillas tipo chip ---------- */
.group { margin-bottom: 22px; }

.group__label {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  -webkit-tap-highlight-color: transparent;
  position: relative;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
}

.chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 15px;
  line-height: 1.35;
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: var(--r-pill);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.chip:hover span { border-color: var(--brand); }

.chip input:checked + span {
  color: var(--crema);
  background: var(--bosque);
  border-color: var(--bosque);
}

.chip input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Horario ---------- */
.hours {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
}

.day {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
}

.day + .day { border-top: 1px solid var(--rule); }

.day__name { font-size: 0.9rem; font-weight: 500; }
.day--closed .day__name { color: var(--ink-3); }

.day__ranges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  min-height: 34px;
  justify-content: center;
}

.day__closed { font-size: 0.85rem; line-height: 34px; color: var(--ink-4); }

.range {
  display: flex;
  gap: 6px;
  align-items: center;
}

.select--time { margin-top: 0; }

.select--time select {
  width: 92px;
  height: 36px;
  margin: 0;
  padding: 0 28px 0 12px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.select--time::after { right: 12px; width: 6px; height: 6px; }

.range__sep { font-size: 0.85rem; color: var(--ink-3); }

.icon-btn {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-3);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.icon-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.icon-btn:hover { color: var(--error); background: rgba(163, 58, 43, 0.08); }

.switch {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  height: 34px;
  margin: 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.switch__track {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  background: rgba(28, 43, 36, 0.18);
  border-radius: var(--r-pill);
  transition: background 0.2s var(--ease);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  width: 100%;
  height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0 1.6rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--crema);
  text-decoration: none;
  background: var(--bosque);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:hover { background: var(--bosque-hover); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn:focus-visible { outline: 3px solid rgba(62, 90, 74, 0.35); outline-offset: 2px; }

.btn--ghost {
  color: var(--bosque);
  background: transparent;
  border-color: var(--field-border);
}

.btn--ghost:hover { background: var(--crema); border-color: var(--bosque); }

.nav {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.nav .btn--ghost { flex: 0 0 120px; }

.link {
  padding: 4px 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  cursor: pointer;
}

.link--small { font-size: 0.82rem; }
.link:disabled { color: var(--ink-3); text-decoration: none; cursor: default; }
.search .link { margin-top: 8px; }
.hours + .link { margin-top: 8px; }

.links {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 16px;
}

/* ---------- Mensajes y extras ---------- */
.error {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--error);
  background: rgba(163, 58, 43, 0.08);
  border-radius: var(--r-field);
}

.turnstile { margin: 4px 0 18px; }
.turnstile:empty { display: none; }

.done-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  place-items: center;
  background: var(--salvia);
  border-radius: 50%;
}

.done-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--bosque);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Móvil ---------- */
@media (max-width: 520px) {
  .card { padding: 22px 18px 24px; }
  h1 { font-size: 1.35rem; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .day { grid-template-columns: 1fr; gap: 6px; }
  .day--closed { grid-template-columns: 1fr auto; align-items: center; }
  .day--closed .day__ranges { min-height: 0; }
  .select--time select { width: 88px; }
  .nav .btn--ghost { flex-basis: 96px; }
}
