/* Estilos de la agenda: /reservar/ y la página de cada cita (/cita/…). Mismo aspecto que la landing */

/* Archivo autoalojada (licencia OFL): fuente variable de ancho y peso */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 900; font-stretch: 62% 125%; font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
}
:root {
  --slate: #294d6b;
  --slate-soft: #e6edf3;
  --night: #15283a;
  --paper: #f5f7f6;
  --white: #ffffff;
  --saffron: #f0a630;
  --saffron-deep: #c97f0c;
  --line: #d3dbe1;
  --muted: #52646f;
  --error: #b42318;
  --saffron-ink: #9a5c06;
  --saffron-hover: #f5b44c;
  --radius-s: 8px;
  --radius-l: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: "Archivo", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.6;
  color: var(--night); background: var(--white); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--slate); outline-offset: 3px; border-radius: 4px; }
h1:focus, h2:focus { outline: none; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 560px; }
.center { text-align: center; }
main { flex: 1; }

.top .wrap { position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; }
.top img { height: 38px; width: auto; }
.back { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; min-height: 44px; color: var(--slate); font-weight: 700; font-size: .95rem; text-decoration: none; }
.back:hover { text-decoration: underline; text-underline-offset: 4px; }

.intro { text-align: center; padding-top: 20px; padding-bottom: 8px; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.08; font-variation-settings: "wdth" 120; letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; font-size: 1.25rem; font-weight: 800; }
.promise { margin: 10px 0 0; color: var(--muted); }
.lead { color: var(--muted); font-size: 1.08rem; margin: 14px 0 24px; }
.hint { color: var(--muted); font-size: .95rem; margin: 10px 0 0; overflow-wrap: anywhere; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px;
  border: 0; border-radius: var(--radius-s); background: var(--saffron); color: var(--night);
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: inset 0 -3px 0 var(--saffron-deep);
}
.btn:hover { background: var(--saffron-hover); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn.block { width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white); color: var(--slate);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--slate); }
.btn-ghost.danger { color: var(--error); }
.btn-ghost.danger:hover { border-color: var(--error); }
.link { padding: 0; border: 0; background: none; color: var(--slate); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.privacy { max-width: 640px; margin: 24px auto 40px; padding: 0 20px; text-align: center; color: var(--muted); font-size: .9rem; }

footer.site { background: var(--night); color: #a9b9c5; padding: 24px 0; font-size: .9rem; }
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer.site a { display: inline-block; padding: 12px 0; margin: -12px 0; }
footer.site a:hover { color: var(--white); }
/* Sobre fondo oscuro el anillo de foco va en blanco: slate sobre night no se ve */
footer.site :focus-visible { outline-color: #fff; }

/* --- Selector de día y hora --- */
.picker { max-width: 560px; margin: 16px auto 0; }
.notice { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-s); background: #fdf1dc; color: var(--night); }
.soonest { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 16px; color: var(--muted); font-size: .98rem; }
.soonest .link { min-height: 44px; }

.days {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px; margin: 0 -2px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  /* Difumina el borde derecho para que se note que hay más días al deslizar */
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}
.day {
  flex: 0 0 auto; scroll-snap-align: start; display: grid; justify-items: center; gap: 0; min-width: 64px; min-height: 72px; padding: 8px 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--night); font: inherit; cursor: pointer;
}
.day .dow { font-size: .8rem; color: var(--muted); text-transform: capitalize; }
.day .num { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.day .mon { font-size: .75rem; color: var(--muted); }
.day:hover { border-color: var(--slate); }
.day[aria-checked="true"] { background: var(--slate); border-color: var(--slate); color: var(--white); }
.day[aria-checked="true"] .dow, .day[aria-checked="true"] .mon { color: #d7e2ec; }

.times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0; }
.time {
  min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white);
  color: var(--slate); font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.time:hover { border-color: var(--slate); background: var(--slate-soft); }
.time[aria-checked="true"] { background: var(--slate); border-color: var(--slate); color: var(--white); }
.zone { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: .92rem; }

.skeleton .day, .skeleton .time { border-color: transparent; background: var(--slate-soft); cursor: default; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .skeleton .day, .skeleton .time { animation: none; } }

.empty { padding: 24px 0; text-align: center; }
.empty p { margin: 0 0 16px; }

/* --- Datos --- */
.summary { margin: 0 0 24px; padding: 16px 18px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.summary p { margin: 0; }
.summary-when { font-weight: 800; font-size: 1.1rem; }
.summary-when::first-letter { text-transform: uppercase; }
.summary-meta { color: var(--muted); font-size: .95rem; }
.summary .link { margin-top: 6px; min-height: 32px; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input {
  width: 100%; min-height: 50px; padding: 10px 14px; border: 1px solid #9fb0bd; border-radius: var(--radius-s);
  font: inherit; font-size: 1rem; color: var(--night); background: var(--white);
}
.field input:focus { border-color: var(--slate); outline: 3px solid rgba(41, 77, 107, .25); outline-offset: 0; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field .err { color: var(--error); font-size: .92rem; }
.field .suggest { font-size: .92rem; color: var(--muted); }
.form-error { margin: 0; padding: 12px 16px; border-radius: var(--radius-s); background: #fdecea; color: var(--error); }
.form .privacy { margin: 0; padding: 0; text-align: left; }
.turnstile:empty { display: none; }

/* --- Página de la cita --- */
#cita { padding: 32px 20px 56px; }
#cita h1 { margin-bottom: 20px; }
#cita .btn { margin-top: 4px; }
.manage { margin: 36px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
.manage-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#picker-section { margin: 28px 0 0; }
.confirm-cancel, .confirm-move { margin: 20px 0 0; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.confirm-cancel p, .confirm-move p { margin: 0 0 12px; }
.confirm-cancel .btn-ghost, .confirm-move .btn-ghost { margin: 4px 8px 0 0; }
.status { min-height: 1.6em; margin: 16px 0 0; font-weight: 700; }

@media (max-width: 700px) {
  .top .wrap { min-height: 56px; }
  .top img { height: 30px; }
  .back { left: 12px; }
  .intro { padding-top: 12px; }
}

/* --- Propuesta de UX --- */
h1 { text-wrap: balance; }
.day, .time, .btn, .btn-ghost, .link { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.day .num, .time { font-variant-numeric: tabular-nums; }
.night { margin: 10px 0 0; text-align: center; font-size: .95rem; color: var(--muted); }
.night .link { min-height: 44px; }
.night-note { margin: 0; }
.time.is-night { border-style: dashed; }
.current { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-s); background: var(--slate-soft); }
.current::first-letter { text-transform: uppercase; }
.host { display: flex; align-items: center; justify-content: safe center; gap: 12px; margin: 12px 0 0; }
.host img { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.host p { min-width: 0; margin: 0; color: var(--muted); text-align: left; line-height: 1.35; }
.host strong { color: var(--night); display: block; }
.status:empty { display: none; }
.status.ok { padding: 12px 16px; border-radius: var(--radius-s); background: #e7f4ec; color: #1d5b36; font-weight: 600; }
.summary .status { margin: 12px 0 0; }
.summary-zone { color: var(--muted); font-size: .95rem; }
.cancelled .summary-when { text-decoration: line-through; color: var(--muted); }
.confirm-move .actions, .picker-close { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
@media (min-width: 700px) {
  .days { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; mask-image: none; padding: 4px 0 10px; margin: 0; }
  .day { min-width: 0; }
}
.day.all-night { border-style: dashed; background: var(--paper); }
.day.all-night .num { color: var(--muted); }
.day.all-night[aria-checked="true"] { border-style: solid; background: var(--slate); }
.day.all-night[aria-checked="true"] .num { color: var(--white); }
