/* =============================================================================
   Sistema de diseño · Área del paciente
   Clínica Vida — Lenguaje visual: calma, confianza, claridad
   -----------------------------------------------------------------------------
   01. Tokens
   02. Base
   03. Cascarón (cabecera + pie)
   04. Portada
   05. Superficies (tarjeta, bloque, secciones)
   06. Formularios
   07. Preguntas y elecciones
   08. Cronograma (agenda y huecos)
   09. Asistente de reserva (pasos y barra)
   10. Botones
   11. Insignias y avisos
   12. Estados de la reserva
   13. Ficha y resumen
   14. Depósito y comprobante
   15. Movimiento
   16. Impresión
   17. Adaptación
   ========================================================================== */

/* ---------------------------------------------------------------- 01. TOKENS */
:root {
    /* Marca */
    --brand-50:  #F1FAFB;
    --brand-100: #DEF2F5;
    --brand-200: #B6E4EA;
    --brand-300: #7FCFD9;
    --brand-400: #45B4C1;
    --brand-500: #1E97A5;
    --brand-600: #0E8C93;
    --brand-700: #0A6B72;
    --brand-800: #0A5259;
    --brand-900: #08373C;

    /* Salud */
    --mint-100: #E4F8F1;
    --mint-300: #8FE3CB;
    --mint-500: #2FBF9B;
    --mint-700: #17866B;

    --sand-100: #FBF1DC;
    --sand-300: #EFC77A;
    --sand-500: #C98A16;
    --sand-700: #8A6208;

    --rose-100: #FDEBEE;
    --rose-500: #D2506B;
    --rose-700: #A63650;

    --violet-100: #EDEAFB;
    --violet-500: #6C5CE0;
    --violet-700: #4A3FB0;

    /* Tinta */
    --ink:      #0C2B31;
    --ink-soft: #33565D;
    --muted:    #6B8A91;

    --line:      #DCE9EB;
    --line-soft: #EDF4F5;

    --surface:   #FFFFFF;
    --surface-2: #FAFCFC;
    --surface-3: #F4F9F9;

    --danger: #C2413D;
    --warn:   #B7791F;

    /* Radios */
    --r-xs: 7px;
    --r-sm: 10px;
    --r:    14px;
    --r-lg: 18px;
    --r-xl: 24px;

    /* Elevacion teñida */
    --sh-1: 0 1px 2px rgba(8, 55, 60, .05);
    --sh-2: 0 1px 2px rgba(8, 55, 60, .04), 0 4px 12px rgba(8, 55, 60, .06);
    --sh-3: 0 2px 4px rgba(8, 55, 60, .04), 0 12px 28px rgba(8, 55, 60, .10);
    --sh-4: 0 8px 18px rgba(8, 55, 60, .08), 0 30px 64px rgba(8, 55, 60, .18);
    --ring: 0 0 0 3px rgba(69, 180, 193, .32);

    --ease:     cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --t: .2s;

    --sans:  'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --serif: 'Fraunces', Georgia, serif;
    --mono:  ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

    --ancho: 1140px;
}

/* ---------------------------------------------------------------- 02. BASE */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    font-family: var(--sans);
    color: var(--ink);
    background: var(--surface);
    font-size: 15.5px;
    line-height: 1.62;
    letter-spacing: -.004em;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.02em; margin: 0; }
a { text-decoration: none; transition: color var(--t) var(--ease); }
p { margin: 0 0 1rem; }
ul { margin-top: 0; }
::selection { background: var(--brand-200); color: var(--brand-900); }

:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }

.contenedor {
    width: 100%;
    max-width: var(--ancho);
    margin-inline: auto;
    padding-inline: 20px;
}

/* Titular de portada: serif con el mismo juego óptico que los indicadores. */
.display {
    font-family: var(--serif);
    font-weight: 600;
    font-variation-settings: 'SOFT' 24, 'opsz' 96;
    line-height: 1.06;
    letter-spacing: -.03em;
    color: var(--ink);
    margin-bottom: .6rem;
}

