/* Venado por día — sitio público
   Concepto: la llave es un código. El teclado de la cerradura es el elemento de marca.
   Paleta pampeana: noche, cielo, pasto (abierto/libre), trigo (acento escaso). */
:root {
  --noche: #14213d; --noche-2: #22335a; --cielo: #eaf1f6; --nube: #ffffff; --borde: #d5e0e8;
  --pasto: #2f8f5b; --pasto-claro: #dff1e6; --trigo: #e9b949; --trigo-claro: #fbf0d3;
  --niebla: #5b6b7b; --alerta: #b5452f;
  --fuente: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tab: 84px;
  --resorte: cubic-bezier(.22, 1.2, .36, 1);
  --suave: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--cielo); color: var(--noche); font: 400 16px/1.5 var(--fuente); font-optical-sizing: auto;
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom)); -webkit-font-smoothing: antialiased; }
body.trabado { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; }
main { max-width: 600px; margin: 0 auto; }
:focus-visible { outline: 3px solid var(--trigo); outline-offset: 2px; border-radius: 8px; }

/* ================= hero con teclado ================= */
.hero { background: var(--noche); color: var(--cielo); padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 4.2rem;
  border-radius: 0 0 36px 36px; position: relative; }
.marca { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }
.marca img { width: 32px; height: 32px; border-radius: 9px; }

.teclado { margin: 2.2rem 0 1.6rem; display: flex; align-items: center; gap: .9rem; }
.pantalla { display: flex; gap: 6px; padding: 10px; background: var(--noche-2); border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(234,241,246,.08);
  transition: box-shadow .5s var(--suave), background .5s var(--suave); }
.pantalla span { width: 30px; height: 42px; border-radius: 9px; background: rgba(234,241,246,.06); display: grid; place-items: center;
  font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cielo); }
