/* Rocío · simulación para Pablo Aquino Inmobiliaria. Bordó y naranja tomados de su web. */
:root {
  --papel: #FBF7F4;
  --chat: #F1E8E3;
  --blanco: #FFFFFF;
  --tinta: #24151B;
  --tinta-2: #62505A;
  --linea: #E4D6CF;
  --marca: #861C3C;
  --marca-osc: #5C0F27;
  --marca-suave: #F5E6EA;
  --naranja: #F66D31;
  --naranja-tinta: #2B1204;
  --ok: #1E7A4F;
  --titulo: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  --texto: "Hanken Grotesk", system-ui, sans-serif;
  --sale: cubic-bezier(.16, 1, .3, 1);
  --vvh: 100dvh;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 400 16px/1.5 var(--texto); -webkit-font-smoothing: antialiased;
  caret-color: var(--marca); overflow-x: hidden;
}
::selection { background: var(--marca); color: #fff; }
h1, h2, h3, p, dl, dd, ol, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ol { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--naranja); outline-offset: 2px; border-radius: 6px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: #CDB7AE transparent; }

/* ---------- Entrada ---------- */
.intro { padding: 20px 20px 132px; max-width: 560px; margin: 0 auto; }
.marca { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.monograma { width: 36px; height: 36px; border-radius: 10px; background: var(--marca); color: #fff; display: grid; place-items: center; font: 700 15px/1 var(--titulo); letter-spacing: .02em; }
.marca-nombre { font-weight: 600; font-size: 15px; line-height: 1.2; }
.sello { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--marca-osc); background: var(--marca-suave); padding: 5px 10px; border-radius: 999px; }
h1 { font: 700 clamp(1.85rem, 7.4vw, 2.6rem)/1.06 var(--titulo); letter-spacing: -.025em; text-wrap: balance; }
.bajada { margin-top: 14px; color: var(--tinta-2); font-size: 1.02rem; max-width: 46ch; }
.dato { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--linea); font-size: .98rem; max-width: 46ch; }
.dato strong { color: var(--marca); font-weight: 700; }

.armado { margin-top: 28px; display: grid; gap: 22px; }
legend { font: 600 1.02rem/1.2 var(--titulo); padding: 0; margin-bottom: 10px; }
.opciones { display: grid; gap: 8px; }
.origenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.momentos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opcion { position: relative; display: block; }
.opcion input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.opcion span {
  display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 56px; padding: 9px 12px;
  background: var(--blanco); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--linea);
  transition: box-shadow .18s, background-color .18s, transform .18s var(--sale);
}
.opcion b { font-weight: 600; font-size: .97rem; line-height: 1.2; }
.opcion small { font-size: .8rem; line-height: 1.25; color: var(--tinta-2); }
.opcion input:checked + span { background: var(--marca-suave); box-shadow: inset 0 0 0 2px var(--marca); }
.opcion input:checked + span b { color: var(--marca-osc); }
.opcion input:focus-visible + span { outline: 2px solid var(--naranja); outline-offset: 2px; }
.opcion input:active + span { transform: scale(.98); }
.origenes .opcion:last-child { grid-column: 1 / -1; }
.origenes .opcion:last-child span { min-height: 48px; }