.numero { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.no-imprimir { }

/* --------------------------------------------------------- 03. CASCARÓN */
.cabecera {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.cabecera__marca {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: inherit;
}
.cabecera__marca:hover { color: inherit; }

.cabecera__logo {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 6px 16px rgba(14, 140, 147, .30);
}

.cabecera__nombre {
    font-weight: 800;
    font-size: .97rem;
    letter-spacing: -.015em;
    line-height: 1.25;
    color: var(--ink);
}

.cabecera__sub {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand-600);
    line-height: 1.3;
}

.pie {
    margin-top: auto;
    padding: 30px 0 calc(30px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, var(--surface-3), #EEF6F7);
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: .84rem;
    text-align: center;
}

/* ----------------------------------------------------------- 04. PORTADA */
.portada {
    position: relative;
    padding: 44px 0 34px;
    overflow: hidden;
    background:
        radial-gradient(900px 360px at 8% -15%, rgba(69, 180, 193, .22), transparent 62%),
        radial-gradient(760px 330px at 92% -5%, rgba(47, 191, 155, .18), transparent 60%),
        linear-gradient(180deg, var(--brand-50) 0%, #FFFFFF 82%);
    border-bottom: 1px solid var(--line-soft);
}

.portada::after {
    content: '';
    position: absolute;
    inset: auto -10% -60% auto;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 70%);
    pointer-events: none;
}

.portada > .contenedor { position: relative; z-index: 1; }

.portada__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 22px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .795rem;
    font-weight: 700;
    letter-spacing: .005em;
    color: var(--brand-700);
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--brand-200);
    box-shadow: var(--sh-1);
    backdrop-filter: blur(6px);
}
.chip i { color: var(--brand-500); }

.chip.mb-3 { margin-bottom: 12px; }

/* Punto que respira: avisa de que la agenda esta viva. */
.pulso-vivo {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mint-500);
    flex: 0 0 auto;
    box-shadow: 0 0 0 0 rgba(47, 191, 155, .55);
    animation: pulso 2.1s var(--ease-out) infinite;
}

.hero-bloque { margin-top: 30px; }

/* Próxima disponibilidad: la pieza que da confianza de un vistazo. */
.proxima {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-xl);
    padding: 22px 24px;
    color: #fff;
    background:
        radial-gradient(420px 200px at 100% 0%, rgba(255, 255, 255, .16), transparent 65%),
        linear-gradient(150deg, var(--brand-900) 0%, var(--brand-700) 58%, #0E7C84 100%);
    box-shadow: 0 18px 42px rgba(8, 55, 60, .24);
}
.proxima > * { position: relative; z-index: 1; }

.proxima__etiqueta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .82);
}

.proxima__fecha {
    margin-top: 12px;
    font-size: .93rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
}

.proxima__hora {
    font-family: var(--serif);
    font-weight: 600;
    font-variation-settings: 'SOFT' 20, 'opsz' 72;
    font-size: clamp(2.6rem, 7vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -.03em;
    color: #fff;
    margin-top: 2px;
}

.proxima__meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 14px;
    font-size: .84rem;
    color: rgba(255, 255, 255, .86);
}
.proxima__meta span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.proxima__meta i { color: var(--mint-300); }

.proxima__alerta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 15px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    color: #513706;
    background: linear-gradient(135deg, var(--sand-300), var(--sand-100));
    box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
}

/* Filtros de la portada: el bloque que encabeza la reserva. */
.filtros-portada {
    position: relative;
    z-index: 2;
    margin-bottom: 6px;
    border-radius: var(--r-lg);
    box-shadow: var(--sh-3);
}
.filtros-portada > .tarjeta { border: 0; box-shadow: none; background: var(--surface); }

.aviso-seleccion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-sm);
    font-size: .895rem;
    font-weight: 600;
    color: var(--brand-800);
    background: linear-gradient(135deg, var(--brand-50), var(--mint-100));
    border: 1px solid var(--brand-100);
}
.aviso-seleccion i { color: var(--brand-500); flex: 0 0 auto; }

/* ------------------------------------------------- 05. SUPERFICIES */
.tarjeta {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
    transition: box-shadow var(--t) var(--ease);
}

