/* ═══════════════════════════════════════════════════════════
   reservas.css — Flujo de reserva de turnos
   Diseño aprobado. No modificar sin consenso.
   ═══════════════════════════════════════════════════════════ */

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

/* ══════════════════════════════════════
   TOKENS — MODO CLARO
══════════════════════════════════════ */
:root {
  --bg-0:      #ffffff;
  --bg-1:      #f4f4f5;
  --bg-2:      #e8e8ea;
  --border:    #dddde0;
  --text-hi:   #111113;
  --text-md:   #3a3a3f;
  --text-lo:   #72727a;
  --accent:    #111113;
  --accent-fg: #ffffff;
  --radius:    12px;
  --shadow:    0 2px 12px rgba(0,0,0,.07);
  --shadow-md: 0 8px 32px rgba(0,0,0,.1);
}

/* ══════════════════════════════════════
   TOKENS — MODO OSCURO
══════════════════════════════════════ */
[data-theme="dark"] {
  --bg-0:      #0d0c0a;
  --bg-1:      #141210;
  --bg-2:      #1d1a16;
  --border:    #2a2620;
  --text-hi:   #f0e8d8;
  --text-md:   #c8bfb0;
  --text-lo:   #7a7060;
  --accent:    #c8a84a;
  --accent-fg: #0d0c0a;
  --shadow:    0 2px 12px rgba(0,0,0,.4);
  --shadow-md: 0 8px 32px rgba(0,0,0,.5);
}

/* ══════════════════════════════════════
   BASE
══════════════════════════════════════ */
html { scroll-behavior: smooth; }

body {
  background: var(--bg-1);
  color: var(--text-md);
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.72;
  min-height: 100vh;
  transition: background .3s, color .3s;
}

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
nav {
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background .3s, border-color .3s;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--text-hi);
  transition: color .3s;
  text-decoration: none;
}

.nav-logo em { font-style: italic; color: var(--accent); }

.back-link {
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-lo);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: color .2s;
}

.back-link:hover { color: var(--text-hi); }

.theme-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: .35rem .9rem .35rem .5rem;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-lo);
  font-family: 'Lato', sans-serif;
  transition: background .3s, border-color .3s, color .3s;
}

.theme-btn:hover { color: var(--text-hi); border-color: var(--text-lo); }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ══════════════════════════════════════
   STEPPER
══════════════════════════════════════ */
.stepper {
  display: flex;
  align-items: center;
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow-x: auto;
  gap: 0;
  transition: background .3s, border-color .3s;
  scrollbar-width: none;
}

.stepper::-webkit-scrollbar { display: none; }

.step { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  background: var(--bg-2);
  color: var(--text-lo);
  border: 1.5px solid var(--border);
  transition: background .25s, color .25s, border-color .25s;
  flex-shrink: 0;
}

.step-label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-lo);
  white-space: nowrap;
  transition: color .25s;
}

.step.active .step-num  { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.step.active .step-label { color: var(--text-hi); font-weight: 600; }
.step.done .step-num    { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.step.done .step-label  { color: var(--text-lo); }

.step-sep {
  flex: 1;
  min-width: 16px;
  height: 1.5px;
  background: var(--border);
  margin: 0 .4rem;
  transition: background .3s;
}

.step-sep.done { background: var(--accent); opacity: .35; }

/* ══════════════════════════════════════
   CARD PRINCIPAL
══════════════════════════════════════ */
.card {
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background .3s, border-color .3s;
  overflow: hidden;
}

.card-head {
  padding: 1.5rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--border);
  transition: border-color .3s;
}

.card-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-hi);
  margin-bottom: .2rem;
  transition: color .3s;
}

.card-head p { font-size: .96rem; color: var(--text-lo); }

.card-body { padding: 1.6rem 1.5rem; }

/* ── BREADCRUMB ── */
.step-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}

.crumb-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  color: var(--text-lo);
  cursor: pointer;
  transition: color .2s;
}

