/* Deep Slate / Luxury Ink — mismo sistema visual que login.css/agent-config.css */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/inter:vf@latest/latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Cal Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/cal-sans@latest/latin-400-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --panel-muted: #f0f1f4;
  --text: #0d0f12;
  --text-soft: #4a5159;
  --muted: #767e89;
  --line: #e4e8ee;
  --line-strong: #cbd0da;
  /* Paleta de la tienda: negro + celeste brillante.
     --primary es RELLENO y siempre lleva --on-primary encima; el celeste brillante no tiene
     contraste suficiente como texto sobre blanco (2.7:1), por eso el texto usa --primary-strong. */
  --primary: #0b1220;
  --on-primary: #ffffff;
  --primary-strong: #0b6ea8;
  --primary-soft: #eaf8fe;
  --accent: #35c3f0;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --success: #0f7a4b;
  --success-soft: #eafff3;
  --shadow: 0 24px 70px rgba(13, 15, 18, 0.14);
  --radius: 12px;
  --font-display: "Cal Sans", "Aptos Display", "Segoe UI Variable Display", sans-serif;
  --font-body: "Inter", "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a0d;
  --panel: #0f1117;
  --panel-muted: #161922;
  --text: #eef2ff;
  --text-soft: #b4bccb;
  --muted: #828b9b;
  --line: #1e2330;
  --line-strong: #2c3344;
  --primary: #35c3f0;
  --on-primary: #0b1220;
  --primary-strong: #68d5f7;
  --primary-soft: rgba(53, 195, 240, 0.16);
  --accent: #35c3f0;
  --danger: #ffb4ab;
  --danger-soft: rgba(255, 180, 171, 0.12);
  --success: #7fe3b4;
  --success-soft: rgba(127, 227, 180, 0.12);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(1100px 520px at 12% -10%, color-mix(in srgb, var(--primary-soft) 55%, transparent), transparent 60%),
    radial-gradient(900px 460px at 100% 0%, color-mix(in srgb, var(--primary-soft) 35%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  text-rendering: geometricPrecision;
}

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

/* Bug real: varias clases de aca abajo (.wizard-step, .field, .book-button) fijan su propio
   "display", que empata en especificidad con la regla nativa `[hidden]{display:none}` del
   navegador — y como esta hoja de estilos se carga despues, gana la clase y el elemento
   "hidden" se sigue viendo. Con esta regla (mayor especificidad) el atributo hidden SIEMPRE
   gana, sin importar que mas le pongamos a la clase despues. */
[hidden] {
  display: none !important;
}

/* ---------- Top bar ---------- */

.book-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--accent);
}

.book-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  /* Fijo en celeste + tinta, no atado al tema: es el unico golpe de color de marca que se ve
     apenas entras, y en modo claro la pagina quedaba entera en blanco y negro. */
  background: var(--accent);
  color: #0b1220;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 38%, transparent);
}