.tarjeta__cabeza {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #FFFFFF, var(--surface-2));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.tarjeta__cuerpo { padding: 20px; }

.seccion-titulo {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.bloque + .bloque { margin-top: 26px; }

.bloque__titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 11px;
    margin-bottom: 17px;
    border-bottom: 1px solid var(--line-soft);
    font-size: .765rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--brand-700);
}
.bloque__titulo i {
    width: 27px;
    height: 27px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: .86rem;
    background: var(--brand-100);
    color: var(--brand-700);
}

/* -------------------------------------------------- 06. FORMULARIOS */
.campo { margin-bottom: 16px; }

.campo > label,
.campo > .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--ink-soft);
    letter-spacing: .003em;
}
.campo > label i { color: var(--brand-500); }

.req { color: var(--rose-500); font-weight: 800; }

/* .control no es .form-control: Bootstrap no lo pinta, asi que aqui va. */
.control {
    display: block;
    width: 100%;
    font-family: inherit;
    font-size: .93rem;
    line-height: 1.45;
    color: var(--ink);
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

.control:focus {
    outline: 0;
    background: #fff;
    border-color: var(--brand-400);
    box-shadow: var(--ring);
}

.control::placeholder { color: #A9C4C8; }

select.control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='%236B8A91'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

textarea.control { min-height: 96px; resize: vertical; }

.control.is-invalid,
.campo.tiene-error .control {
    border-color: var(--danger);
    background: #FDF4F3;
}
.control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(194, 65, 61, .18); }

/* Solo se imprime si la vista decidio que hay error, asi que siempre se ve. */
.invalid-feedback,
.invalid-feedback-wizard {
    display: block;
    margin-top: 6px;
    font-size: .79rem;
    font-weight: 700;
    color: var(--danger);
}

.form-text { font-size: .78rem; color: var(--muted); }

.check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 16px;
    border: 1.5px solid var(--brand-200);
    border-radius: var(--r-sm);
    background: var(--brand-50);
    color: var(--ink-soft);
    font-size: .895rem;
    line-height: 1.5;
    cursor: pointer;
    transition: all var(--t) var(--ease);
}
.check:hover { border-color: var(--brand-300); }
.check input {
    flex: 0 0 auto;
    width: 1.15em;
    height: 1.15em;
    margin-top: .16em;
    accent-color: var(--brand-600);
    cursor: pointer;
}
.check strong { color: var(--ink); font-weight: 800; }
.check.is-invalid { border-color: var(--danger); background: #FDF4F3; }

/* ------------------------------------------ 07. PREGUNTAS Y ELECCIONES */
.pregunta {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface-2);
}
.pregunta + .pregunta { margin-top: 14px; }

.pregunta__label {
    font-weight: 700;
    font-size: .95rem;
    color: var(--ink);
    margin-bottom: 4px;
}

.pregunta__ayuda {
    font-size: .83rem;
    color: var(--muted);
    margin-bottom: 13px;
}

.pregunta__detalle {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}
.pregunta.tiene-error { border-color: rgba(194, 65, 61, .45); background: #FEF8F7; }

/* Sí / No */
.opcion { position: relative; height: 100%; }
.opcion input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.opcion label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    height: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-weight: 700;
    font-size: .92rem;
    color: var(--ink-soft);
    cursor: pointer;
    text-align: center;
    transition: all var(--t) var(--ease);
}
.opcion:hover label { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-700); }
.opcion input:focus-visible + label { box-shadow: var(--ring); }

.opcion input:checked + label {
    border-color: var(--brand-500);
    background: var(--brand-50);
    color: var(--brand-700);
    box-shadow: 0 0 0 3px rgba(30, 151, 165, .16);
}
.opcion--si input:checked + label {
    border-color: var(--mint-500);
    background: var(--mint-100);
    color: var(--mint-700);
    box-shadow: 0 0 0 3px rgba(47, 191, 155, .18);
}
.opcion--no input:checked + label {
    border-color: var(--line);
    background: var(--surface-3);
    color: var(--ink-soft);
    box-shadow: 0 0 0 3px rgba(107, 138, 145, .14);
}

/* Elección corta en píldoras */
.segmento {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--surface-3);
    border: 1.5px solid var(--line);
    border-radius: 999px;
}
.segmento .btn-check { position: absolute; opacity: 0; pointer-events: none; }
.segmento label {
    padding: 7px 22px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--t) var(--ease);
}
.segmento label:hover { color: var(--brand-700); }
.segmento .btn-check:checked + label {
    background: var(--brand-600);
    color: #fff;
    box-shadow: var(--sh-1);
}
.segmento .btn-check:focus-visible + label { box-shadow: var(--ring); }

