/* =========================================================
   MedicalClick · páginas de producto: reserva (reservar.html) y sala (sala.html)
   Usa los tokens de styles.css.
   ========================================================= */

.app { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg-2); }

/* ---------- Barra superior ---------- */
.appbar { background: var(--surface); border-bottom: 2px solid var(--tinta); position: sticky; top: 0; z-index: 30; }
.appbar__inner { height: 68px; display: flex; align-items: center; gap: 16px; }
.appbar__secure { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.appbar__secure .i { color: var(--ok); width: 20px; height: 20px; }
.appbar__back { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 700; color: var(--primary-ink); text-decoration: none; padding: 10px 4px; }
.appbar__back .i { width: 18px; height: 18px; }
@media (max-width: 560px) { .appbar__secure span { display: none; } }

.demo-bar {
  background: var(--malva); color: var(--ciruela); font-size: .88rem; font-weight: 600; text-align: center;
  padding: 9px 16px; border-bottom: 2px solid var(--tinta);
}

/* ---------- Progreso ---------- */
.progress { display: flex; gap: 8px; margin: 28px 0 24px; counter-reset: p; }
.progress li {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  font-size: .85rem; font-weight: 600; color: var(--ink-3);
}
.progress li::before {
  content: ""; height: 4px; border-radius: 0; background: var(--line);
  transition: background-color .35s var(--ease-out);
}
.progress li.is-done::before { background: var(--ciruela); }
.progress li.is-current::before { background: var(--orquidea); }
.progress li.is-current { color: var(--ink); }
.progress li.is-done { color: var(--ink-2); }
@media (max-width: 560px) { .progress li span { display: none; } .progress li.is-current span { display: inline; } }

/* ---------- Layout del flujo ---------- */
.flow { flex: 1; padding-bottom: 64px; }
.flow__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.flow__main {
  background: var(--surface); border: 2px solid var(--tinta); border-radius: 0;
  padding: clamp(22px, 4vw, 40px);
  min-height: 420px;
}
.wstep[hidden] { display: none; }
[hidden] { display: none !important; }
.toast[hidden] { display: flex !important; }
.wstep.is-entering { animation: stepIn .28s var(--ease-out) both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(10px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.wstep.is-entering-back { animation: stepBack .28s var(--ease-out) both; }
@keyframes stepBack { from { opacity: 0; transform: translateX(-10px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.step__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; outline: none; }
.step__lead { margin-top: 8px; color: var(--ink-2); }
.step__body { margin-top: 26px; }
.flow__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 22px; border-top: 2px solid var(--tinta); }
.flow__actions .btn--primary { min-width: 200px; }
.link-btn { background: none; border: 0; padding: 10px 4px; font-weight: 700; color: var(--primary-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link-btn .i { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .flow__grid { grid-template-columns: minmax(0, 1fr); }
  .summary { order: -1; }
}
@media (max-width: 600px) {
  .flow__main { border-radius: 0; padding: 22px 18px 18px; }
  .flow__actions {
    position: sticky; bottom: 0; z-index: 5;
    margin: 24px -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
  }
  .flow__actions .btn--primary { flex: 1; min-width: 0; }
}

/* ---------- Tarjetas de opción (servicios) ---------- */
.options { display: grid; gap: 10px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__box {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 16px;
  padding: 16px 18px; border-radius: 0; border: 2px solid var(--line);
  background: var(--surface);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .16s var(--ease-out);
}
.option:active .option__box { transform: scale(.99); }
.option__ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 0; background: var(--bg-2); color: var(--ink-3); grid-row: span 2; transition: background-color .2s ease, color .2s ease; }
.option__ic .i { width: 24px; height: 24px; }
.option__name { font-weight: 700; line-height: 1.3; }
.option__meta { font-size: .9rem; color: var(--ink-3); grid-column: 2; }
.option__check {
  grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong);
  display: grid; place-items: center; transition: border-color .2s ease, background-color .2s ease;
}
.option__check::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--on-primary); transform: scale(0); transition: transform .2s var(--ease-out); }
.option input:checked + .option__box { border-color: var(--ciruela); background: var(--malva); }
.option input:checked + .option__box .option__ic { background: var(--primary); color: var(--on-primary); }
.option input:checked + .option__box .option__check { border-color: var(--orquidea); background: var(--orquidea); }
.option input:checked + .option__box .option__check::after { transform: scale(1); }
.option input:focus-visible + .option__box { outline: 2.5px solid var(--focus); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .option:hover .option__box { border-color: var(--line-strong); } .option input:checked + .option__box { border-color: var(--primary); } }

/* ---------- Fechas y horas ---------- */
.dates { position: relative; }
.dates__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dates__month { font-weight: 700; text-transform: capitalize; }
.dates__arrows { display: flex; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 0; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
  transition: border-color .2s ease, transform .16s var(--ease-out);
}
.icon-btn:active { transform: scale(.95); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.icon-btn .i { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .icon-btn:not([disabled]):hover { border-color: var(--primary); } }
.dates__strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 74px; gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 2px 10px; scrollbar-width: none;
}
.dates__strip::-webkit-scrollbar { display: none; }
.date {
  scroll-snap-align: start;
  display: grid; justify-items: center; gap: 2px; padding: 10px 4px 12px;
  border-radius: 0; border: 2px solid var(--line); background: var(--surface);
  cursor: pointer; transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.date:active { transform: scale(.96); }
.date__dow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.date__num { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.date__mon { font-size: .78rem; color: var(--ink-3); }
.date__free { margin-top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--orquidea); }
.date[disabled] { cursor: not-allowed; opacity: .42; }
.date[disabled] .date__free { background: transparent; }
.date[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.date[aria-pressed="true"] .date__dow, .date[aria-pressed="true"] .date__mon { color: color-mix(in srgb, var(--on-primary) 80%, transparent); }
.date[aria-pressed="true"] .date__free { background: var(--on-primary); }
@media (hover: hover) and (pointer: fine) { .date:not([disabled]):not([aria-pressed="true"]):hover { border-color: var(--primary); } }

.times { margin-top: 22px; }
.times__group + .times__group { margin-top: 18px; }
.times__label { font-size: .82rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.times__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.time {
  min-height: 48px; border-radius: 0; border: 2px solid var(--line); background: var(--surface);
  font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.time:active { transform: scale(.96); }
.time[disabled] { cursor: not-allowed; color: var(--ink-3); text-decoration: line-through; opacity: .5; background: var(--bg-2); }
.time[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
@media (hover: hover) and (pointer: fine) { .time:not([disabled]):not([aria-pressed="true"]):hover { border-color: var(--primary); color: var(--primary-ink); } }
.times__tz { margin-top: 16px; font-size: .88rem; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.times__tz .i { width: 18px; height: 18px; }
.empty {
  display: grid; justify-items: center; text-align: center; gap: 8px;
  padding: 36px 16px; border-radius: 0; background: var(--bg-2); color: var(--ink-2);
}
.empty .i { width: 32px; height: 32px; color: var(--ink-3); }

/* ---------- Formulario ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { display: grid; gap: 7px; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field label, .field__label { font-weight: 700; font-size: .95rem; }
.field__hint { font-size: .86rem; color: var(--ink-3); }
.input, .select {
  width: 100%; min-height: 52px; padding: 0 16px;
  border: 2px solid var(--line-strong); border-radius: 0;
  background: var(--surface); color: var(--ink); font-size: 1.02rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: color-mix(in srgb, var(--ink-3) 75%, transparent); }
.input:focus, .select:focus { outline: none; border-color: var(--ciruela); box-shadow: 0 0 0 3px var(--lavanda); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--alert); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--alert) 16%, transparent); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F7087' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; padding-right: 44px; }
.input-group { display: flex; align-items: stretch; }
.input-group__pre {
  display: grid; place-items: center; padding: 0 14px; border: 2px solid var(--line-strong); border-right: 0;
  border-radius: 0; background: var(--bg-2); font-weight: 700; color: var(--ink-2);
}
.input-group .input { border-radius: 0; }
.field__error { font-size: .88rem; font-weight: 600; color: var(--alert); display: flex; gap: 6px; align-items: flex-start; }
.field__error:empty { display: none; }
.field__ok { color: var(--ok); }
.check {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; cursor: pointer;
  padding: 14px 16px; border-radius: 0; border: 2px solid var(--line); background: var(--surface);
  transition: border-color .2s ease, background-color .2s ease;
}
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ciruela); cursor: pointer; }
.check:has(input:checked) { border-color: var(--ciruela); background: var(--malva); }
.check[data-invalid="true"] { border-color: var(--alert); }
.check span { color: var(--ink-2); font-size: .96rem; }
.check strong { color: var(--ink); }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }

/* ---------- Revisión y consentimiento ---------- */
.review { display: grid; gap: 0; border: 2px solid var(--tinta); border-radius: 0; overflow: hidden; }
.review > div { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 14px 18px; }
.review > div + div { border-top: 1px solid var(--line); }
.review dt { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.review dd { margin: 0; font-weight: 700; }
.review .link-btn { font-size: .9rem; padding: 4px; }
@media (max-width: 560px) { .review > div { grid-template-columns: 1fr auto; } .review dt { grid-column: 1 / -1; } }

.policy { width: 100%; margin-top: 18px; display: flex; gap: 12px; padding: 14px 16px; border-radius: 0; background: var(--bg-2); color: var(--ink-2); font-size: .95rem; }
.policy .i { color: var(--primary); width: 22px; height: 22px; margin-top: 1px; }

.consent { margin-top: 18px; display: grid; gap: 10px; }
.consent__doc { border: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.consent__doc summary { padding: 14px 16px; font-size: .96rem; }
.consent__text { padding: 0 18px 16px; max-height: 260px; overflow: auto; color: var(--ink-2); font-size: .93rem; display: grid; gap: 10px; }
.consent__text h4 { color: var(--ink); font-size: .95rem; margin-top: 6px; }
.consent__text ul { list-style: disc; padding-left: 1.2em; display: grid; gap: 4px; }

/* ---------- Pago de demostración ---------- */
.gateway { border: 2px solid var(--tinta); border-radius: 0; overflow: hidden; }
.gateway__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--perla); border-bottom: 2px solid var(--tinta); font-weight: 700; }
.gateway__head .i { color: var(--ok); }
.gateway__body { padding: 22px 20px; display: grid; gap: 16px; }
.gateway__amount { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gateway__amount strong { font-size: 1.6rem; letter-spacing: -0.02em; }
.gateway__note { font-size: .9rem; color: var(--ink-3); }
.gateway__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .gateway__actions { grid-template-columns: 1fr; } }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 0; font-size: .95rem; margin-bottom: 18px; }
.notice .i { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.notice--alert { background: var(--alert-soft); color: var(--ink); }
.notice--alert .i { color: var(--alert); }
.notice--info { background: var(--primary-soft); color: var(--ink); }
.notice--info .i { color: var(--primary); }
.notice--ok { background: var(--ok-soft); }
.notice--ok .i { color: var(--ok); }

/* ---------- Resumen lateral ---------- */
.summary {
  position: sticky; top: 92px;
  background: var(--surface); border: 2px solid var(--tinta); border-radius: 0;
  padding: 22px;
}
.summary__title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; margin-bottom: 14px; }
.summary__rows { display: grid; gap: 12px; }
.summary__row { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; }
.summary__row .i { width: 20px; height: 20px; color: var(--primary); margin-top: 2px; }
.summary__row span { color: var(--ink-2); }
.summary__row strong { display: block; color: var(--ink); font-weight: 700; }
.summary__row.is-empty strong { color: var(--ink-3); font-weight: 500; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding-top: 16px; border-top: 2px solid var(--tinta); font-weight: 700; }
.summary__total strong { color: var(--ciruela); }
.summary__total strong { font-size: 1.2rem; }
.hold {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 0;
  background: var(--malva); color: var(--ink); font-size: .92rem; font-weight: 600;
}
.hold .i { color: var(--primary); width: 22px; height: 22px; }
.hold b { font-variant-numeric: tabular-nums; color: var(--primary-ink); white-space: nowrap; }
.hold.is-low { background: var(--alert-soft); }
.hold.is-low .i, .hold.is-low b { color: var(--alert); }
@media (max-width: 900px) {
  .summary { position: static; padding: 16px 18px; }
  .summary__title { display: none; }
  .summary__rows { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .summary__row--price, .summary__total { display: none; }
  .hold { margin-top: 12px; }
}

/* ---------- Confirmación ---------- */
.done { max-width: 640px; margin: 36px auto 0; text-align: center; }
.done__mark { width: 84px; height: 84px; margin: 0 auto 22px; }
.done__mark circle { fill: var(--malva); }
.done__mark path { fill: none; stroke: var(--ciruela); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.done.is-in .done__mark path { transition: stroke-dashoffset .6s var(--ease-out) .15s; stroke-dashoffset: 0; }
.done__title { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.done__lead { margin-top: 10px; color: var(--ink-2); font-size: 1.08rem; }
.ticket {
  margin-top: 28px; text-align: left; background: var(--surface); border: 2px solid var(--tinta); border-radius: 0;
  overflow: hidden;
}
.ticket__top { padding: 20px 22px; display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 2px solid var(--tinta); background: var(--perla); }
.ticket__code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; color: var(--primary-ink); }
.ticket__status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 6px 10px; border-radius: 0; }
.ticket__status .i { width: 18px; height: 18px; }
.ticket dl { margin: 0; padding: 8px 22px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.ticket dt { font-size: .8rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ticket dd { margin: 3px 0 0; font-weight: 700; }
.done__actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.done__actions .btn--primary { grid-column: 1 / -1; }
.done__next { margin-top: 30px; text-align: left; display: grid; gap: 12px; }
.done__next li { display: flex; gap: 12px; color: var(--ink-2); }
.done__next .i { width: 22px; height: 22px; color: var(--primary); margin-top: 1px; }
@media (max-width: 560px) { .done__actions { grid-template-columns: 1fr; } .ticket dl { grid-template-columns: 1fr; } }

/* ---------- Diálogo ---------- */
.dialog {
  width: min(520px, calc(100% - 32px)); padding: 0; border: 2px solid var(--tinta); border-radius: 0;
  background: var(--surface); color: var(--ink);
  opacity: 1; transform: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), overlay .2s allow-discrete, display .2s allow-discrete;
}
@starting-style { .dialog[open] { opacity: 0; transform: scale(.97) translateY(6px); } }
.dialog::backdrop { background: rgb(32 30 29 / .5); }
.dialog__body { padding: 26px 24px 22px; }
.dialog__title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.dialog__body > p { margin-top: 10px; color: var(--ink-2); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* =========================================================
   Sala de espera y videollamada
   ========================================================= */
.lobby { flex: 1; padding: 28px 0 56px; }
.lobby__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.preview {
  position: relative; aspect-ratio: 16 / 11; border-radius: 0; overflow: hidden;
  background: var(--tinta);
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview__off {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px;
  color: #EDE8F2;
  background: var(--tinta);
}
.preview__off .i { width: 44px; height: 44px; color: var(--lavanda); }
.preview__off p { max-width: 34ch; font-size: .98rem; }
.preview__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; background: linear-gradient(transparent, rgb(32 30 29 / .7)); }
.round-btn {
  width: 52px; height: 52px; border-radius: 0; border: 0; display: grid; place-items: center; cursor: pointer;
  background: #3A3736; color: #fff;
  transition: background-color .2s ease, transform .16s var(--ease-out);
}
.round-btn:active { transform: scale(.94); }
.round-btn .i { width: 24px; height: 24px; }
.round-btn[aria-pressed="true"] { background: #fff; color: var(--tinta); }
.round-btn--end { background: var(--orquidea); width: 60px; }
@media (hover: hover) and (pointer: fine) { .round-btn:hover { background: #4A4645; } .round-btn--end:hover { background: var(--accent-hover); } .round-btn[aria-pressed="true"]:hover { background: #fff; } }
.meter { position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; border-radius: 0; background: #fff; color: var(--tinta); font-size: .8rem; font-weight: 600; }
.meter .i { width: 18px; height: 18px; }
.meter__bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.meter__bars span { width: 4px; border-radius: 0; background: var(--lavanda); height: 30%; transition: height .08s linear, background-color .08s linear; }
.meter__bars span.on { background: var(--orquidea); }

.checklist { display: grid; gap: 10px; margin-top: 18px; }
.checkrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 0; border: 1px solid var(--line); background: var(--surface); }
.checkrow__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 0; background: var(--bg-2); color: var(--ink-3); }
.checkrow__ic .i { width: 22px; height: 22px; }
.checkrow__label { font-weight: 700; font-size: .96rem; }
.checkrow__detail { font-size: .86rem; color: var(--ink-3); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 700; padding: 5px 10px; border-radius: 0; white-space: nowrap; background: var(--bg-2); color: var(--ink-3); }
.status .i { width: 16px; height: 16px; }
.status--ok { background: var(--ok-soft); color: var(--ok); }
.status--bad { background: var(--alert-soft); color: var(--alert); }
.checkrow.is-ok .checkrow__ic { background: var(--ok-soft); color: var(--ok); }
.checkrow.is-bad .checkrow__ic { background: var(--alert-soft); color: var(--alert); }
.checkrow .link-btn { font-size: .88rem; padding: 4px 2px; }

.panel { background: var(--surface); border: 2px solid var(--tinta); border-radius: 0; padding: clamp(20px, 3vw, 28px); }
.panel__hello { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.8rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.appt { margin-top: 14px; display: grid; gap: 8px; padding: 14px 16px; border-radius: 0; background: var(--perla); border-left: 4px solid var(--ciruela); }
.appt__row { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: .96rem; }
.appt__row .i { width: 20px; height: 20px; color: var(--primary); }
.room-state { margin-top: 14px; display: flex; gap: 10px; align-items: center; font-size: .95rem; font-weight: 600; color: var(--ink-2); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--orquidea); box-shadow: 0 0 0 0 color-mix(in srgb, var(--orquidea) 50%, transparent); }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 1.8s ease-out infinite; } }
@keyframes pulse { to { box-shadow: 0 0 0 10px transparent; } }
.panel__actions { display: grid; gap: 10px; margin-top: 20px; }
.help-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

.help-tabs { display: flex; gap: 0; padding: 0; border-radius: 0; border: 2px solid var(--tinta); margin-top: 16px; }
.help-tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 0; background: transparent; font-weight: 700; font-size: .92rem; color: var(--ink-2); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.help-tabs button[aria-selected="true"] { background: var(--ciruela); color: #fff; }
.help-steps { margin-top: 16px; display: grid; gap: 12px; counter-reset: h; }
.help-steps li { counter-increment: h; display: grid; grid-template-columns: 30px 1fr; gap: 12px; color: var(--ink-2); }
.help-steps li::before { content: counter(h); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 0; background: var(--malva); color: var(--ciruela); font-weight: 700; font-size: .9rem; }
.help-steps strong { color: var(--ink); }
.planb { margin-top: 18px; display: flex; gap: 12px; padding: 14px 16px; border-radius: 0; background: var(--lavanda); font-size: .95rem; }
.planb .i { width: 22px; height: 22px; color: var(--ciruela); flex: none; margin-top: 1px; }

@media (max-width: 900px) { .lobby__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Llamada ---------- */
.call-ui {
  position: fixed; inset: 0; z-index: 60; background: var(--tinta); color: #fff;
  display: grid; grid-template-rows: auto 1fr auto;
}
.call-ui[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .call-ui:not([hidden]) { animation: callIn .3s var(--ease-out) both; } }
@keyframes callIn { from { opacity: 0; } to { opacity: 1; } }
.call-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top)); font-size: .9rem; }
.call-top__secure { display: inline-flex; align-items: center; gap: 6px; color: var(--lavanda); font-weight: 600; }
.call-top__secure .i { width: 18px; height: 18px; }
.call-top__time { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; background: rgb(255 255 255 / .1); padding: 5px 10px; border-radius: 0; }
.call-top__demo { font-size: .78rem; font-weight: 700; color: var(--malva); border: 1px solid rgb(241 228 238 / .45); padding: 4px 8px; border-radius: 0; }
.call-stage { position: relative; margin: 0 14px; border-radius: 0; overflow: hidden; background: #3A3736; }
.remote { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 24px; }
.remote__avatar {
  width: clamp(110px, 18vw, 160px); aspect-ratio: 1; border-radius: 0; display: grid; place-items: center;
  background: var(--malva); color: var(--ciruela); font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.03em;
  position: relative;
}
.remote__avatar::after { content: ""; position: absolute; inset: -10px; border-radius: 0; border: 2px solid rgb(200 85 143 / .7); opacity: 0; }
.remote.is-waiting .remote__avatar { opacity: .75; }
@media (prefers-reduced-motion: no-preference) {
  .remote.is-waiting .remote__avatar::after { animation: ring 1.8s ease-out infinite; }
  .remote.is-speaking .remote__avatar::after { opacity: 1; animation: speak 1.2s ease-in-out infinite alternate; }
}
@keyframes ring { from { opacity: .9; transform: scale(.95); } to { opacity: 0; transform: scale(1.25); } }
@keyframes speak { from { transform: scale(1); } to { transform: scale(1.06); } }
.remote__name { font-size: 1.2rem; font-weight: 700; }
.remote__state { color: #D9D3DE; font-size: .95rem; }
.remote__note { margin-top: 6px; font-size: .82rem; color: #B9B2BF; max-width: 40ch; }
.self {
  position: absolute; right: 14px; bottom: 14px; width: clamp(110px, 22vw, 220px); aspect-ratio: 3 / 4; border-radius: 0; overflow: hidden;
  background: #2A2827; box-shadow: 0 10px 30px rgb(0 0 0 / .45); border: 2px solid #fff;
}
@media (min-width: 700px) { .self { aspect-ratio: 16 / 11; } }
.self video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.self__off { position: absolute; inset: 0; display: grid; place-items: center; color: #B9B2BF; }
.self__off .i { width: 30px; height: 30px; }
.call-controls { display: flex; justify-content: center; gap: 12px; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.call-controls .round-btn { width: 58px; height: 58px; }
.call-controls .round-btn--end { width: 72px; }
.toast {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 3;
  background: rgb(255 255 255 / .95); color: #0D1F35; font-weight: 600; font-size: .92rem;
  padding: 10px 16px; border-radius: 0; box-shadow: 0 10px 30px rgb(0 0 0 / .3);
  display: flex; gap: 8px; align-items: center; max-width: calc(100% - 32px);
  transition: opacity .25s ease, transform .25s var(--ease-out);
}
.toast[hidden] { opacity: 0; transform: translate(-50%, -8px); pointer-events: none; }
.toast .i { width: 18px; height: 18px; color: var(--ok); }

.ended { flex: 1; display: grid; place-items: center; padding: 48px 0; }


/* =========================================================
   Ajuste de tamaño: las páginas de producto usan un ancho propio
   (más angosto que la home) y un ritmo vertical compacto para que
   cada paso quepa completo en una pantalla de notebook (1366 x 768).
   ========================================================= */
.appbar .wrap, .demo-bar, .flow.wrap, .lobby .wrap { max-width: 1160px; }
.appbar__inner { height: 60px; }
.demo-bar { max-width: none; padding: 7px 16px; font-size: .84rem; }

.progress { margin: 18px 0 16px; }
.progress li { font-size: .8rem; gap: 6px; }
.flow { padding-bottom: 40px; }
.flow__grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.flow__main { min-height: 0; padding: clamp(20px, 2.6vw, 30px); }
.step__title { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem); }
.step__lead { margin-top: 4px; font-size: .98rem; }
.step__body { margin-top: 18px; }

/* Servicios en dos columnas en escritorio: los cinco quedan a la vista */
.options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option__box { padding: 12px 14px; gap: 2px 12px; }
.option__ic { width: 40px; height: 40px; }
.option__ic .i { width: 22px; height: 22px; }
.option__name { font-size: .98rem; }
.option__meta { font-size: .85rem; }

.date { padding: 8px 4px 10px; }
.date__num { font-size: 1.2rem; }
.dates__strip { grid-auto-columns: 68px; }
.times { margin-top: 16px; }
.time { min-height: 44px; }

.form { gap: 14px 16px; }
.input, .select { min-height: 48px; }
.field__hint { font-size: .82rem; }

.review > div { padding: 11px 16px; }
.policy { margin-top: 14px; padding: 12px 14px; font-size: .9rem; }
.consent { margin-top: 14px; }

/* La barra de acciones queda siempre visible al fondo de la tarjeta */
.flow__actions {
  position: sticky; bottom: 0; z-index: 5;
  margin: 22px calc(clamp(20px, 2.6vw, 30px) * -1) calc(clamp(20px, 2.6vw, 30px) * -1);
  padding: 14px clamp(20px, 2.6vw, 30px);
  background: var(--blanco);
}
.flow__actions .btn--lg { --h: 52px; }

.summary { top: 76px; padding: 18px; }
.summary__rows { gap: 10px; }

.done { margin-top: 20px; }
.done__mark { width: 68px; height: 68px; margin-bottom: 16px; }
.ticket { margin-top: 20px; }

/* Sala */
.lobby { padding: 20px 0 40px; }
.lobby__grid { gap: 20px; }
.preview { aspect-ratio: 16 / 10; }
.checklist { gap: 8px; margin-top: 14px; }
.checkrow { padding: 10px 12px; }
.checkrow__ic { width: 36px; height: 36px; }

@media (max-width: 900px) {
  .flow__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .options { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .flow__actions { margin: 22px -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
}
@media (max-height: 820px) and (min-width: 901px) {
  .step__lead { display: none; }
}