.arranque {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--papel) 72%, rgba(251, 247, 244, 0));
}
.boton { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 1.02rem; transition: transform .18s var(--sale), background-color .18s, box-shadow .18s; }
.boton:active { transform: scale(.975); }
.boton.primario { width: 100%; background: var(--naranja); color: var(--naranja-tinta); box-shadow: 0 6px 18px -8px rgba(190, 70, 15, .55); }
.boton.primario svg { transition: transform .25s var(--sale); }
.letra-chica { margin-top: 22px; font-size: .86rem; color: var(--tinta-2); max-width: 52ch; }
.firma { margin-top: 10px; font-size: .86rem; color: var(--tinta-2); }
.firma a, .enlace { color: var(--marca); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Chat ---------- */
.tel { display: none; flex-direction: column; background: var(--chat); overflow: hidden; }
body.v-chat .intro { display: none; }
body.v-chat { overflow: hidden; }
body.v-chat .tel { display: flex; position: fixed; left: 0; right: 0; top: var(--vvtop, 0px); height: var(--vvh); z-index: 10; }

.chat-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; background: var(--marca); color: #fff; flex: none; }
.icono { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; flex: none; transition: background-color .15s; }
.chat-top .icono:active { background: rgba(255, 255, 255, .16); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--marca); display: grid; place-items: center; font: 700 17px/1 var(--titulo); flex: none; }
.quien { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.quien strong { font-weight: 700; font-size: 1rem; }
.quien span { font-size: .78rem; color: #F3D9E0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver-ficha { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 12px; background: rgba(255, 255, 255, .14); font-weight: 600; font-size: .9rem; flex: none; }
.ver-ficha svg { width: 18px; height: 18px; }
.cuenta { font-weight: 700; font-size: .78rem; background: var(--naranja); color: var(--naranja-tinta); border-radius: 999px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.cuenta.pop { animation: pop .5s var(--sale); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 100% { transform: scale(1); } }

.contexto { flex: none; padding: 7px 14px; font-size: .8rem; font-weight: 500; color: var(--marca-osc); background: var(--marca-suave); text-align: center; text-wrap: balance; }

.mensajes { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 6px; outline-offset: -2px; }
.msj { max-width: 84%; padding: 8px 11px 7px; border-radius: 16px; font-size: .97rem; line-height: 1.42; overflow-wrap: anywhere; animation: entra .34s var(--sale) both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.msj time { float: right; margin: 7px 0 -2px 10px; font-size: .68rem; font-variant-numeric: tabular-nums; opacity: .72; }
.msj.sofia { align-self: flex-start; background: var(--blanco); border-bottom-left-radius: 5px; box-shadow: 0 1px 1.5px rgba(36, 21, 27, .08); }
.msj.cliente { align-self: flex-end; background: var(--marca); color: #fff; border-bottom-right-radius: 5px; }
.msj.cliente + .msj.sofia, .msj.sofia + .msj.cliente, .aviso + .msj, .msj + .aviso { margin-top: 6px; }

.escribiendo { display: inline-flex; gap: 4px; padding: 13px 14px; }
.escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: var(--tinta-2); animation: punto 1.1s infinite ease-in-out; }
.escribiendo i:nth-child(2) { animation-delay: .15s; }
.escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.aviso { align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 92%; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .72); color: var(--tinta-2); font-size: .78rem; line-height: 1.3; animation: entra .34s var(--sale) both; }
.aviso svg { width: 14px; height: 14px; stroke: var(--ok); stroke-width: 2.4; }
.aviso b { color: var(--tinta); font-weight: 600; }

/* ficha de propiedad dentro del chat */
.prop { align-self: flex-start; width: min(88%, 340px); background: var(--blanco); border-radius: 16px; border-bottom-left-radius: 5px; padding: 12px 13px 11px; box-shadow: 0 1px 1.5px rgba(36, 21, 27, .08); animation: entra .4s var(--sale) both; }
.prop-top { display: flex; align-items: center; gap: 8px; font-size: .76rem; font-weight: 600; }
.prop-top .cod { color: var(--marca-osc); background: var(--marca-suave); padding: 2px 8px; border-radius: 6px; letter-spacing: .02em; }
.prop-top .ej { color: var(--tinta-2); margin-left: auto; }
.prop h4 { margin: 9px 0 0; font: 700 1.08rem/1.2 var(--titulo); letter-spacing: -.01em; }
.prop .lugar { font-size: .86rem; color: var(--tinta-2); margin-top: 2px; }
.prop .precio { margin-top: 10px; font: 700 1.3rem/1.1 var(--titulo); color: var(--marca); letter-spacing: -.015em; }
.prop .precio small { font: 600 .78rem/1 var(--texto); color: var(--tinta-2); letter-spacing: 0; margin-left: 6px; }
.prop .cond { font-size: .86rem; margin-top: 3px; }
.prop ul { margin: 10px 0 0; padding: 9px 0 0; list-style: none; border-top: 1px solid var(--linea); display: grid; gap: 4px; font-size: .9rem; line-height: 1.35; }
.prop li { padding-left: 14px; position: relative; }
.prop li::before { content: ""; position: absolute; left: 1px; top: .58em; width: 5px; height: 5px; border-radius: 50%; background: var(--naranja); }

/* resumen interno */
.resumen { align-self: stretch; margin: 10px 0 4px; background: var(--tinta); color: #F8EFEA; border-radius: 16px; padding: 16px 16px 14px; animation: entra .5s var(--sale) both; }
.resumen h4 { margin: 0; font: 700 1.12rem/1.2 var(--titulo); letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.resumen h4::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--naranja); flex: none; }
.resumen .sub { font-size: .82rem; color: #D2BEC5; margin-top: 3px; }
.resumen dl { margin-top: 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; line-height: 1.35; }
.resumen dt { color: #D2BEC5; }
.resumen dd { font-weight: 600; overflow-wrap: anywhere; }
.resumen .acciones { margin-top: 14px; display: grid; gap: 8px; }
.resumen .boton { min-height: 48px; font-size: .96rem; width: 100%; }
.resumen .boton.claro { box-shadow: inset 0 0 0 1.5px rgba(248, 239, 234, .45); color: #F8EFEA; }
.otra { align-self: center; margin: 6px 0 4px; min-height: 46px; padding: 0 18px; border-radius: 999px; background: var(--blanco); color: var(--marca-osc); font-weight: 700; font-size: .95rem; box-shadow: 0 1px 1.5px rgba(36, 21, 27, .1); display: inline-flex; align-items: center; gap: 8px; animation: entra .5s var(--sale) both; }
.otra svg { width: 18px; height: 18px; }

.chips { flex: none; display: flex; flex-wrap: wrap; gap: 7px; padding: 6px 12px 8px; max-height: 172px; overflow-y: auto; }
.chips:empty { display: none; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; font-weight: 600; font-size: .9rem; line-height: 1.2; text-align: left; background: var(--blanco); color: var(--marca-osc); box-shadow: inset 0 0 0 1.5px #D9B5C0; transition: transform .16s var(--sale), background-color .16s; animation: entra .3s var(--sale) both; }
.chip.duda { background: transparent; color: var(--tinta-2); box-shadow: none; border: 1.5px dashed #B9A39B; }
.chip:active { transform: scale(.96); background: var(--marca-suave); }

.redactar { flex: none; display: flex; gap: 8px; align-items: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--papel); border-top: 1px solid var(--linea); }
.redactar input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 23px; border: 0; background: var(--blanco); box-shadow: inset 0 0 0 1px var(--linea); font-size: 16px; }
.redactar input::placeholder { color: #7A6670; }
.redactar input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--marca); }
.enviar { width: 46px; height: 46px; border-radius: 50%; background: var(--naranja); color: var(--naranja-tinta); display: grid; place-items: center; flex: none; transition: transform .16s var(--sale); }
.enviar:active { transform: scale(.92); }
.enviar svg { fill: currentColor; stroke: none; }

/* ---------- Lado: ficha en vivo + tablero ---------- */
.lado { background: var(--papel); padding: calc(8px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); display: none; }
body.lado-abierto .lado { display: block; position: fixed; inset: 0; z-index: 20; overflow-y: auto; overscroll-behavior: contain; animation: sube .38s var(--sale); }
@keyframes sube { from { transform: translateY(24px); opacity: 0; } }
.lado-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 44px; }
.lado h2 { font: 700 1.4rem/1.1 var(--titulo); letter-spacing: -.02em; }
.lado h3 { font: 700 1.05rem/1.2 var(--titulo); }
.ficha, .tablero { background: var(--blanco); border-radius: 16px; padding: 16px; box-shadow: 0 1px 2px rgba(36, 21, 27, .06), 0 10px 26px -18px rgba(36, 21, 27, .3); }
.tablero { margin-top: 16px; }
.ficha-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.progreso { font-size: .82rem; font-weight: 600; color: var(--marca-osc); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ficha-ayuda { font-size: .84rem; color: var(--tinta-2); margin-top: 2px; }
.ficha dl { margin-top: 10px; }
.fila { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linea); font-size: .92rem; line-height: 1.35; }
.fila dt { color: var(--tinta-2); }
.fila dd { font-weight: 600; overflow-wrap: anywhere; }
.fila.falta dd { font-weight: 400; color: #7A6670; }
.fila.nuevo dd { animation: llena .7s var(--sale) both; }
.fila.nuevo { animation: marca 1.6s ease-out both; }
@keyframes llena { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes marca { from { background: #FDE6DA; box-shadow: -8px 0 0 #FDE6DA, 8px 0 0 #FDE6DA; } to { background: transparent; box-shadow: -8px 0 0 transparent, 8px 0 0 transparent; } }
.fila dd span { display: block; }
.fila dd span + span { margin-top: 3px; }

.tablero-numeros { font-size: .88rem; color: var(--tinta-2); margin-top: 4px; }
.tablero-numeros b { color: var(--tinta); font-variant-numeric: tabular-nums; }
.fichas { margin-top: 10px; display: grid; }
.fichas li { padding: 11px 0; border-top: 1px solid var(--linea); display: grid; gap: 2px; font-size: .9rem; line-height: 1.35; }
.fichas .arriba { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fichas .nombre { font-weight: 700; font-size: .98rem; }
.fichas .cuando { font-size: .78rem; color: var(--tinta-2); white-space: nowrap; }
.fichas .tipo { font-size: .76rem; font-weight: 700; color: var(--ok); }
.fichas .tipo.tas { color: var(--marca); }
.fichas .gris { color: var(--tinta-2); }
.vacio { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--linea); font-size: .9rem; color: var(--tinta-2); }
.enlace { font-size: .86rem; min-height: 44px; padding: 0 4px; }

/* ---------- Escritorio: las tres cosas a la vista ---------- */
@media (min-width: 1200px) {
  .solo-movil { display: none !important; }
  body, body.v-chat { overflow: auto; }
  .escena { min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 440px) 400px minmax(320px, 400px); justify-content: center; align-items: start; gap: clamp(28px, 4vw, 64px); padding: 36px 32px; }
  .intro, body.v-chat .intro { display: block; padding: 8px 0 0; margin: 0; max-width: none; }
  h1 { font-size: clamp(2.1rem, 2.9vw, 2.75rem); }
  .arranque { position: static; padding: 0; background: none; }
  .boton.primario:hover { background: #FF7C42; }
  .boton.primario:hover svg { transform: translateX(4px); }
  .opcion span:hover { box-shadow: inset 0 0 0 1px #C9AFA6; }
  .opcion input:checked + span:hover { box-shadow: inset 0 0 0 2px var(--marca); }
  .tel, body.v-chat .tel { display: flex; position: sticky; top: 36px; left: auto; right: auto; height: min(800px, calc(100dvh - 72px)); border-radius: 38px; border: 9px solid var(--tinta); box-shadow: 0 2px 4px rgba(36, 21, 27, .1), 0 40px 70px -38px rgba(92, 15, 39, .5); z-index: 1; }
  .chat-top { padding: 10px 8px 10px 14px; }
  .chat-top .icono:hover { background: rgba(255, 255, 255, .14); }
  .chip:hover { background: var(--marca-suave); }
  .chip.duda:hover { background: rgba(255, 255, 255, .6); }
  .lado, body.lado-abierto .lado { display: block; position: static; padding: 8px 0 0; overflow: visible; animation: none; background: none; }
  .lado-top { margin-bottom: 16px; min-height: 0; }
  .resumen .boton.claro:hover { background: rgba(248, 239, 234, .1); }
  .otra:hover { background: var(--marca-suave); }
}
@media (max-width: 359px) {
  .quien span { display: none; }
  .origenes { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