/* Lista de datos del resumen */
.datos { margin: 0; }
.datos dt {
    margin-top: 12px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
    color: var(--muted);
}
.datos dt:first-child { margin-top: 0; }
.datos dd {
    margin: 3px 0 0;
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink);
}

/* ------------------------------------------------- 08. CRONOGRAMA */
.leyenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 17px;
    font-size: .8rem;
    color: var(--muted);
}
.leyenda span { display: inline-flex; align-items: center; gap: 7px; }

.l-libre, .l-ultimo, .l-lleno, .l-cerrado {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 4px;
    border: 1.5px solid;
}
.l-libre   { background: var(--mint-100);  border-color: var(--mint-500); }
.l-ultimo  { background: var(--sand-100);  border-color: var(--sand-500); }
.l-lleno   { background: var(--rose-100);  border-color: var(--rose-500); }
.l-cerrado { background: var(--surface-3); border-color: var(--line); }

.agenda-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    border-radius: var(--r);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-200) transparent;
}
.agenda-scroll::-webkit-scrollbar { height: 8px; }
.agenda-scroll::-webkit-scrollbar-thumb { background: var(--brand-200); border-radius: 99px; }
.agenda-scroll::-webkit-scrollbar-track { background: var(--line-soft); border-radius: 99px; }

.agenda-scroll.cargando { opacity: .45; pointer-events: none; }
.agenda-scroll.entra    { animation: agenda-entra .38s var(--ease-out); }

.agenda {
    display: grid;
    grid-template-columns: 64px repeat(var(--cols, 5), minmax(98px, 1fr));
    gap: 7px;
    min-width: calc(64px + var(--cols, 5) * 98px);
}

.agenda__esquina { min-height: 6px; }

.agenda__dia {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 8px 6px;
    border-radius: var(--r-sm);
    background: var(--surface-3);
    border: 1px solid var(--line-soft);
    text-align: center;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.agenda__dia b {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--ink);
    line-height: 1.1;
}
.agenda__dia.hoy {
    background: linear-gradient(180deg, var(--brand-100), var(--brand-50));
    border-color: var(--brand-200);
    color: var(--brand-700);
}
.agenda__dia.hoy b { color: var(--brand-700); }

.libres {
    display: inline-block;
    margin-top: 3px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: none;
    color: var(--mint-700);
    background: var(--mint-100);
}

.agenda__hora {
    display: flex;
    align-items: center;
    font-size: .775rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    padding-right: 4px;
}

.agenda__vacia {
    display: grid;
    place-items: center;
    min-height: 56px;
    border-radius: var(--r-sm);
    background: var(--surface-3);
    color: var(--line);
    font-weight: 700;
}