.crumb-item:hover { color: var(--text-hi); }
.crumb-item .crumb-label { font-weight: 500; color: var(--text-md); }
.crumb-sep { color: var(--border); font-size: .92rem; }
.crumb-item .crumb-edit { font-size: .68rem; color: var(--accent); text-decoration: underline; font-weight: 600; }

/* ══════════════════════════════════════
   LAYOUT DOS COLUMNAS
══════════════════════════════════════ */
.layout-cols {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 1.5rem;
  align-items: start;
}

/* ══════════════════════════════════════
   RESUMEN LATERAL
══════════════════════════════════════ */
.resumen-card {
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 76px;
  transition: background .3s, border-color .3s;
  overflow: hidden;
}

.resumen-head {
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: border-color .3s;
}

.resumen-body { padding: .8rem 1.2rem; }

.resumen-item {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color .3s;
}

.resumen-item:last-child { border-bottom: none; }
.resumen-item .rl { font-size: .7rem; color: var(--text-lo); margin-bottom: .12rem; }
.resumen-item .rv { font-size: .92rem; font-weight: 500; color: var(--text-hi); transition: color .3s; }
.resumen-item .rv.empty { color: var(--border); font-weight: 400; font-style: italic; }

/* ══════════════════════════════════════
   GRILLA SERVICIOS
══════════════════════════════════════ */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .9rem;
}

.svc-opt {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
  background: var(--bg-0);
  -webkit-tap-highlight-color: transparent;
}

.svc-opt:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.svc-opt.selected { border-color: var(--accent); background: var(--bg-1); box-shadow: 0 0 0 3px rgba(17,17,19,.07); }
[data-theme="dark"] .svc-opt.selected { box-shadow: 0 0 0 3px rgba(200,168,74,.14); }

.svc-icon { font-size: 1.7rem; }
.svc-name { font-family: 'Playfair Display', serif; font-size: .98rem; font-weight: 400; color: var(--text-hi); transition: color .3s; }
.svc-desc { font-size: .89rem; color: var(--text-lo); line-height: 1.5; }
.svc-dur  { font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-lo); background: var(--bg-2); border-radius: 999px; padding: .15rem .55rem; display: inline-block; margin-top: .2rem; transition: background .3s; }

/* ══════════════════════════════════════
   GRILLA PROFESIONALES
══════════════════════════════════════ */
.prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .9rem;
}

.prof-opt {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
  background: var(--bg-0);
  -webkit-tap-highlight-color: transparent;
}

.prof-opt:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.prof-opt.selected { border-color: var(--accent); background: var(--bg-1); box-shadow: 0 0 0 3px rgba(17,17,19,.07); }
[data-theme="dark"] .prof-opt.selected { box-shadow: 0 0 0 3px rgba(200,168,74,.14); }

.prof-ava {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin: 0 auto .75rem;
  overflow: hidden;
  transition: background .3s, border-color .3s;
}

.prof-ava img { width: 100%; height: 100%; object-fit: cover; }
.prof-opt.selected .prof-ava { border-color: var(--accent); }
.prof-name { font-family: 'Playfair Display', serif; font-size: .93rem; font-weight: 400; color: var(--text-hi); margin-bottom: .2rem; transition: color .3s; }
.prof-rol  { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: .45rem; }
.prof-hor  { font-size: .73rem; color: var(--text-lo); background: var(--bg-2); border-radius: 999px; padding: .18rem .65rem; display: inline-block; transition: background .3s; }

/* ══════════════════════════════════════
   CALENDARIO
══════════════════════════════════════ */
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }

.cal-btn {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.cal-btn:hover { border-color: var(--accent); color: var(--text-hi); }
.cal-month { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 400; color: var(--text-hi); transition: color .3s; }

.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: .3rem; }
.cal-dlabel { text-align: center; font-size: .67rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-lo); padding: .35rem 0; }

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .89rem;
  font-weight: 400;
  color: var(--text-lo);
  cursor: default;
  transition: background .15s, color .15s, border-color .15s;
  min-height: 36px;
}