.pantalla span.on { animation: tecla .32s var(--resorte); background: rgba(234,241,246,.14); }
@keyframes tecla { 0% { transform: translateY(6px) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
.candado { width: 44px; height: 44px; flex: 0 0 44px; fill: none; stroke: var(--cielo); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s; }
.candado .arco { transform-origin: 16px 11px; transition: transform .55s var(--resorte); }
.teclado.abierto .pantalla { background: var(--pasto); box-shadow: 0 0 0 6px rgba(47,143,91,.25), 0 12px 40px -8px rgba(47,143,91,.7); }
.teclado.abierto .pantalla span { background: rgba(255,255,255,.16); }
.teclado.abierto .candado { stroke: #7fd6a3; }
.teclado.abierto .candado .arco { transform: translateY(-3px) rotate(28deg); }

.hero h1 { font-size: clamp(2.3rem, 10.5vw, 3.4rem); font-weight: 800; max-width: 12ch; font-stretch: 90%; }
.hero p { margin: .9rem 0 0; color: rgba(234,241,246,.72); max-width: 34ch; font-size: 1.02rem; }

/* buscador flotante que muerde el borde del hero */
.buscador { position: absolute; left: 1.25rem; right: 1.25rem; bottom: -34px; display: flex; background: var(--nube); color: var(--noche);
  border-radius: 22px; box-shadow: 0 18px 40px -18px rgba(20,33,61,.45); z-index: 2; overflow: hidden; }
.buscador button { flex: 1; text-align: left; padding: .8rem 1.1rem; display: flex; flex-direction: column; gap: 1px; transition: background .2s; }
.buscador button:active { background: var(--cielo); }
.buscador button + button { border-left: 1px solid var(--borde); flex: 0 0 32%; }
.buscador small { font-size: .78rem; color: var(--niebla); }
.buscador b { font-weight: 600; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= casas ================= */
.titulo-seccion { padding: 3.6rem 1.25rem .9rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.titulo-seccion h2 { font-size: 1.6rem; }
.titulo-seccion button { font-size: .92rem; color: var(--niebla); text-decoration: underline; text-underline-offset: 3px; }
.casas { padding: 0 1.25rem; display: grid; gap: 1.75rem; }
.casa { cursor: pointer; }
.casa.no-disp .fotos { filter: grayscale(.85) brightness(.9); }
.casa.no-disp .casa-info { opacity: .6; }
.fotos { position: relative; aspect-ratio: 4 / 4.6; border-radius: 30px; overflow: hidden; background: var(--noche-2); }
.casa .fotos { transition: transform .35s var(--suave); }
.casa:active .fotos { transform: scale(.98); }
.carrusel { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carrusel::-webkit-scrollbar { display: none; }
.carrusel > * { flex: 0 0 100%; scroll-snap-align: center; height: 100%; width: 100%; object-fit: cover; }
.foto-vacia { display: grid; place-items: center; color: rgba(234,241,246,.18); font-size: 9rem; font-weight: 800; letter-spacing: -.06em;
  background: radial-gradient(120% 80% at 20% 0%, #2e4677, var(--noche) 70%); }
/* velo inferior para que el nombre se lea sobre cualquier foto */
.fotos::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(12,20,38,.78)); pointer-events: none; }
.casa-sobre { position: absolute; left: 1.2rem; right: 1.2rem; bottom: 1.15rem; z-index: 1; color: #fff; pointer-events: none; }
.casa-sobre h3 { font-size: 2rem; font-weight: 800; font-stretch: 90%; }
.casa-sobre span { display: block; margin-top: .25rem; opacity: .85; font-size: .98rem; }
.puntos { position: absolute; top: 1rem; right: 1rem; display: flex; gap: 4px; z-index: 1; }
.puntos i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.5); transition: width .3s var(--suave), background .3s; }
.puntos i.on { background: #fff; width: 18px; }
.etiqueta { position: absolute; top: 1rem; left: 1rem; z-index: 1; display: inline-flex; align-items: center; gap: .4rem; background: var(--nube); color: var(--noche);
  padding: .38rem .75rem; border-radius: 99px; font-size: .86rem; font-weight: 600; }
.etiqueta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--niebla); }
.etiqueta.libre::before { background: var(--pasto); box-shadow: 0 0 0 3px var(--pasto-claro); }
.etiqueta.ocupada::before { background: var(--alerta); }
.casa-info { padding: .9rem .3rem 0; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chips span { font-size: .85rem; color: var(--noche); background: var(--nube); border: 1px solid var(--borde); padding: .25rem .65rem; border-radius: 99px; }
.precio { display: flex; justify-content: space-between; align-items: center; margin-top: .8rem; }
.precio b { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.precio small { color: var(--niebla); font-size: .92rem; }

/* cómo funciona: es una secuencia real, por eso va numerada */
.como { margin: 3rem 1.25rem 1rem; padding: 1.6rem 1.3rem; background: var(--nube); border-radius: 30px; }
.como h2 { font-size: 1.45rem; margin-bottom: 1.1rem; }
.como ol { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: grid; gap: 1.1rem; }
.como li { counter-increment: paso; display: grid; grid-template-columns: 40px 1fr; gap: .9rem; align-items: start; }
.como li::before { content: counter(paso); width: 40px; height: 40px; border-radius: 12px; background: var(--cielo); display: grid; place-items: center; font-weight: 700; }
.como li:last-child::before { background: var(--pasto); color: #fff; }
.como b { display: block; font-weight: 600; }
.como span { color: var(--niebla); font-size: .95rem; }

/* ================= botones ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .95rem 1.35rem; border-radius: 16px; font-weight: 600;
  text-decoration: none; transition: transform .15s var(--suave), filter .2s; }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--noche); color: var(--cielo); }
.btn.terra { background: var(--trigo); color: var(--noche); }
.btn.wa { background: #1fa855; color: #fff; }
.btn.sec { background: var(--cielo); color: var(--noche); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .4; transform: none; }
.btn.chico { padding: .55rem .95rem; font-size: .92rem; border-radius: 12px; }

/* ================= barra de pestañas flotante ================= */
.tabbar { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; gap: 4px; padding: 6px; background: rgba(20,33,61,.92); backdrop-filter: blur(16px) saturate(1.4); border-radius: 99px;
  box-shadow: 0 14px 34px -12px rgba(20,33,61,.6); }
.tabbar button { display: flex; align-items: center; gap: .45rem; padding: .7rem 1.15rem; border-radius: 99px; color: rgba(234,241,246,.65);
  font-size: .95rem; font-weight: 500; white-space: nowrap; transition: background .3s var(--suave), color .3s; }
.tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.tabbar button.on { background: var(--cielo); color: var(--noche); font-weight: 600; }

/* ================= hoja inferior ================= */
.velo { position: fixed; inset: 0; background: rgba(12,20,38,.5); backdrop-filter: blur(2px); z-index: 40; animation: aparece .25s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--nube); z-index: 50;
  border-radius: 30px 30px 0 0; padding: .6rem 1.35rem calc(1.4rem + env(safe-area-inset-bottom)); max-width: 600px; margin: 0 auto;
  animation: sube .45s var(--resorte); overscroll-behavior: contain; transition: transform .2s; }
.agarre { width: 42px; height: 5px; background: var(--borde); border-radius: 3px; margin: 0 auto 1rem; }
.sheet h2 { font-size: 1.75rem; margin-bottom: .35rem; }
.sheet .bajada { color: var(--niebla); margin: 0 0 1.2rem; }
#sheet-body > * { animation: entra .35s var(--suave) both; }
@keyframes sube { from { transform: translateY(100%); } }
@keyframes aparece { from { opacity: 0; } }
@keyframes entra { from { opacity: 0; transform: translateX(14px); } }

/* ================= detalle de casa ================= */
.detalle { position: fixed; inset: 0; background: var(--cielo); z-index: 30; overflow-y: auto; padding-bottom: 120px; animation: detalle .45s var(--suave); }
@keyframes detalle { from { opacity: 0; transform: scale(.96); } }
.detalle .fotos { aspect-ratio: auto; height: 58vh; border-radius: 0 0 36px 36px; }
.detalle .fotos::after { display: none; }
.volver { position: fixed; top: calc(.9rem + env(safe-area-inset-top)); left: .9rem; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 32; box-shadow: 0 4px 14px rgba(12,20,38,.18); }
.volver svg { width: 22px; height: 22px; fill: none; stroke: var(--noche); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.detalle-cuerpo { padding: 1.5rem 1.35rem; max-width: 600px; margin: 0 auto; }
.detalle-cuerpo h1 { font-size: 2.5rem; font-weight: 800; font-stretch: 90%; }
.detalle-cuerpo h3 { font-size: 1.2rem; margin: 1.8rem 0 .6rem; }
.detalle-cuerpo p { color: #34445a; max-width: 62ch; }
.datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1.3rem 0; }
.datos div { background: var(--nube); border-radius: 18px; padding: .85rem .5rem; text-align: center; }
.datos b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.datos small { color: var(--niebla); font-size: .85rem; }
.entrar-sin-llave { display: flex; gap: .9rem; align-items: center; background: var(--noche); color: var(--cielo); border-radius: 22px; padding: 1.1rem; margin-top: 1.6rem; }
.entrar-sin-llave svg { width: 40px; height: 40px; flex: 0 0 40px; fill: none; stroke: #7fd6a3; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.entrar-sin-llave p { margin: 0; color: rgba(234,241,246,.8); font-size: .95rem; }
.entrar-sin-llave b { color: #fff; display: block; font-size: 1.02rem; }
.barra-reserva { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(14px); z-index: 31;
  padding: .9rem 1.35rem calc(.9rem + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: 26px 26px 0 0; box-shadow: 0 -10px 30px -18px rgba(20,33,61,.35); animation: sube .5s .1s var(--resorte) both; }
.barra-reserva .total { text-align: left; }
.barra-reserva .total b { font-size: 1.25rem; display: block; font-variant-numeric: tabular-nums; }
.barra-reserva .total small { color: var(--niebla); text-decoration: underline; text-underline-offset: 3px; }

/* ================= calendario ================= */
.cal-cab { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .82rem; color: var(--niebla); position: sticky; top: -.6rem;
  background: var(--nube); padding: .45rem 0; z-index: 1; }
.cal-mes { margin-bottom: 1.3rem; }
.cal-mes h4 { font-size: 1.1rem; font-weight: 700; margin: .7rem 0 .45rem .3rem; }
.cal-mes h4::first-letter { text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
.cal-grid button { aspect-ratio: 1; display: grid; place-items: center; font-size: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; position: relative; }
.cal-grid button span { width: 86%; height: 86%; display: grid; place-items: center; border-radius: 14px; transition: background .2s, color .2s, transform .25s var(--resorte); }
.cal-grid button:not(:disabled):active span { transform: scale(.88); }
.cal-grid button:disabled { color: #b4c0cb; cursor: default; }
.cal-grid button.ocup span { text-decoration: line-through; text-decoration-color: #c9d3dc; }
.cal-grid button.rango { background: var(--pasto-claro); }
.cal-grid button.ini { background: linear-gradient(90deg, transparent 50%, var(--pasto-claro) 50%); }
.cal-grid button.fin { background: linear-gradient(90deg, var(--pasto-claro) 50%, transparent 50%); }
.cal-grid button.ini.fin { background: none; }
.cal-grid button.ini span, .cal-grid button.fin span { background: var(--noche); color: #fff; animation: marca .35s var(--resorte); }
@keyframes marca { from { transform: scale(.6); } }
.cal-grid button.hoy span { box-shadow: inset 0 0 0 1.5px var(--trigo); }
.cal-scroll { max-height: 52vh; overflow-y: auto; margin: 0 -.2rem; padding: 0 .2rem; }
.cal-pie { display: flex; gap: .7rem; align-items: center; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--borde); margin-top: .4rem; }
.cal-pie button.limpiar { text-decoration: underline; text-underline-offset: 3px; color: var(--niebla); }

.contador { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0 1.4rem; }
.contador .ctrl { display: flex; align-items: center; gap: 1.1rem; }
.contador .ctrl button { width: 44px; height: 44px; border-radius: 14px; background: var(--cielo); font-size: 1.3rem; transition: transform .15s; }
.contador .ctrl button:active { transform: scale(.9); }
.contador .ctrl b { min-width: 1.6rem; text-align: center; font-size: 1.5rem; font-variant-numeric: tabular-nums; }

/* ================= formularios ================= */
.campo { display: flex; align-items: center; background: var(--cielo); border: 2px solid transparent; border-radius: 18px; padding: 0 1.1rem; margin-bottom: .8rem;
  transition: border-color .2s, background .2s; }
.campo:focus-within { border-color: var(--noche); background: var(--nube); }
.campo span { color: var(--niebla); font-weight: 500; padding-right: .45rem; white-space: nowrap; }
.campo input, .campo textarea { flex: 1; border: 0; outline: 0; background: transparent; padding: 1.05rem 0; font-size: 1.15rem; min-width: 0; resize: none; }
.campo textarea { font-size: 1rem; }
.otp { text-align: center; letter-spacing: .55em; font-size: 2rem !important; font-weight: 700; padding-left: .55em !important; font-variant-numeric: tabular-nums; }
.error { color: var(--alerta); font-size: .92rem; min-height: 1.3rem; margin: .2rem 0 .7rem; }
.error.sacude { animation: sacude .4s; }
@keyframes sacude { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.nota { font-size: .9rem; color: var(--niebla); text-align: center; margin: 1rem 0 0; }
.nota button { text-decoration: underline; text-underline-offset: 3px; color: var(--noche); font-weight: 600; }
.resumen { display: flex; gap: 1rem; align-items: center; background: var(--cielo); padding: .8rem; border-radius: 20px; margin-bottom: 1.1rem; }
.resumen .mini { width: 68px; height: 68px; border-radius: 14px; object-fit: cover; flex: 0 0 68px; background: var(--noche); color: rgba(234,241,246,.4);
  display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; }
.resumen b { display: block; font-size: 1.1rem; }
.resumen small { color: var(--niebla); font-size: .9rem; }
.pasos { display: flex; gap: 6px; margin-bottom: 1.1rem; }
.pasos i { flex: 1; height: 4px; border-radius: 2px; background: var(--borde); overflow: hidden; position: relative; }
.pasos i.on::after { content: ""; position: absolute; inset: 0; background: var(--noche); animation: llena .5s var(--suave) both; transform-origin: left; }
@keyframes llena { from { transform: scaleX(0); } }

/* ================= confirmación ================= */
.exito { text-align: center; padding: .6rem 0 .2rem; }
.exito svg.ok { width: 96px; height: 96px; margin: 0 auto 1rem; display: block; }
.exito svg.ok circle { fill: var(--pasto-claro); stroke: var(--pasto); stroke-width: 3; stroke-dasharray: 280; stroke-dashoffset: 280; animation: traza .7s var(--suave) forwards; }
.exito svg.ok path { fill: none; stroke: var(--pasto); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: traza .45s .55s var(--suave) forwards; }
@keyframes traza { to { stroke-dashoffset: 0; } }
.exito h2 { animation: entra .4s .7s var(--suave) both; }

/* ================= mi estadía ================= */
.cab-simple { padding: calc(1.6rem + env(safe-area-inset-top)) 1.35rem .3rem; display: flex; justify-content: space-between; align-items: center; }
.cab-simple h1 { font-size: 2.3rem; font-weight: 800; font-stretch: 90%; }
.cab-simple button { color: var(--niebla); text-decoration: underline; text-underline-offset: 3px; }
.estadia { margin: 1.1rem 1.25rem 1.6rem; background: var(--nube); border-radius: 30px; overflow: hidden; }
.estadia .portada { height: 140px; background: radial-gradient(120% 90% at 20% 0%, #2e4677, var(--noche) 70%) center / cover; position: relative; }
.estadia .portada .etiqueta { top: auto; bottom: .9rem; }
.estadia-cuerpo { padding: 1.2rem 1.25rem 1.3rem; }
.estadia h3 { font-size: 1.6rem; font-weight: 800; }
.fechas { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; margin: 1rem 0; }
.fechas > div { background: var(--cielo); border-radius: 18px; padding: .75rem .8rem; }
.fechas > div:last-child { text-align: right; }
.fechas small { display: block; font-size: .82rem; color: var(--niebla); }
.fechas b { font-size: 1.2rem; display: block; }
.fechas .flecha { color: var(--niebla); font-size: .85rem; text-align: center; }
.llave { background: var(--noche); color: var(--cielo); border-radius: 24px; padding: 1.3rem 1rem 1.2rem; margin: 1rem 0; text-align: center; }
.llave small { color: rgba(234,241,246,.7); font-size: .9rem; }
.digitos { display: flex; justify-content: center; gap: 6px; margin: .8rem 0 .9rem; }
.digitos span { width: 40px; height: 54px; border-radius: 12px; background: var(--noche-2); display: grid; place-items: center; font-size: 1.75rem; font-weight: 700;
  font-variant-numeric: tabular-nums; animation: tecla .4s var(--resorte) both; }
.llave.lista .digitos span { background: var(--pasto); }
.llave .estado { font-size: .92rem; color: rgba(234,241,246,.85); }
.llave.espera { background: var(--cielo); color: var(--noche); }
.llave.espera p { margin: .4rem 0 0; }
.pulso { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--trigo); margin-right: .4rem; vertical-align: middle; animation: pulso 1.4s infinite; }
@keyframes pulso { 50% { opacity: .2; transform: scale(.7); } }
.fila-info { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .85rem 0; border-top: 1px solid var(--borde); }
.fila-info small { display: block; color: var(--niebla); font-size: .85rem; }
.vacio { text-align: center; padding: 3rem 1.5rem; color: var(--niebla); }
.vacio svg { width: 64px; height: 64px; fill: none; stroke: var(--noche); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: .6rem; }
.vacio p { max-width: 30ch; margin: 0 auto 1.2rem; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab) + 10px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--noche); color: #fff;
  padding: .75rem 1.15rem; border-radius: 14px; z-index: 70; font-size: .95rem; max-width: 90vw; animation: toast .4s var(--resorte); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } }

@media (min-width: 720px) {
  .sheet { bottom: 50%; transform: translateY(50%); border-radius: 30px; animation: aparece .25s; }
  .fotos { aspect-ratio: 16 / 11; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