.book-topbar-text {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.book-topbar-title {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.book-topbar-subtitle {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Theme toggle (mismo patron que el panel admin) ---------- */

.theme-toggle {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 32px;
  border: none;
  border-radius: 999px;
  padding: 2px;
  background: var(--panel-muted);
  cursor: pointer;
}

.theme-track {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.theme-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color 160ms ease;
}

.theme-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

:root[data-theme="dark"] .theme-thumb {
  transform: translateX(28px);
}

:root:not([data-theme="dark"]) .theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  color: var(--primary-strong);
}

/* ---------- Layout: el shell ocupa el resto del viewport y CENTRA la tarjeta, asi si el
   contenido es mas chico que la pantalla no queda un bloque vacio pegado abajo. ---------- */

.book-shell {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px 18px;
  overflow-y: auto;
}

.book-card,
.landing-card {
  display: grid;
  gap: 18px;
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 2);
  padding: 26px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* ---------- Vista: bienvenida ---------- */

.landing-card {
  justify-items: center;
  text-align: center;
}

/* El PNG del logo tiene fondo blanco real (no transparente, a pesar de que el formato soporta
   canal alfa) — en vez de pelearla, se lo trata a proposito como una placa blanca circular. Se ve
   bien en claro y oscuro, y no hay bug de "cuadrado blanco roto" flotando sobre el fondo oscuro.
   object-fit:contain (no cover) porque el logo real ocupa casi todo el ancho de su lienzo — un
   recorte circular a lo bruto (cover) cortaria el texto "ESTRELLA" en los bordes. */
.landing-logo-frame {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.landing-logo {
  display: block;
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.landing-tagline {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.landing-actions {
  display: grid;
  gap: 10px;
  width: 100%;
}

.landing-socials {
  display: flex;
  gap: 12px;
}

.landing-social-link {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  transition: border-color 150ms ease, color 150ms ease;
}

.landing-social-link:hover {
  border-color: var(--accent);
  color: var(--primary-strong);
}

.landing-social-link svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landing-website {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.landing-website:hover {
  color: var(--primary-strong);
}

/* ---------- Vista: mis reservas ---------- */

.reservations-hint {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.reservations-form {
  display: grid;
  gap: 14px;
}

.reservations-list {
  display: grid;
  gap: 10px;
}

.reservation-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.reservation-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 750;
}

.reservation-item-meta {
  color: var(--text-soft);
  font-size: 13px;
}

.reservation-badge {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reservation-badge.status-confirmed {
  background: var(--success-soft);
  color: var(--success);
}

.reservation-badge.status-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Mis reservas es SOLO de consulta (decision del dueño 2026-07-20): no hay boton de cancelar
   aca, si el cliente necesita cancelar o reprogramar se lo dirige a escribir por WhatsApp en vez
   de ofrecer una accion que despues termina generando un doble manejo del turno. */
.reservations-cancel-note {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

.reservations-cancel-note a {
  color: var(--primary-strong);
  font-weight: 700;
}

/* ---------- Wizard: progreso + pasos + volver ---------- */

.wizard-progress {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wizard-step {
  display: grid;
  gap: 14px;
}

.wizard-back {
  justify-self: start;
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.wizard-back:hover {
  color: var(--primary-strong);
}

.step-label {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 750;
}

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

/* Marca/modelo/color de la bici (pedido de Facu 2026-08-19): son 3 datos de UNA sola cosa, van
   en fila como field-row — mismo criterio, se apila abajo de 480px (ver el media query). */
.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

#serviceFields {
  display: grid;
  gap: 14px;
}

.field span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 13px;
  background: var(--panel);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:hover {
  border-color: var(--line-strong);
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
  outline: 0;
}

/* ---------- Paso 1: sucursal ----------
   Cada tarjeta separa 2 acciones distintas con su propio boton: "Elegir esta sucursal" (avanza
   el wizard) y "Ver ubicacion" (despliega un mapa chico). No pueden compartir un solo <button>
   contenedor (un <button> no puede tener un <iframe>/<a> interactivo adentro, HTML invalido) —
   por eso .branch-card es un div, no un button. */

.branch-grid {
  display: grid;
  gap: 10px;
}

.branch-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  transition: border-color 150ms ease;
}

.branch-card:has(.branch-card-select[aria-checked="true"]) {
  border-color: var(--accent);
}

.branch-card-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 96px;
  object-fit: cover;
}

.branch-card-body {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px 14px;
}

.branch-card-name {
  font-size: 15px;
  font-weight: 750;
}

.branch-card-address {
  color: var(--muted);
  font-size: 12px;
}

.branch-card-hours {
  color: var(--text-soft);
  font-size: 12px;
}

.branch-card-map-toggle {
  justify-self: start;
  border: none;
  background: none;
  padding: 0;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.branch-card-map-toggle:hover {
  text-decoration: underline;
}

.branch-card-map {
  display: grid;
  gap: 6px;
}

.branch-card-map iframe {
  width: 100%;
  /* 200 y no 130: por debajo de ~180px Google esconde los controles de zoom y el mapa parece
     una foto fija. Con este alto aparecen los controles y se puede arrastrar comodo. */
  height: 200px;
  border: 0;
  border-radius: var(--radius);
}

.branch-card-map-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.branch-card-map-link:hover {
  color: var(--primary-strong);
}

.branch-card-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--panel-muted);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.branch-card-select:hover {
  border-color: var(--accent);
}

.branch-card-select[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--primary);
  color: var(--on-primary);
}

/* ---------- Paso 2: dia + horario ---------- */

.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.day-tab {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  gap: 2px;
  min-width: 64px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.day-tab:hover {
  border-color: var(--accent);
}

.day-tab[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--primary);
  color: var(--on-primary);
}

.day-tab-weekday {
  text-transform: capitalize;
  opacity: 0.85;
}

.day-tab-date {
  font-size: 13px;
}

.slots-box {
  display: grid;
  gap: 8px;
  min-height: 44px;
  max-height: 280px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.slots-hint {
  margin: 0;
  padding: 12px 2px;
  color: var(--muted);
  font-size: 13px;
}

.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.time-row:hover {
  border-color: var(--accent);
}

.time-row[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.time-status {
  font-size: 12px;
  font-weight: 700;
}

.time-status.is-available {
  color: var(--success);
}

.time-status.is-reserved {
  color: var(--danger);
}

.time-row.is-reserved {
  cursor: not-allowed;
  opacity: 0.6;
}

.time-row.is-reserved:hover {
  border-color: var(--line);
}

/* ---------- Paso 3: motivo ---------- */

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

.motivo-card {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

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

.motivo-card[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--primary);
  color: var(--on-primary);
}

/* ---------- Honeypot ---------- */

/* Fuera de pantalla pero presente en el DOM y fuera del tab order, para que un bot que
   autocompleta todos los inputs lo llene igual, sin que un humano lo vea nunca. */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Estado / botones ---------- */

.status-message {
  border: 1px solid color-mix(in srgb, var(--danger) 26%, var(--line));
  border-radius: var(--radius);
  padding: 12px 13px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.status-message.is-success {
  border-color: color-mix(in srgb, var(--success) 26%, var(--line));
  background: var(--success-soft);
  color: var(--success);
}

.book-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
  font-weight: 800;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.book-button:hover:not(:disabled) {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.book-button:active:not(:disabled) {
  transform: translateY(1px);
}

.book-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.book-button.secondary {
  justify-content: center;
  border-color: var(--line);
  background: var(--panel-muted);
  color: var(--text);
}

.book-button.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--panel);
  color: var(--primary-strong);
}

.button-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
}

.button-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .book-topbar {
    padding: 10px 14px;
  }

  .book-topbar-title {
    font-size: 15px;
  }

  .book-topbar-subtitle {
    display: none;
  }

  .book-shell {
    padding: 14px 12px;
  }

  .book-card {
    padding: 18px;
  }

  .field-row,
  .field-row-3 {
    grid-template-columns: 1fr;
  }

  .branch-card {
    grid-template-columns: 72px 1fr;
  }

  .branch-card-photo {
    min-height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