.cal-day.avail { cursor: pointer; color: var(--text-hi); font-weight: 500; background: var(--bg-1); border: 1.5px solid var(--border); }
.cal-day.avail:hover { border-color: var(--accent); background: var(--bg-2); }
.cal-day.selected { background: var(--accent) !important; color: var(--accent-fg) !important; border-color: var(--accent) !important; font-weight: 700; }
.cal-day.disabled { color: var(--border); }

.cal-legend { display: flex; gap: 1.2rem; margin-top: 1rem; flex-wrap: wrap; }
.leg { display: flex; align-items: center; gap: .35rem; font-size: .73rem; color: var(--text-lo); }
.leg-dot { width: 10px; height: 10px; border-radius: 3px; }
.l-a { background: var(--bg-1); border: 1.5px solid var(--border); }
.l-s { background: var(--accent); }
.l-n { background: var(--border); }

/* ══════════════════════════════════════
   SLOTS / HORARIOS
══════════════════════════════════════ */
.slots-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.slots-header h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 400; color: var(--text-hi); transition: color .3s; }
.slots-dur { font-size: .76rem; color: var(--text-lo); background: var(--bg-2); border-radius: 999px; padding: .18rem .65rem; transition: background .3s; }
.slots-group { margin-bottom: 1.3rem; }
.slots-glabel { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-lo); display: block; margin-bottom: .6rem; }
.slots-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.slot {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .55rem 1rem;
  font-size: .96rem;
  font-weight: 500;
  color: var(--text-md);
  cursor: pointer;
  background: var(--bg-0);
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.slot:hover { border-color: var(--accent); color: var(--text-hi); }
.slot.selected { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.slot.ocupado { opacity: .3; cursor: not-allowed; text-decoration: line-through; }

/* ══════════════════════════════════════
   CONFIRMACIÓN
══════════════════════════════════════ */
.confirm-box {
  background: var(--bg-1);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.3rem;
  transition: background .3s, border-color .3s;
}

.confirm-box h3 { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-lo); margin-bottom: .9rem; }

.cf-row { display: flex; justify-content: space-between; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--border); gap: 1rem; transition: border-color .3s; }
.cf-row:last-child { border-bottom: none; }
.cf-row .lbl { font-size: .87rem; color: var(--text-lo); }
.cf-row .val { font-size: .92rem; font-weight: 500; color: var(--text-hi); text-align: right; transition: color .3s; }

.confirm-note { font-size: .91rem; color: var(--text-lo); line-height: 1.65; margin-bottom: 1.3rem; }

.btn-confirm {
  width: 100%;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: .9rem;
  border-radius: var(--radius);
  font-family: 'Lato', sans-serif;
  font-weight: 600;
  font-size: .96rem;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-confirm:hover { opacity: .85; transform: translateY(-1px); }

/* ── ÉXITO ── */
.success-box { text-align: center; padding: 2.5rem 1rem; }

.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.2rem;
}

.success-box h2 { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 400; color: var(--text-hi); margin-bottom: .5rem; transition: color .3s; }
.success-box p  { font-size: .94rem; color: var(--text-lo); line-height: 1.7; max-width: 40ch; margin: 0 auto 1.5rem; }

.btn-reset {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: .75rem 2rem;
  border-radius: 999px;
  font-family: 'Lato', sans-serif;
  font-weight: 600;
  font-size: .91rem;
  cursor: pointer;
  transition: opacity .2s;
}

.btn-reset:hover { opacity: .85; }

/* ── BOTÓN ATRÁS ── */
.btn-back-sm {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: none;
  border: none;
  color: var(--text-lo);
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  padding: 0;
  transition: color .2s;
  margin-bottom: 1.2rem;
}

.btn-back-sm:hover { color: var(--text-hi); }

/* ══════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
══════════════════════════════════════ */
@media (max-width: 700px) {
  .layout-cols { grid-template-columns: 1fr; }
  .resumen-card { display: none; }
  .card-body { padding: 1.1rem 1rem; }
  .card-head { padding: 1.1rem 1rem .9rem; }
  .step-crumb { padding: .65rem 1rem; }
  .step-label { font-size: .78rem; }
  .page { padding: 1.5rem .75rem 4rem; }
}
