@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --pista: #1c5fa5;
    --pista-oscuro: #144a83;
    --neblina: #edf1f0;
    --papel: #ffffff;
    --basalto: #1d2a33;
    --basalto-suave: #4a5a65;
    --pino: #2f6b4f;
    --pelota: #d9e021;
    --lava: #b8381f;
    --linea: #c5d0cc;
    --radio: 4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--neblina);
    color: var(--basalto);
    font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}

h1, h2, h3 {
    font-stretch: 112%;
    font-weight: 800;
    line-height: 1.12;
    margin: 0;
}

p { margin: 0 0 1em; }

a { color: var(--pista); text-underline-offset: 3px; }

:focus-visible {
    outline: 3px solid var(--pista);
    outline-offset: 2px;
}

.skip {
    position: absolute;
    left: -999px;
    top: 8px;
    background: var(--papel);
    padding: 8px 12px;
    z-index: 10;
}
.skip:focus { left: 8px; }

.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Cabecera */
.site-head { padding: 18px 0 14px; }
.site-head .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-stretch: 112%;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--basalto);
    text-decoration: none;
}
.brand-logo { height: 52px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.site-head small { color: var(--basalto-suave); font-size: .875rem; }

/* Pista: cabecera con la cuenta atrás */
.court {
    background: var(--pista);
    color: #fff;
    padding: 14px 0;
}
.court-frame {
    position: relative;
    border: 3px solid rgba(255, 255, 255, .88);
    padding: 22px 18px 0;
}
.court h1 {
    font-size: clamp(1.7rem, 5.2vw, 3rem);
    max-width: 22ch;
}
.court-lead { margin: 0 0 6px; font-size: 1rem; opacity: .92; }
.court-note { margin: 12px 0 22px; max-width: 60ch; }
.court-note strong { font-weight: 700; }

.service-line {
    margin: 0 -18px;
    border-top: 3px solid rgba(255, 255, 255, .88);
}
.countdown {
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    max-width: 640px;
}
.countdown > div { padding: 14px 4px 16px; }
.countdown > div:nth-child(3) { border-left: 3px solid rgba(255, 255, 255, .88); }
.countdown b {
    display: block;
    font-stretch: 112%;
    font-weight: 800;
    font-size: clamp(1.8rem, 7vw, 3rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.countdown span { font-size: .875rem; opacity: .92; }

.court .open-now { padding-bottom: 22px; }
.court a { color: #fff; }
.court :focus-visible { outline-color: var(--pelota); }

/* Navegación de semanas */
.weeknav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 0 6px;
    margin: 0;
    list-style: none;
}
.weeknav a {
    display: block;
    padding: 9px 14px;
    border: 2px solid var(--pista);
    border-radius: var(--radio);
    color: var(--pista);
    font-weight: 600;
    text-decoration: none;
    background: var(--papel);
}
.weeknav a[aria-current="page"] {
    background: var(--pista);
    color: #fff;
}
.weeknav small { display: block; font-weight: 400; font-size: .8125rem; }

.week-title { font-size: 1.25rem; margin: 18px 0 4px; }
.week-help { color: var(--basalto-suave); margin-bottom: 18px; max-width: 70ch; }

/* Semana */
.week {
    display: grid;
    gap: 14px;
    margin: 0 0 32px;
}
.day h3 {
    font-size: 1.05rem;
    font-stretch: 105%;
    padding: 0 0 8px;
    border-bottom: 3px solid var(--basalto);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    text-transform: capitalize;
}
.day h3 span { font-weight: 500; text-transform: none; color: var(--basalto-suave); }
.day.is-today h3 { border-bottom-color: var(--pista); }

.slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
    padding: 6px 8px;
    border: 2px solid var(--linea);
    border-radius: var(--radio);
    background: var(--papel);
    color: var(--basalto);
    text-decoration: none;
    font-size: .9375rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}
.slot b { font-weight: 700; }
.slot small { font-size: .75rem; }

a.slot.is-available {
    border-color: var(--pista);
    color: var(--pista);
}
a.slot.is-available:hover,
a.slot.is-available:focus-visible {
    background: var(--pista);
    color: #fff;
}
a.slot.is-available:focus-visible { outline-color: var(--basalto); }

.slot.is-booked {
    background: repeating-linear-gradient(135deg, #e2e8e5, #e2e8e5 6px, #d6ded9 6px, #d6ded9 12px);
    color: var(--basalto-suave);
}
.slot.is-blocked {
    border-color: var(--lava);
    color: var(--lava);
    background: var(--papel);
}
.slot.is-closed { border-style: dashed; color: var(--basalto-suave); background: transparent; }
.slot.is-past { opacity: .5; background: transparent; }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    font-size: .875rem;
    color: var(--basalto-suave);
}
.legend i {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: -2px;
    border: 2px solid var(--linea);
    border-radius: 2px;
}
.legend .l-available { border-color: var(--pista); }
.legend .l-booked { background: #d6ded9; }
.legend .l-blocked { border-color: var(--lava); }
.legend .l-closed { border-style: dashed; }

@media (min-width: 560px) {
    .slots { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
    .week { grid-template-columns: repeat(7, 1fr); gap: 10px; }
    .slots { grid-template-columns: 1fr; }
    .day h3 { flex-direction: column; gap: 0; }
    .slot { min-height: 52px; }
}

/* Formulario y páginas de texto */
.panel {
    background: var(--papel);
    border: 2px solid var(--linea);
    border-radius: var(--radio);
    padding: 22px 18px;
    max-width: 640px;
    margin: 26px 0 40px;
}
.panel h1 { font-size: 1.6rem; margin-bottom: 10px; }

.summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 16px;
    margin: 0 0 22px;
    padding: 14px 16px;
    border-left: 6px solid var(--pista);
    background: var(--neblina);
}
.summary dt { color: var(--basalto-suave); }
.summary dd { margin: 0; font-weight: 600; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field input[type="search"],
.field input[type="date"],
.field input[type="time"],
.field textarea,
.field select {
    width: 100%;
    padding: 11px 12px;
    font: inherit;
    border: 2px solid var(--basalto-suave);
    border-radius: var(--radio);
    background: #fff;
    color: var(--basalto);
}
.field textarea { resize: vertical; font-family: inherit; }
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible { outline: 3px solid var(--pista); outline-offset: 1px; }
.field .hint { color: var(--basalto-suave); font-size: .875rem; margin-top: 4px; }
.field.has-error input { border-color: var(--lava); }
.field .error { color: var(--lava); font-size: .9375rem; margin-top: 4px; font-weight: 600; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
    display: inline-block;
    padding: 12px 20px;
    font: inherit;
    font-weight: 700;
    border: 2px solid var(--pista);
    border-radius: var(--radio);
    background: var(--pista);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--pista-oscuro); border-color: var(--pista-oscuro); }
.btn.secondary { background: transparent; color: var(--pista); }
.btn.secondary:hover { background: var(--pista); color: #fff; }
.btn.danger { background: var(--lava); border-color: var(--lava); }
.btn.danger:hover { background: #962d18; border-color: #962d18; }
.btn.small { padding: 6px 10px; font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.notice {
    padding: 12px 14px;
    border-radius: var(--radio);
    margin: 18px 0;
    border: 2px solid var(--pino);
    background: #e6f1ea;
}
.notice.error { border-color: var(--lava); background: #fbebe7; }

.ok-mark {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radio);
    background: var(--pino);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Normas y pie */
.rules { margin: 8px 0 40px; max-width: 760px; }
.rules summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.rules ul { margin: 8px 0 0; padding-left: 1.2em; }
.rules li { margin-bottom: 6px; }

.site-foot {
    border-top: 3px solid var(--basalto);
    padding: 22px 0 36px;
    font-size: .9375rem;
    color: var(--basalto-suave);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.site-foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Código de la puerta */
.door-code {
    display: grid;
    gap: 4px;
    margin: 0 0 22px;
    padding: 16px;
    text-align: center;
    border: 3px solid var(--pista);
    border-radius: var(--radio);
    background: #f3f8fd;
}
.door-label { color: var(--basalto-suave); font-size: .9375rem; }
.door-value {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    letter-spacing: .18em;
    line-height: 1.2;
    word-break: break-all;
}
.door-help { font-size: .9375rem; max-width: 46ch; margin: 4px auto 0; }

/* Cabecera con foto de la pista */
.court-frame.has-photo { padding: 0; display: grid; grid-template-columns: 1fr; }
.court-photo { margin: 0; overflow: hidden; background: #0f3a66; border-bottom: 3px solid rgba(255, 255, 255, .88); }
.court-photo img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.court-frame.has-photo .court-info { padding: 22px 18px 0; }
.court-frame.has-photo .service-line { margin: 0 -18px; }

@media (min-width: 900px) {
    .court-frame.has-photo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
    .court-frame.has-photo .court-photo {
        order: 2;
        border-bottom: 0;
        border-left: 3px solid rgba(255, 255, 255, .88);
    }
    .court-frame.has-photo .court-photo img { aspect-ratio: auto; min-height: 100%; }
    .court-frame.has-photo .court-info { order: 1; padding: 30px 28px 0; display: flex; flex-direction: column; }
    .court-frame.has-photo .service-line { margin: auto -28px 0; }
    .court-frame.has-photo .court-note { margin-bottom: 28px; }
}

/* Galería */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radio); }

/* Logos del pie */
.foot-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 18px 36px;
    margin: 0 auto 22px;
    padding: 0 16px 22px;
    max-width: 1180px;
    list-style: none;
    border-bottom: 1px solid var(--linea);
}
.foot-logos img { display: block; height: 56px; width: auto; max-width: 180px; object-fit: contain; }

.rules-notice{margin:20px 0 4px;padding:14px 18px;background:#fff;border:2px solid var(--pista);border-left-width:8px;border-radius:6px}
.rules-notice p{margin:0;font-size:.97rem;line-height:1.5}
.rules-notice p+p{margin-top:8px}
