/* =====================================================================
   COLORES DEL COLEGIO — cambia aquí para ajustar toda la web
   ===================================================================== */
:root {
  --brand: #d42a20;        /* rojo del uniforme (chándal, jersey) */
  --brand-dark: #a81d15;
  --brand-soft: #fdeceb;
  --accent: #5d6168;       /* gris del uniforme (pantalón, cuello) */
  --accent-soft: #eef0f3;
  --sky: #4f86c6;          /* azul claro del baby */

  --ok: #1e8a5a;
  --ok-soft: #e3f4ec;
  --danger: #8f1d14;
  --danger-soft: #f6e3e1;

  --ink: #26282c;
  --muted: #62666e;
  --line: #e2e4e8;
  --bg: #f5f5f6;
  --card: #ffffff;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 40, 45, .06), 0 6px 20px rgba(40, 40, 45, .06);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ Header */
.hero {
  background: var(--brand);
  color: #fff;
  padding: 28px 16px 72px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 10px;
  background: linear-gradient(var(--accent) 0 6px, #fff 6px 10px);
}
.hero-inner { max-width: 880px; margin: 0 auto; display: flex; gap: 16px; align-items: center; }
.logo {
  flex: none; width: 56px; height: 56px; border-radius: 16px;
  background: #fff; color: var(--brand);
  display: grid; place-items: center; font-weight: 900; font-size: 20px; letter-spacing: -.5px;
}
.hero small { display: block; opacity: .8; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.hero h1 { margin: 2px 0 0; font-size: clamp(24px, 5vw, 34px); line-height: 1.15; font-weight: 900; }

main { max-width: 880px; margin: -48px auto 40px; padding: 0 16px; position: relative; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.card .sub { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.step {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 800; flex: none;
}

/* ------------------------------------------------------------ Info */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.info { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.info span { display: block; font-size: 12px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.info strong { font-size: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.abierta { background: var(--ok-soft); color: var(--ok); }
.pill.cerrada, .pill.sin_configurar { background: var(--danger-soft); color: var(--danger); }
.pill.no_iniciada { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------ Slots */
.slots-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; border: 2px solid var(--line); }
.legend .l-free { background: #fff; border-color: var(--brand); }
.legend .l-sel { background: var(--brand); border-color: var(--brand); }
.legend .l-busy { background: #eceff4; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.slot {
  border: 2px solid var(--brand); background: #fff; color: var(--brand);
  border-radius: 10px; padding: 10px 4px; font-weight: 800; font-size: 16px;
  cursor: pointer; transition: transform .08s, background .15s, color .15s;
  font-variant-numeric: tabular-nums;
}
.slot:hover:not(:disabled) { background: var(--brand-soft); }
.slot:active:not(:disabled) { transform: scale(.96); }
.slot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.slot.selected { background: var(--brand); color: #fff; box-shadow: 0 0 0 3px var(--accent); }
.slot:disabled { border-color: var(--line); background: #eceff4; color: #9aa3b5; cursor: not-allowed; text-decoration: line-through; }
.slot.blocked:disabled { text-decoration: none; opacity: .6; }

.counter { font-size: 14px; color: var(--muted); }
.counter b { color: var(--ink); }

/* ------------------------------------------------------------ Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 14px; }
.field input, .field select {
  border: 2px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff;
  min-height: 46px; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.check.full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }

.selected-banner {
  display: flex; align-items: center; gap: 10px; background: var(--accent-soft);
  border: 2px dashed var(--accent); border-radius: 12px; color: var(--accent); padding: 10px 14px; margin-bottom: 16px; font-weight: 700;
}
.selected-banner b { font-size: 20px; color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 22px; font-weight: 800; font-size: 16px;
  background: var(--brand); color: #fff; cursor: pointer; min-height: 48px; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.accent { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-dark); }
.btn.accent:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: 14px; border-radius: 9px; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }

.alert { border-radius: 12px; padding: 12px 14px; font-weight: 600; margin-bottom: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: #fff4dc; color: #7a5800; }

fieldset.socio { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.socio legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 12px;
  border: 2px solid var(--line); border-radius: 10px; font-weight: 700; text-align: center; background: #fff;
}
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }

/* ------------------------------------------------------------ Gracias */
.thanks { text-align: center; padding: 34px 22px; }
.thanks .big {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok);
}
.thanks h2 { justify-content: center; font-size: 26px; }
.ticket {
  max-width: 420px; margin: 18px auto; text-align: left; border: 2px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
.ticket .t-head { background: var(--brand); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; }
.ticket .t-head b { font-size: 30px; color: #fff; }
.ticket dl { margin: 0; padding: 12px 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.ticket dt { color: var(--muted); font-size: 14px; }
.ticket dd { margin: 0; font-weight: 700; }

.state-msg { text-align: center; padding: 34px 22px; }
.state-msg .emoji { font-size: 42px; }

.demo-bar { background: var(--sky); color: #fff; text-align: center; font-size: 14px; font-weight: 700; padding: 8px 16px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px 30px; }
footer a { color: var(--muted); }

.spinner { width: 22px; height: 22px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); padding: 30px; }

/* ------------------------------------------------------------ Admin */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.slot.admin { font-size: 15px; }
.slot.admin.off { border-style: dashed; border-color: var(--danger); color: var(--danger); background: var(--danger-soft); text-decoration: line-through; }
.slot.admin.booked { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); cursor: default; text-decoration: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--accent-soft); color: var(--ink); font-weight: 800; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--ink); }
td.hora { font-weight: 800; font-variant-numeric: tabular-nums; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--accent-soft); border-radius: 12px; padding: 10px 16px; min-width: 110px; }
.stat b { display: block; font-size: 24px; color: var(--brand); line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.login { max-width: 420px; margin: 0 auto; }

@media (max-width: 600px) {
  .card { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .hero { padding-bottom: 66px; }
  .logo { width: 48px; height: 48px; font-size: 17px; }
}