.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 56px;
    padding: 6px 4px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.slot b { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.slot small { font-size: .67rem; font-weight: 600; opacity: .78; line-height: 1.2; }

.slot--libre {
    border-color: rgba(47, 191, 155, .42);
    background: linear-gradient(180deg, #F4FDFA, var(--mint-100));
    color: var(--mint-700);
}
.slot--libre:hover,
.slot--libre:focus-visible {
    border-color: var(--mint-500);
    transform: translateY(-2px);
    box-shadow: var(--sh-2);
}
.slot--libre:active { transform: translateY(0); }

.slot--ultimo {
    border-color: rgba(201, 138, 22, .45);
    background: linear-gradient(180deg, #FEFAF0, var(--sand-100));
    color: var(--sand-700);
}
.slot--ultimo:hover,
.slot--ultimo:focus-visible { border-color: var(--sand-500); transform: translateY(-2px); box-shadow: var(--sh-2); }

.slot--lleno {
    border-color: rgba(210, 80, 107, .30);
    background: var(--rose-100);
    color: var(--rose-700);
    cursor: not-allowed;
}

.slot--cerrado {
    background: repeating-linear-gradient(135deg, #F6FAFA, #F6FAFA 6px, var(--line-soft) 6px, var(--line-soft) 12px);
    border-color: var(--line-soft);
    color: var(--muted);
    cursor: not-allowed;
}

.slot.selected {
    border-color: var(--brand-600);
    background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
    color: #fff;
    box-shadow: 0 8px 18px rgba(14, 140, 147, .34);
    transform: translateY(-2px);
}
.slot.selected small { color: rgba(255, 255, 255, .85); }

.semana-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}
.semana-nav__label { font-weight: 700; }

/* ------------------------------------------- 09. ASISTENTE DE RESERVA */
.progreso {
    height: 6px;
    border-radius: 99px;
    background: var(--line-soft);
    overflow: hidden;
}
.progreso > div {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
    transition: width .45s var(--ease-out);
}

.pasos {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.paso-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: .6;
    transition: opacity var(--t) var(--ease);
}
.paso-btn.accesible, .paso-btn:hover { opacity: 1; }

.paso-circulo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .795rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    background: #fff;
    border: 1.5px solid var(--line);
    transition: all var(--t) var(--ease);
}
.paso-btn:hover .paso-circulo { border-color: var(--brand-300); color: var(--brand-700); }

.paso-circulo.hecho {
    background: var(--mint-500);
    border-color: var(--mint-500);
    color: #fff;
}
.paso-circulo.activo {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    border-color: var(--brand-600);
    color: #fff;
    box-shadow: 0 5px 14px rgba(14, 140, 147, .34);
    transform: scale(1.07);
}

.paso-panel { animation: panel-entra .3s var(--ease-out); }

.barra-acciones {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 13px 0 calc(4px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 34%);
    border-top: 1px solid var(--line-soft);
}

.barra-acciones__medio { display: flex; justify-content: center; min-width: 0; }

.paso-ayuda {
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

/* ------------------------------------------------------------ 10. BOTONES */
.btn {
    font-family: inherit;
    font-weight: 700;
    font-size: .9rem;
    border-radius: var(--r-sm);
    padding: 10px 18px;
    border-width: 1.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.4;
    transition: all var(--t) var(--ease);
    cursor: pointer;
    white-space: nowrap;
}
.btn:focus-visible { box-shadow: var(--ring); outline: 0; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }

.btn-pri {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(14, 140, 147, .28);
}
.btn-pri:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(14, 140, 147, .34); }

.btn-ok {
    background: linear-gradient(135deg, var(--mint-700), var(--mint-500));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(23, 134, 107, .26);
}
.btn-ok:hover { color: #fff; filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(23, 134, 107, .32); }

.btn-linea {
    background: rgba(255, 255, 255, .9);
    border-color: var(--brand-200);
    color: var(--brand-700);
}
.btn-linea:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.btn-suave {
    background: var(--surface-3);
    border-color: var(--line);
    color: var(--ink-soft);
}
.btn-suave:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }

.btn-volver {
    background: #fff;
    border-color: var(--line);
    color: var(--ink-soft);
}
.btn-volver:hover { background: var(--surface-3); border-color: var(--brand-200); color: var(--brand-800); }

.btn-continuar {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    border-color: transparent;
    color: #fff;
    padding: 11px 24px;
    font-size: .95rem;
    box-shadow: 0 6px 18px rgba(14, 140, 147, .32);
}
.btn-continuar:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 11px 26px rgba(14, 140, 147, .4); }

.btn-agendar {
    padding: 13px 26px;
    font-size: 1rem;
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--brand-700), var(--mint-700) 130%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 22px rgba(8, 83, 90, .32);
}
.btn-agendar:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(8, 83, 90, .38); filter: brightness(1.05); }

.btn-icono {
    width: 36px;
    height: 36px;
    padding: 0;
    flex: 0 0 auto;
}
.btn-no-ancho { flex: 0 0 auto; }

.btn-sm  { padding: 6px 12px; font-size: .81rem; border-radius: var(--r-xs); }
.btn-lg  { padding: 13px 24px; font-size: .96rem; }

/* ------------------------------------------- 11. INSIGNIAS Y AVISOS */
.insignia {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .755rem;
    font-weight: 700;
    letter-spacing: .01em;
    border: 1px solid transparent;
    white-space: nowrap;
    max-width: 100%;
}
.insignia i { font-size: .82rem; }

