/* Archivo (Omnibus-Type, Buenos Aires). OFL, servida desde /fonts. Eje de ancho 62-125%. */
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url("/fonts/archivo-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Base: blanco esmaltado, tinta casi negra, gris azulejo para superficies. */
    --color-text: #14171a;
    --color-muted: #4b555d;
    --color-bg: #ffffff;
    --color-surface: #eef2f4;
    --color-surface-strong: #dde4e8;
    --color-sign: #14171a;
    --color-field: #6b767e;
    --color-link: #14171a;
    --color-error: #b42318;
    --color-error-soft: #fde7e5;
    --color-warning-bg: #fff1cc;
    --color-warning-text: #5a3b00;

    /* Color de línea del negocio. El layout lo pisa con el del negocio. */
    --line: #1c5d99;
    --on-line: #ffffff;

    --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

a {
    color: var(--color-link);
}

.error {
    text-align: center;
    padding-top: 4rem;
}

.error p {
    color: var(--color-muted);
}

/* ---------- Página pública de reserva ---------- */

body.public {
    font-family: var(--font);
    font-size: 17px;
    font-variant-numeric: tabular-nums;
    background: var(--color-bg);
    accent-color: var(--line);
    caret-color: var(--line);
}

.public ::selection {
    background: var(--line);
    color: var(--on-line);
}

.page {
    max-width: 560px;
    padding: 0 16px 48px;
    transition: opacity 0.2s var(--ease-out);
}

.page[aria-busy="true"] {
    opacity: 0.55;
}

.public img {
    display: block;
    max-width: 100%;
}

/* :where() deja la especificidad en 0,1,0: las clases de cada título pueden poner su margen. */
.public :where(h1, h2, h3) {
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.public :focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 3px;
}

.public a {
    text-underline-offset: 0.18em;
    text-decoration-thickness: 2px;
}

.muted {
    color: var(--color-muted);
}

/* Portada y logo */
.hero {
    position: relative;
    margin: 0 -16px 8px;
}

.hero__cover {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}

/* Cartel de azulejos: círculo de línea y nombre, montado sobre el borde de la portada. */
.sign {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: -48px 16px 0;
    padding: 16px;
    background-color: var(--color-sign);
    /* Juntas de azulejo: un dibujo SVG, no un degradé. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24'%3E%3Cpath d='M0 23.5h48M47.5 0v24' stroke='%23ffffff' stroke-opacity='.07'/%3E%3C/svg%3E");
    color: #ffffff;
}

.hero--plain .sign {
    margin-top: 16px;
}

/* Círculo de línea: siempre del color de la línea; el logo va adentro de un aro de ese color. */
.line-circle {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    border-radius: 50%;
    background: var(--line);
    color: var(--on-line);
    font-weight: 800;
}

.line-circle--lg {
    width: 68px;
    height: 68px;
    padding: 6px;
    font-size: 1.875rem;
}

.line-circle--sm {
    width: 44px;
    height: 44px;
    padding: 5px;
    font-size: 1.125rem;
}

.line-circle__logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.line-circle__initial {
    line-height: 1;
}

.sign__text {
    min-width: 0;
}

.sign__name {
    font-size: 2rem;
    font-weight: 800;
    font-stretch: 75%;
    line-height: 1;
    overflow-wrap: anywhere;
}

.sign__meta {
    margin: 6px 0 0;
    color: #c9d1d6;
    font-size: 0.9375rem;
}

.sign__status,
.sign__address {
    display: block;
}

.sign__status {
    color: #ffffff;
    font-weight: 700;
}

/* Cerrado: mismo gris que la dirección, sin competir con el nombre. */
.sign__status--closed {
    color: inherit;
    font-weight: 600;
}

/* Encabezado compacto en los pasos 2 a 4. */
.brand {
    padding-top: 12px;
}

.brand__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    color: var(--color-text);
    font-weight: 800;
    font-stretch: 85%;
    font-size: 1.125rem;
    text-decoration: none;
}

/* Recorrido de la reserva como línea de Subte. */
.route {
    margin: 20px 0 16px;
}

.route__line {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
    padding: 0;
    list-style: none;
}

.route__station {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 8px;
    color: var(--color-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

/* Tramo de vía hacia la estación anterior: 6px, gris si falta recorrerlo, color de línea si ya se hizo. */
.route__station + .route__station::before {
    content: "";
    position: absolute;
    top: 11px;
    right: 50%;
    left: -50%;
    height: 6px;
    background: var(--color-surface-strong);
}

.route__station.is-done::before,
.route__station.is-current::before {
    background: var(--line);
}

.route__dot {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    padding: 3px;
    border-radius: 50%;
    background-clip: content-box;
    background-color: var(--color-bg);
    box-sizing: border-box;
}

/* Estación por venir: anillo gris. */
.route__station.is-next .route__dot {
    border: 6px solid var(--color-surface-strong);
    padding: 0;
    margin: 0;
    width: 28px;
    height: 28px;
    background: var(--color-bg);
}

/* Estación hecha: punto lleno del color de la línea. */
.route__station.is-done .route__dot {
    padding: 4px;
    background-color: var(--line);
}

.route__station.is-current {
    color: var(--color-text);
    font-weight: 800;
}

/* Estación actual: punto lleno con aro, como un círculo de línea. */
.route__station.is-current .route__dot {
    padding: 0;
    border: 4px solid var(--color-bg);
    outline: 3px solid var(--line);
    background-clip: border-box;
    background-color: var(--line);
    animation: station-arrive 0.5s var(--ease-out) both;
}

@keyframes station-arrive {
    from {
        transform: scale(0.4);
    }

    to {
        transform: scale(1);
    }
}

.credit {
    padding: 24px 16px 32px;
    color: var(--color-muted);
    font-size: 0.875rem;
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px; /* taste-skill-ignore: elemento oculto, no es una línea */
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Secciones */
.section {
    margin-top: 40px;
}

.section__title {
    margin-bottom: 14px;
    font-size: 1.375rem;
    font-weight: 800;
    font-stretch: 85%;
    text-wrap: balance;
}

.card {
    padding: 20px;
    background: var(--color-surface);
}

.welcome {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.welcome__hello {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Servicios */
.services {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.service {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 84px;
    padding: 14px 16px;
    background: var(--color-surface);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.service:hover {
    background: var(--color-surface-strong);
}

.service:active {
    transform: scale(0.985);
}

.service__photo {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.service__body {
    display: grid;
    flex: 1;
    gap: 2px;
    min-width: 0;
}

.service__name {
    font-size: 1.1875rem;
    font-weight: 700;
}

.service__meta,
.service__description {
    color: var(--color-muted);
}

.service__description {
    font-size: 0.9375rem;
}

.service__price {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 1.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Perfil */
.about,
.address {
    margin: 0 0 12px;
}

.gallery {
    display: flex;
    gap: 6px;
    margin: 0 -16px;
    padding: 0 16px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    scrollbar-color: var(--color-field) transparent;
}

.gallery__photo {
    flex-shrink: 0;
    width: 80%;
    max-width: 360px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    scroll-snap-align: start;
}

.hours {
    display: grid;
    gap: 4px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.map {
    display: block;
    width: 100%;
    height: 220px;
    margin-bottom: 12px;
    border: 0;
    background: var(--color-surface);
}

/* Botones y links */
.button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 24px;
    border: 0;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.button:active {
    transform: scale(0.98);
}

.button--primary {
    background: var(--line);
    color: var(--on-line);
}

.button--primary:hover {
    background: color-mix(in srgb, var(--line) 82%, #000);
}

.button--ghost {
    background: var(--color-surface);
    color: var(--color-text);
}

.button--ghost:hover {
    background: var(--color-surface-strong);
}

.button--block {
    width: 100%;
}

.button[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.actions {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}

.link {
    color: var(--color-text);
    font-weight: 700;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 48px;
    margin-top: 8px;
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
}

/* Avisos */
.notice {
    margin: 16px 0;
    padding: 16px;
    background: var(--color-surface);
}

.notice--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.notice p {
    margin: 0 0 8px;
}

.notice p:last-child {
    margin-bottom: 0;
}

/* Pasos */
.step-title {
    margin: 8px 0 6px;
    font-size: 2rem;
    font-weight: 800;
    font-stretch: 80%;
    text-wrap: balance;
}

/* En la confirmación no hay link de volver: el título toma el mismo aire que ese link da en los pasos 2 y 3. */
.route + .step-title {
    margin-top: 40px;
}

.step-summary {
    margin: 0 0 20px;
    color: var(--color-muted);
}

.days {
    display: flex;
    gap: 6px;
    margin: 0 -16px 16px;
    padding: 4px 16px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    scrollbar-color: var(--color-field) transparent;
}

.day {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 56px;
    padding: 0 12px;
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
    scroll-snap-align: start;
}

.day.is-selected {
    background: var(--line);
    color: var(--on-line);
}

.day.is-disabled {
    background: transparent;
    color: var(--color-muted);
    font-weight: 500;
}

/* Ayuda discreta debajo del resumen del paso. */
.help {
    margin: -20px 0 8px;
    font-size: 0.9375rem;
}

/* Área tocable de 48px sin cambiar cómo se ve el link. */
.help__link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    color: var(--color-muted);
    font-weight: 600;
}

/* Atajo al primer horario libre: la acción principal del paso. */
.first-free {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    min-height: 64px;
    /* Separado de la tira de días: es otra cosa (un atajo), no el día elegido. */
    margin: 0 0 32px;
    padding: 14px 18px;
    background: var(--line);
    color: var(--on-line);
    text-decoration: none;
    transition: background-color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.first-free:hover {
    background: color-mix(in srgb, var(--line) 82%, #000);
}

.first-free:active {
    transform: scale(0.985);
}

.first-free__label {
    font-weight: 700;
}

.first-free__when {
    font-size: 1.375rem;
    font-weight: 800;
    font-stretch: 85%;
    font-variant-numeric: tabular-nums;
}

.slots[aria-busy="true"] {
    opacity: 0.55;
}

.slots__day {
    margin-bottom: 8px;
    font-size: 1.375rem;
    font-weight: 800;
    font-stretch: 85%;
}

.slots__group {
    margin: 24px 0 10px;
    color: var(--color-muted);
    font-size: 1rem;
    font-weight: 700;
}

.slots__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    transition: background-color 0.12s var(--ease-out), transform 0.12s var(--ease-out);
}

.slot:hover,
.slot:active {
    background: var(--line);
    color: var(--on-line);
}

.slot:active {
    transform: scale(0.96);
}

/* Formulario */
.form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 6px;
}

.field__label {
    font-weight: 700;
}

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

/* Campo de formulario real: lleva su borde. */
.field__input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 2px solid var(--color-field);
    border-radius: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-size: 1.125rem;
}

.field__input:focus {
    border-color: var(--color-text);
    outline: 3px solid var(--line);
    outline-offset: 0;
}

.field__hint,
.field__error {
    margin: 0;
    font-size: 0.9375rem;
}

.field__hint {
    color: var(--color-muted);
}

.field__error {
    color: var(--color-error);
    font-weight: 700;
}

.field__error:empty {
    display: none;
}

.has-error .field__input,
.has-error .phone__prefix {
    border-color: var(--color-error);
}

.phone {
    display: flex;
    align-items: stretch;
}

.phone__prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 2px solid var(--color-field);
    border-right: 0;
    background: var(--color-surface);
    font-weight: 700;
}

.consent {
    margin: -8px 0 0;
    color: var(--color-muted);
    font-size: 0.9375rem;
}

/* Campo trampa para bots: fuera de la pantalla, no se ve ni se lee. */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px; /* taste-skill-ignore: elemento oculto, no es una línea */
    overflow: hidden;
}

/* Confirmación */
.confirm {
    padding-top: 24px;
}

.details__when dd {
    display: grid;
    font-weight: 800;
    font-stretch: 80%;
    line-height: 1.1;
}

.details__date {
    font-size: 1.375rem;
}

.details__time {
    font-size: 2.5rem;
    font-variant-numeric: tabular-nums;
}

.more-links {
    display: grid;
    gap: 4px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.more-links .change {
    margin: 0;
}

.more-links > li > a,
.more-links summary {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

.back__icon {
    flex-shrink: 0;
}

.change summary.link {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
}

.change summary {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    cursor: pointer;
}

.badge {
    display: inline-block;
    margin: 0 0 8px;
    padding: 4px 12px;
    font-size: 0.9375rem;
    font-weight: 700;
}

.badge--cancelled {
    background: var(--color-error-soft);
    color: var(--color-error);
}

.details {
    display: grid;
    gap: 14px;
    margin: 24px 0 8px;
    padding: 20px;
    background: var(--color-surface);
}

.details div {
    display: grid;
    gap: 2px;
}

.details dt {
    color: var(--color-muted);
    font-size: 0.9375rem;
}

.details dd {
    margin: 0;
    font-weight: 700;
}

.change {
    margin: 8px 0 24px;
}

.change summary {
    list-style: none;
}

.change summary::-webkit-details-marker {
    display: none;
}

.change[open] summary {
    margin-bottom: 12px;
}

.actions--row {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.consent__next {
    display: block;
    margin-bottom: 4px;
    color: var(--color-text);
    font-weight: 700;
}

.section--first {
    margin-top: 28px;
}

.expired {
    padding-top: 24px;
}

/* Horario tocado mientras carga el paso siguiente: queda marcado, así no se toca dos veces. */
.slot.is-pressed,
.service.is-pressed {
    background: var(--line);
    color: var(--on-line);
}

.service.is-pressed .service__meta,
.service.is-pressed .service__description,
.service.is-pressed .service__price {
    color: inherit;
}

/* Gestión del turno */
.notice--done p:first-child {
    font-weight: 700;
}

.action-form {
    margin: 0;
}

.manage .actions {
    margin: 0;
}

.manage > p {
    margin: 0 0 12px;
}

.notes {
    margin: 0;
    padding: 16px;
    background: var(--color-surface);
}

.policies {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.policies li {
    padding: 14px 16px;
    background: var(--color-surface);
    font-variant-numeric: tabular-nums;
}

/* "Tu turno ahora: lunes 23 a las 09:00" en la grilla de cambio. */
.step-summary__current {
    display: block;
    margin-top: 4px;
    color: var(--color-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Horario anterior en la confirmación del cambio. */
.details s {
    color: var(--color-muted);
    text-decoration-thickness: 2px;
}

.manage-confirm {
    padding-top: 24px;
}

@media (min-width: 600px) {
    .page {
        padding-top: 24px;
    }

    .hero {
        margin: 0 0 8px;
    }

    .sign {
        margin: -56px 24px 0;
        padding: 20px 24px;
    }

    .sign__name {
        font-size: 2.75rem;
    }

    .gallery {
        margin: 0;
        padding: 0 0 8px;
        scroll-padding-inline: 0;
    }

    /* En pantallas anchas los días entran todos: grilla de celdas iguales, filas parejas, sin scroll. */
    .days {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        margin: 0 0 16px;
        padding: 4px 0 0;
        overflow: visible;
    }

    .days .day {
        min-width: 0;
        padding: 0 8px;
        white-space: nowrap;
    }

    .slots__grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 960px) {
    .page:has(.profile) {
        max-width: 1120px;
    }

    .hero__cover {
        aspect-ratio: auto;
        height: 260px;
    }

    .sign {
        width: fit-content;
        max-width: calc(100% - 48px);
        padding-right: 40px;
    }

    .profile {
        display: grid;
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        gap: 56px;
        align-items: start;
    }

    .gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        overflow: visible;
    }

    .gallery__photo {
        width: 100%;
        max-width: none;
        aspect-ratio: 1;
    }
}

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