/* =========================================================
   Página de reserva (reservar.php)
   Móvil: una columna. Escritorio: el calendario acompaña al
   formulario en dos columnas.
   ========================================================= */

/* ---------- Cabecera ---------- */

.r-hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

.r-hero__titulo {
  margin: 1.25rem 0 0;
  font-family: Vitesse, Georgia, serif;
  font-size: clamp(2.25rem, 8vw, 3.25rem);
  line-height: 0.98;
  font-weight: 900;
}

.r-hero__entradilla {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.r-hero__otros {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.r-hero__otros a {
  margin-left: 0.5rem;
  font-weight: 600;
}

@media (min-width: 900px) {
  .r-hero {
    padding: 4rem 2rem 2.5rem;
  }
}

/* ---------- Dos columnas ---------- */

.r-panel {
  display: grid;
  gap: 2rem;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

@media (min-width: 900px) {
  .r-panel {
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
    padding: 0 2rem 6rem;
  }

  /* El calendario acompaña mientras se rellena el formulario. */
  .r-columna--cal {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}

.r-cal {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.r-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.r-cal__mes {
  margin: 0;
  font-family: Vitesse, Georgia, serif;
  font-size: 1.35rem;
  text-transform: capitalize;
}

.r-cal__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
}

.r-cal__nav svg {
  width: 20px;
  height: 20px;
}

.r-cal__nav.is-oculto {
  visibility: hidden;
}

.r-cal__semana,
.r-cal__rejilla {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.r-cal__semana {
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.r-dia {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: color-mix(in srgb, var(--navy) 35%, var(--white));
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.r-dia.is-vacio {
  border: 0;
  background: none;
}

/* Solo los días con sesión son enlaces */
a.r-dia.is-abierto {
  border-color: color-mix(in srgb, var(--navy) 45%, var(--white));
  background: color-mix(in srgb, var(--cyan) 14%, var(--white));
  color: var(--navy);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

a.r-dia.is-abierto:hover,
a.r-dia.is-abierto:focus-visible {
  background: color-mix(in srgb, var(--cyan) 28%, var(--white));
}

a.r-dia.is-elegido {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.r-dia__nota {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #f5a623;
}

/* Día cerrado con aviso: se distingue de un día cerrado sin más, pero sin
   parecer reservable. */
.r-dia.is-avisado {
  border-style: dashed;
  border-color: color-mix(in srgb, #f5a623 55%, var(--line));
}

.r-dia__nota.is-cerrado {
  background: color-mix(in srgb, #f5a623 65%, var(--white));
}

.r-cal__leyenda {
  display: flex;
  gap: 1.25rem;
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.r-punto {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  vertical-align: -1px;
}

.r-punto.is-abierto {
  border-color: color-mix(in srgb, var(--navy) 45%, var(--white));
  background: color-mix(in srgb, var(--cyan) 20%, var(--white));
}

/* Calendario sin un solo día publicado. */
.r-cal__sindias {
  margin: 1.25rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.r-punto.is-nota {
  width: 8px;
  height: 8px;
  border-color: #d18b12;
  border-radius: 50%;
  background: #f5a623;
  vertical-align: 0;
}

/* Los avisos escritos, debajo del calendario. El punto de cada día dice que
   hay algo; esto es lo que dice qué. */
.r-avisos {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.r-avisos__titulo {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.r-avisos__lista {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.r-aviso {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.85rem;
  line-height: 1.5;
}

.r-aviso__dia {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.r-aviso.is-cerrado .r-aviso__dia {
  color: var(--muted);
}

/* Los días cerrados no se pueden pinchar, así que el motivo se etiqueta aquí. */
.r-aviso__marca {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 5px;
  background: var(--surface-strong, color-mix(in srgb, var(--navy) 8%, var(--white)));
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: 1px;
}

/* ---------- Formulario ---------- */

.r-form {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* Estado sin día elegido: en vez de un hueco, se explica el proceso. */
.r-pasos {
  padding: 1.75rem;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
}

.r-pasos__titulo {
  margin: 0 0 1.5rem;
  font-family: Vitesse, Georgia, serif;
  font-size: 1.25rem;
}

/* Solo aparece cuando el día elegido se ha cerrado mientras se rellenaba. */
.r-pasos__guardado {
  margin: -1rem 0 1.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, #f5a623 18%, var(--white));
  font-size: 0.85rem;
}

.r-pasos__lista {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.r-pasos__lista li {
  position: relative;
  display: grid;
  gap: 0.2rem;
  padding-left: 2.5rem;
  counter-increment: paso;
}

.r-pasos__lista li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: -0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
}

.r-pasos__lista b {
  font-size: 0.95rem;
}

.r-pasos__lista span {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}

.r-pasos__pie {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
}

.r-form__fecha {
  margin: 0 0 0.35rem;
  font-family: Vitesse, Georgia, serif;
  font-size: 1.6rem;
}

.r-form__fecha::first-letter {
  text-transform: uppercase;
}

.r-form__nota {
  margin: 0 0 1.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, #f5a623 18%, var(--white));
  font-size: 0.85rem;
}

.r-campos {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Tablet: dos columnas. */
@media (min-width: 560px) {
  .r-campos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .r-campo--ancho {
    grid-column: 1 / -1;
  }
}

/* Escritorio: rejilla de seis para poner deporte, personas y nivel en una
   misma fila, y teléfono y correo a mitades. */
@media (min-width: 900px) {
  .r-campos {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem 1.25rem;
  }

  .r-campo--deporte,
  .r-campo--personas,
  .r-campo--nivel {
    grid-column: span 2;
  }

  .r-campo--tel,
  .r-campo--email {
    grid-column: span 3;
  }
}

.r-campo {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.r-campo label {
  font-size: 0.8rem;
  font-weight: 600;
}

.r-opcional {
  font-weight: 400;
  color: var(--muted);
}

/* Input, select y textarea con el mismo tratamiento: si no, el select se queda
   con el aspecto del navegador y rompe la fila. */
.r-campo input,
.r-campo select,
.r-campo textarea {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 0 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.r-campo textarea {
  height: auto;
  padding: 0.75rem 0.9rem;
  resize: vertical;
}

.r-campo input:hover,
.r-campo select:hover,
.r-campo textarea:hover {
  border-color: color-mix(in srgb, var(--navy) 45%, var(--white));
}

.r-campo input:focus,
.r-campo select:focus,
.r-campo textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 30%, transparent);
  outline: none;
}

.r-campo input::placeholder {
  color: color-mix(in srgb, var(--navy) 35%, var(--white));
}

/* Flecha propia en lugar de la del sistema. */
.r-campo select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23084771' stroke-width='1.8' stroke-linecap='square'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 16px;
  cursor: pointer;
}

/* Un <button> con .rate-btn hereda el borde del navegador. */
.r-enviar button.rate-btn {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.r-campo--menores {
  margin-top: 1rem;
}

.r-campo--menores.is-oculto {
  display: none;
}

/* Los campos sueltos fuera de la rejilla necesitan su propio aire. */
.r-form > .r-campo--ancho {
  margin-top: 1.25rem;
}

.r-check {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;          /* zona táctil cómoda en el móvil */
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.r-check label {
  cursor: pointer;
}

.r-check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--navy);
  cursor: pointer;
}

.r-check--legal {
  align-items: flex-start;
}

.r-check--legal {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

/* El campo trampa no se ve ni se tabula, pero no está display:none:
   algunos robots ignoran los ocultos de esa forma. */
.r-trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.r-enviar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

.r-aviso {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.r-errores {
  grid-column: 1 / -1;
  margin: 0 0 0.5rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: color-mix(in srgb, #b4442e 12%, var(--white));
  color: #8c3524;
  font-size: 0.9rem;
}

/* site.css quita las viñetas de las listas: aquí hacen falta. */
.r-errores ul {
  display: grid;
  gap: 0.3rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.r-errores li {
  position: relative;
  padding-left: 1.1rem;
  line-height: 1.5;
}

.r-errores li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0.15rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.r-errores {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* Recibe el foco al saltar desde el envío; el anillo del navegador sobra
   porque el bloque ya se anuncia solo con role="alert". */
.r-errores:focus {
  outline: none;
}

/* ---------- Confirmación ---------- */

.r-exito {
  max-width: 34rem;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.r-exito__marca {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cyan) 22%, var(--white));
  color: var(--ink);
}

.r-exito p:last-child {
  justify-content: center;
}

/* ---------- Deportes por día ---------- */

/* Un día abierto de otro deporte se ve igual que uno cerrado: hay que contarlo
   o parece que el centro no abre. */
.r-cal__otros {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.r-form__solo {
  margin: 0 0 1.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cyan) 12%, var(--white));
  font-size: 0.85rem;
}