.insignia--marca { background: var(--brand-50);   border-color: var(--brand-100); color: var(--brand-700); }
.insignia--ok    { background: var(--mint-100);   border-color: rgba(47, 191, 155, .32); color: var(--mint-700); }
.insignia--aviso { background: var(--sand-100);   border-color: rgba(201, 138, 22, .3);  color: var(--sand-700); }

.aviso {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: .89rem;
    line-height: 1.55;
}
.aviso i { flex: 0 0 auto; font-size: 1.05rem; line-height: 1.45; }
.aviso strong { font-weight: 800; }

.aviso--info { background: var(--brand-50); border-color: var(--brand-100);   color: var(--brand-800); }
.aviso--ok   { background: var(--mint-100); border-color: rgba(47, 191, 155, .3);  color: var(--mint-700); }
.aviso--mal  { background: var(--rose-100); border-color: rgba(210, 80, 107, .26); color: var(--rose-700); }
.aviso--warn { background: var(--sand-100); border-color: rgba(201, 138, 22, .3);  color: var(--sand-700); }

.aviso-paso { box-shadow: var(--sh-1); }

/* --------------------------------------------- 12. ESTADOS DE LA RESERVA */
.estado {
    position: relative;
    overflow: hidden;
    padding: 26px 26px 28px;
    border-radius: var(--r-xl);
    color: #fff;
    box-shadow: 0 16px 36px rgba(8, 55, 60, .20);
}
.estado::after {
    content: '';
    position: absolute;
    top: -84px;
    right: -66px;
    width: 236px;
    height: 236px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
    pointer-events: none;
}
.estado > * { position: relative; z-index: 1; }

.estado .icono {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .20);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.estado h1 {
    font-family: var(--serif);
    font-weight: 600;
    font-variation-settings: 'SOFT' 24, 'opsz' 72;
    font-size: clamp(1.42rem, 3.6vw, 1.9rem);
    letter-spacing: -.025em;
    line-height: 1.14;
    margin-bottom: 7px;
}

.estado p { font-size: .93rem; max-width: 56ch; }

