/* Vita Pilates · sistema visual compartido (alumnas + dueñas)
   Paleta tomada del Instagram y de la grilla de horarios: salvia, lino y arcilla. */

:root {
  --salvia: #6f7f69;
  --salvia-700: #4f5d4a;
  --salvia-800: #3e4a3a;
  --salvia-200: #c9d1c4;
  --salvia-100: #e3e8df;
  --salvia-50: #f1f3ee;
  --lino: #ece7df;
  --lino-300: #ddd5c9;
  --arcilla: #a3664f;
  --arcilla-700: #87503c;
  --arcilla-100: #f4e6de;
  --tinta: #2b3229;
  --gris: #5f665c;
  --linea: #d6dbd1;
  --blanco: #ffffff;

  --f-ui: "Lexend", -apple-system, system-ui, sans-serif;
  --f-display: "Cormorant Garamond", "Times New Roman", serif;

  --r-l: 24px;
  --r-m: 16px;
  --r-s: 10px;
  --sombra: 0 1px 0 rgba(43, 50, 41, .05), 0 10px 24px -16px rgba(43, 50, 41, .35);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html.en-marco { scrollbar-width: none; }
html.en-marco::-webkit-scrollbar { display: none; }

/* Color de la zona del notch: el de arriba de cada pantalla (verde si empieza con encabezado verde).
   Safari de iOS 26 ya no usa theme-color y pinta esa zona con el fondo del body, así que el body toma
   ese color (lo cambia UI.techo en ui.js) y cada vista pone su fondo claro en su propio contenedor. */
:root { --techo: var(--salvia-50); }
html.techo-verde { --techo: var(--salvia); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--techo);
  color: var(--tinta);
  font-family: var(--f-ui);
  font-size: 1rem;
  line-height: 1.45;
}

/* Si iOS dibuja la página debajo del reloj y la batería, esta franja la pinta del mismo color que
   el encabezado de la pantalla. Queda debajo del fondo oscuro de las hojas. */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  height: var(--safe-t); background: var(--techo); pointer-events: none;
}

img, svg { display: block; max-width: 100%; }
.mt { margin-top: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--salvia-800); }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 3px solid var(--arcilla); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- íconos ---------- */
.ic {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.disc-ico {
  display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--salvia); color: #fff;
}
.disc-ico svg {
  width: 40px; height: 40px; fill: none; stroke: currentColor;
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.disc-ico.sm { width: 42px; height: 42px; }
.disc-ico.sm svg { width: 30px; height: 30px; }

/* ---------- botones ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 14px 20px;
  border: 0; border-radius: var(--r-m);
  background: var(--salvia-700); color: #fff;
  font-weight: 700; font-size: 1.06rem; text-align: center; text-decoration: none;
  transition: transform .12s ease, background-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { background: var(--salvia-200); color: var(--salvia-50); cursor: not-allowed; transform: none; }
.btn.sec { background: var(--blanco); color: var(--salvia-800); box-shadow: inset 0 0 0 2px var(--salvia-200); }
.btn.claro { background: var(--blanco); color: var(--salvia-800); }
.btn.contorno { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.btn.arcilla { background: var(--arcilla); }
.btn.peligro { background: var(--blanco); color: var(--arcilla-700); box-shadow: inset 0 0 0 2px var(--arcilla-100); }
.btn.chico { min-height: 46px; padding: 10px 16px; font-size: .95rem; width: auto; border-radius: 12px; }
.btn-texto {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 4px;
  background: none; border: 0; color: var(--salvia-800); font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px;
  text-decoration-color: var(--salvia-200);
}

/* ---------- lugares (puntitos) ---------- */
.seats { display: inline-flex; gap: 5px; align-items: center; }
.seats i {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--salvia); background: transparent;
}
.seats i.on { background: var(--salvia-700); box-shadow: none; }
.seats.lleno i.on { background: var(--gris); }

/* ---------- pastilla de días (como la grilla de Instagram) ---------- */
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 9px;
  background: var(--salvia); color: #fff; font-weight: 500; letter-spacing: .01em;
}

/* ---------- formularios ---------- */
.field { display: grid; gap: 8px; margin-top: 18px; }
.field label { font-weight: 700; }
.input {
  width: 100%; min-height: 62px; padding: 14px 18px;
  border: 2px solid var(--linea); border-radius: var(--r-m);
  background: var(--blanco); font-size: 1.3rem; letter-spacing: .01em;
  transition: border-color .15s ease;
}
.input:focus { outline: none; border-color: var(--salvia); box-shadow: 0 0 0 4px var(--salvia-100); }
.input.error { border-color: var(--arcilla); }
.input-pre { display: flex; align-items: stretch; }
.input-pre span {
  display: grid; place-items: center; padding: 0 14px; border: 2px solid var(--linea); border-right: 0;
  border-radius: var(--r-m) 0 0 var(--r-m); background: var(--lino); font-weight: 700; color: var(--gris);
  white-space: nowrap;
}
.input-pre .input { border-radius: 0 var(--r-m) var(--r-m) 0; }
.ayuda { color: var(--gris); font-size: .95rem; }
.msg-error { color: var(--arcilla-700); font-weight: 700; font-size: .95rem; }

/* opciones grandes tipo radio */
.opcion {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  padding: 18px; margin-top: 12px; border-radius: var(--r-m);
  background: var(--blanco); box-shadow: inset 0 0 0 2px var(--linea); cursor: pointer;
}
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion .marca {
  flex: none; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--salvia-200); display: grid; place-items: center;
}
.opcion .marca svg { width: 18px; height: 18px; opacity: 0; color: #fff; }
.opcion:has(input:checked) { box-shadow: inset 0 0 0 3px var(--salvia-700); background: var(--salvia-50); }
.opcion:has(input:checked) .marca { background: var(--salvia-700); box-shadow: none; }
.opcion:has(input:checked) .marca svg { opacity: 1; }
.opcion:has(input:focus-visible) { outline: 3px solid var(--arcilla); outline-offset: 2px; }
.opcion:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.opcion b { display: block; font-size: 1.08rem; }
.opcion small { display: block; color: var(--gris); font-size: .95rem; margin-top: 2px; }

/* ---------- hoja inferior (modal) ---------- */
.fondo-modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(43, 50, 41, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: aparecer .18s ease;
}
.hoja {
  width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
  background: var(--salvia-50); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + var(--safe-b));
  animation: subir .26s cubic-bezier(.2, .8, .2, 1);
}
.hoja::before {
  content: ""; display: block; width: 44px; height: 5px; border-radius: 3px;
  background: var(--salvia-200); margin: 0 auto 16px;
}
.hoja h2 { font-size: 1.4rem; line-height: 1.2; }
.hoja p { margin-top: 10px; }
.hoja .acciones { display: grid; gap: 10px; margin-top: 22px; }

@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(40px); opacity: 0; } }

/* ---------- aviso tipo "toast" ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 60;
  transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 14px 20px; border-radius: 14px; background: var(--tinta); color: #fff;
  font-weight: 700; box-shadow: var(--sombra);
  animation: subir .22s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