.estado--ok    { background: linear-gradient(135deg, #12735C 0%, var(--mint-500) 100%); }
.estado--aviso { background: linear-gradient(135deg, var(--sand-700) 0%, var(--sand-500) 100%); }
.estado--mal   { background: linear-gradient(135deg, var(--rose-700) 0%, var(--rose-500) 100%); }
.estado--gris  { background: linear-gradient(135deg, var(--ink-soft) 0%, var(--muted) 100%); }

.estado .btn-linea {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    backdrop-filter: blur(4px);
}
.estado .btn-linea:hover { background: #fff; border-color: #fff; color: var(--ink); }

.codigo-reserva {
    font-family: var(--mono);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: inherit;
}

/* ------------------------------------------------ 13. FICHA Y RESUMEN */
.ficha { display: grid; gap: 15px; }

.ficha__dato { display: flex; gap: 11px; align-items: flex-start; min-width: 0; }

.ficha__icono {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: .95rem;
}

.ficha__titulo {
    font-size: .735rem;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.4;
}

.ficha__valor {
    font-weight: 700;
    font-size: .96rem;
    line-height: 1.35;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.acciones { display: grid; gap: 10px; }

/* ------------------------------------------- 14. DEPÓSITO Y COMPROBANTE */
.deposito {
    padding: 18px;
    border: 1.5px solid #F2DFAE;
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--sand-100), #FFFFFF 72%);
}
.deposito p { margin-bottom: 11px; }
.deposito ul { margin-bottom: 16px; padding-left: 19px; font-size: .87rem; color: var(--ink-soft); }
.deposito li { margin-bottom: 5px; }
.deposito li::marker { color: var(--sand-500); }

.deposito__monto {
    font-family: var(--serif);
    font-weight: 600;
    font-variation-settings: 'SOFT' 20, 'opsz' 72;
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: -.025em;
    color: var(--sand-700);
    font-variant-numeric: tabular-nums;
}

.deposito-accion {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px dashed var(--line);
}

.monto {
    font-family: var(--serif);
    font-weight: 600;
    font-variation-settings: 'SOFT' 20, 'opsz' 72;
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: -.025em;
    color: var(--sand-700);
    font-variant-numeric: tabular-nums;
}

.bancario {
    padding: 18px;
    border: 1.5px solid var(--brand-100);
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--brand-50), #fff);
}

.dato {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
}
.dato:last-child, .dato:last-of-type { border-bottom: 0; }
.dato span:first-child { color: var(--muted); font-size: .84rem; font-weight: 600; }
.dato span:last-child  { font-weight: 700; font-size: .9rem; text-align: right; overflow-wrap: anywhere; }

.zona-carga {
    display: grid;
    place-items: center;
    gap: 6px;
    text-align: center;
    padding: 30px 18px;
    border: 2px dashed var(--brand-200);
    border-radius: var(--r);
    background: var(--brand-50);
    color: var(--brand-700);
    cursor: pointer;
    transition: all var(--t) var(--ease);
}
.zona-carga i { font-size: 1.95rem; color: var(--brand-500); }
.zona-carga strong { font-size: .95rem; color: var(--ink); }
.zona-carga span { font-size: .795rem; color: var(--muted); }
.zona-carga:hover,
.zona-carga.activa {
    border-color: var(--brand-500);
    background: var(--brand-100);
    transform: translateY(-1px);
    box-shadow: var(--sh-1);
}
.zona-carga:focus-visible { box-shadow: var(--ring); outline: 0; }

.vista-previa {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    padding: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

/* Vistas internas del modal: la visibilidad la decide el JavaScript.
   Deben ser columnas flex con alto completo; si no, .modal-body no
   puede hacer scroll y el contenido queda recortado. */
.modal-vista { min-width: 0; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.modal-vista > .modal-header { flex: 0 0 auto; }
.modal-vista > .vista-pasos { flex: 0 0 auto; }
.modal-vista > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.modal .modal-content {
    border: 0;
    border-radius: var(--r-xl);
    box-shadow: var(--sh-4);
    overflow: hidden;
}
.modal .modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #FFF, var(--surface-2));
}
.modal .modal-title { font-size: 1.03rem; font-weight: 800; letter-spacing: -.015em; }
.modal .modal-body { padding: 20px 22px; }

/* ------------------------------------------------------- 15. MOVIMIENTO */
.revelar {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
    will-change: opacity, transform;
}
.revelar.visible { opacity: 1; transform: none; }

@keyframes pulso {
    0%   { box-shadow: 0 0 0 0 rgba(47, 191, 155, .55); }
    70%  { box-shadow: 0 0 0 9px rgba(47, 191, 155, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 191, 155, 0); }
}

@keyframes agenda-entra {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: none; }
}

@keyframes panel-entra {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .revelar { opacity: 1; transform: none; }
}

/* -------------------------------------------------------- 16. IMPRESIÓN */
@media print {
    body { background: #fff !important; }
    .cabecera, .pie, .no-imprimir { display: none !important; }
    .tarjeta { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .estado { color: #000 !important; background: #fff !important; border: 2px solid #000; }
    .estado h1, .estado i, .estado code { color: #000 !important; }
    .estado .icono { background: #eee; color: #000; }
}

/* ------------------------------------------------------ 17. ADAPTACIÓN */
@media (max-width: 575.98px) {
    body { font-size: 15px; }

    .contenedor { padding-inline: 16px; }

    .portada { padding: 32px 0 26px; }

    .cabecera__sub { font-size: .66rem; }

    .tarjeta__cuerpo { padding: 16px; }
    .tarjeta__cabeza { padding: 13px 16px; }

    .proxima { padding: 19px 20px; }

    /* Navegacion de semana: una sola fila, sin salto de linea */
    .agenda-top { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; }
    .semana-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; width: 100%; gap: 8px; flex-wrap: nowrap; }
    .semana-nav__label { justify-self: center; align-self: center; text-align: center; font-size: .78rem; padding-inline: 8px; }

    /* Cronograma: solo dias con lugares libres, celdas cuadradas, scroll horizontal para ver mas */
    /* + scroll vertical con solo 3 filas visibles y encabezados de dia fijos */
    .agenda-scroll { overflow-x: auto; overflow-y: auto; padding-bottom: 6px; max-height: calc(58px + 3 * 84px + 2 * 6px); overscroll-behavior: contain; }
    .agenda__esquina { position: sticky; top: 0; z-index: 3; background: var(--surface); }
    .agenda__dia { position: sticky; top: 0; z-index: 2; box-shadow: 0 2px 6px rgba(8, 55, 60, .12); }
    .agenda { grid-auto-columns: 84px; grid-template-columns: 30px repeat(var(--cols, 5), 84px); gap: 6px; min-width: max-content; width: auto; }
    .agenda__hora { font-size: .6rem; padding-right: 2px; letter-spacing: -.02em; }
    .agenda__dia { padding: 6px 2px; font-size: .56rem; gap: 0; border-radius: 10px; letter-spacing: .02em; }
    .agenda__dia b { font-size: .85rem; }
    .libres { font-size: .5rem; padding: 0 4px; margin-top: 1px; }
    .slot { min-height: 0; aspect-ratio: 1 / 1; padding: 4px 2px; border-width: 1px; border-radius: 10px; }
    .slot b { font-size: .62rem; letter-spacing: -.02em; }
    .slot small { font-size: .52rem; }
    .agenda__vacia { min-height: 0; aspect-ratio: 1 / 1; }

    .barra-acciones {
        grid-template-columns: auto auto;
        justify-content: space-between;
        gap: 9px;
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(8px);
        padding: 11px 0 calc(9px + env(safe-area-inset-bottom));
        margin-top: 16px;
    }
    .barra-acciones__medio { display: none; }

    /* Asistente (wizard) en celular: encabezado sin desbordes */
    .modal .modal-header { padding: 14px 16px; align-items: flex-start; gap: 10px; }
    .modal .modal-title { font-size: .95rem; line-height: 1.3; }
    .modal .modal-header .btn-close { margin-top: 2px; }
    .aviso-seleccion { font-size: .83rem; padding: 11px 13px; gap: 8px; }
    .paso-btn { width: 26px; height: 26px; }
    .paso-circulo { width: 23px; height: 23px; font-size: .66rem; }
    .pasos { flex-wrap: nowrap; gap: 4px; }

    .estado { padding: 21px 20px 23px; border-radius: var(--r-lg); }
    .estado .icono { width: 44px; height: 44px; font-size: 1.25rem; border-radius: 14px; }

    .monto { font-size: 2rem; }
    .deposito__monto { font-size: 1.65rem; }

    .zona-carga { padding: 24px 14px; }

    .modal .modal-body { padding: 16px; }
    .modal .modal-header { padding: 14px 16px; }
}

/* Tabletas pequenas: mismas celdas cuadradas, con scroll si no caben todas */
@media (min-width: 576px) and (max-width: 767.98px) {
    .agenda-scroll { overflow-x: auto; padding-bottom: 10px; }
    .agenda { grid-template-columns: 40px repeat(var(--cols, 5), 92px); gap: 6px; min-width: max-content; width: auto; }
    .agenda__hora { font-size: .65rem; }
    .agenda__dia { padding: 6px 2px; font-size: .6rem; }
    .agenda__dia b { font-size: .9rem; }
    .slot { min-height: 0; aspect-ratio: 1 / 1; padding: 5px 2px; }
    .slot b { font-size: .65rem; }
    .slot small { font-size: .52rem; }
    .agenda__vacia { min-height: 0; aspect-ratio: 1 / 1; }
}

@media (min-width: 576px) {
    .ficha { grid-template-columns: 1fr 1fr; }
    .datos { display: grid; grid-template-columns: minmax(150px, 26%) 1fr; column-gap: 18px; align-items: baseline; }
    .datos dt { margin-top: 11px; }
    .datos dt:first-child { margin-top: 0; }
    .acciones { grid-template-columns: repeat(3, 1fr); }
    .deposito-accion { grid-template-columns: auto 1fr; align-items: center; gap: 24px; }
    .deposito-accion .btn { justify-self: end; }
}

@media (min-width: 768px) {
    .portada { padding: 58px 0 44px; }
    .hero-bloque { margin-top: 36px; }
    .pie { text-align: left; padding: 34px 0; }
}

@media (min-width: 992px) {
    .filtros-portada { margin-bottom: 10px; }
}
