/* Cotiza con Ana Paula · Total Glass Solution
   Sistema visual de TGS (P003) en su versión cálida de la landing: noche cálida + ámbar, azul de marca solo en acciones.
   Nunca texto blanco sobre #159EFF: los botones azules llevan tinta oscura. */
@font-face { font-family: "Bebas Neue"; src: url("fuentes/bebas-neue-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fuentes/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --canvas: #15101A; --panel: #1E1724; --panel-2: #271E2E; --line: #3B2F42; --line-strong: #5A4A62;
  --accent: #159EFF; --accent-hover: #4DB5FF; --accent-muted: rgba(21,158,255,.14); --tinta: #03051A;
  --amber: #F2B36A; --warm: #FFC27A; --amber-muted: rgba(242,179,106,.12);
  --text: #FBF4EA; --text-2: #DCCFC2; --text-3: #AE9B8C; --error: #FF9A8A; --ok: #8BD9A6; --wa: #1FA855;
  --display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16,1,.3,1);
  --radio: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--canvas); color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  background-image:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(242,179,106,.13), transparent 70%),
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(21,158,255,.08), transparent 70%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.salto { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--tinta); padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.salto:focus { left: 12px; }
[hidden] { display: none !important; }

/* Barra superior */
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 600px; margin: 0 auto; }
.barra .logo { height: 34px; width: auto; }
.sello { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(242,179,106,.3); border-radius: 99px; padding: 4px 11px; white-space: nowrap; }

main { max-width: 600px; margin: 0 auto; padding: 4px 16px 120px; }

/* Portada */
.portada { padding-top: 8px; }
.portada .foto-ana { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 150px; align-items: end; height: 200px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(ellipse 120% 90% at 100% 0%, rgba(242,179,106,.22), transparent 60%), var(--panel); }
.portada .foto-ana img { grid-column: 2; grid-row: 1; width: 150px; height: 200px; object-fit: cover; object-position: 50% 18%; }
.portada .placa { grid-column: 1; grid-row: 1; padding: 16px; align-self: center; }
.portada .placa strong { display: block; font-family: var(--display); font-weight: 400; font-size: 2.1rem; line-height: 1; color: var(--warm); }
.portada .placa span { display: block; margin-top: 6px; font-size: .82rem; color: var(--text-2); line-height: 1.4; }
.portada .placa em { display: block; margin-top: 10px; font-style: normal; font-size: .9rem; color: var(--text); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.02; margin: 0; }
h1 { font-size: clamp(2.4rem, 10vw, 3.4rem); margin-top: 20px; }
h1 em { font-style: normal; color: var(--warm); }
.portada p.sub { color: var(--text-2); margin: 12px 0 22px; font-size: 1.02rem; }
.confianza { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.confianza li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: .92rem; }
.confianza li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--amber-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2B36A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent; font-weight: 800; font-size: .95rem; letter-spacing: .02em; text-decoration: none; cursor: pointer; transition: background .2s, box-shadow .2s, border-color .2s, opacity .2s; }
.btn.principal { background: var(--accent); color: var(--tinta); width: 100%; }
.btn.principal:hover { background: var(--accent-hover); box-shadow: 0 6px 26px rgba(21,158,255,.28); }
.btn.secundario { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.secundario:hover { border-color: var(--text-3); }
.btn.wa { background: var(--wa); color: #fff; width: 100%; }
.btn.wa:hover { background: #188a46; box-shadow: 0 6px 26px rgba(31,168,85,.28); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.enlace { background: none; border: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 0; font-size: .92rem; }

/* Pasos */
.progreso { margin: 6px 0 18px; }
.progreso .riel { height: 4px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.progreso .riel i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--accent)); transition: width .5s var(--ease); }
.progreso small { display: block; margin-top: 8px; color: var(--text-3); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }

.ana-dice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.ana-dice img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(242,179,106,.5); flex: none; }
.ana-dice .globo { background: var(--panel); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 10px 14px; color: var(--text-2); font-size: .95rem; animation: subir .35s var(--ease) both; }
.ana-dice .globo b { color: var(--text); }
h2 { font-size: clamp(2rem, 8.5vw, 2.6rem); margin-bottom: 16px; }
h2:focus { outline: none; }

.mosaicos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mosaico { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 112px; padding: 14px; border-radius: var(--radio); background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.mosaico svg { width: 40px; height: 40px; stroke: var(--amber); }
.mosaico span { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.mosaico small { display: block; color: var(--text-3); font-weight: 500; font-size: .78rem; }
.mosaico:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.mosaico[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-muted); }
.mosaico[aria-pressed="true"] svg { stroke: var(--accent); }
.mosaico[aria-pressed="true"]::after { content: ""; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2303051A' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 13px no-repeat; }

.grupo { margin: 0 0 18px; border: 0; padding: 0; }
.grupo legend, .campo > span { display: block; font-weight: 700; margin-bottom: 8px; font-size: .95rem; }
.fichas { display: flex; flex-wrap: wrap; gap: 8px; }
.ficha { min-height: 44px; padding: 0 16px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: .9rem; transition: background .2s, border-color .2s, color .2s; }
.ficha:hover { border-color: var(--line-strong); }
.ficha[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--tinta); }

.campo { display: block; margin-bottom: 14px; }
.entrada { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.entrada::placeholder { color: var(--text-3); opacity: .7; }
.entrada:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.entrada[aria-invalid="true"] { border-color: var(--error); }
select.entrada { 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='%23AE9B8C' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.dos { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.medida { position: relative; }
.medida .unidad { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .85rem; pointer-events: none; }
.error { color: var(--error); font-size: .85rem; margin: 6px 0 0; }
.nota { color: var(--text-3); font-size: .85rem; margin: 8px 0 0; }
.consejo { display: flex; gap: 10px; background: var(--amber-muted); border: 1px solid rgba(242,179,106,.22); border-radius: 12px; padding: 12px 14px; color: var(--text-2); font-size: .88rem; margin: 6px 0 16px; }
.consejo b { color: var(--warm); }
.casilla { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: var(--text-2); margin: 6px 0 8px; cursor: pointer; }
.casilla input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.casilla a { color: var(--text); }

/* Foto */
.subir { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; border: 1.5px dashed var(--line-strong); border-radius: 20px; background: var(--panel); cursor: pointer; text-align: center; padding: 24px; transition: border-color .2s, background .2s; }
.subir:hover, .subir:focus-within { border-color: var(--amber); background: var(--panel-2); }
.subir svg { width: 46px; height: 46px; stroke: var(--amber); }
.subir strong { font-size: 1.02rem; }
.subir small { color: var(--text-3); }
.subir input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.subir-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subir-dos .subir { min-height: 180px; padding: 18px 12px; }
.vista { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.vista img { width: 100%; max-height: 420px; object-fit: cover; }
.vista .cambiar { position: absolute; right: 10px; bottom: 10px; min-height: 40px; padding: 0 14px; border-radius: 99px; background: rgba(21,16,26,.82); border: 1px solid var(--line-strong); font-weight: 700; font-size: .85rem; cursor: pointer; backdrop-filter: blur(8px); }

/* Resultado */
.render { position: relative; margin: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); min-height: 260px; }
.render img { width: 100%; }
.render figcaption { padding: 10px 14px; font-size: .8rem; color: var(--text-3); border-top: 1px solid var(--line); }
.render .marca { position: absolute; top: 10px; left: 10px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: rgba(21,16,26,.8); border: 1px solid var(--line-strong); border-radius: 99px; padding: 4px 10px; color: var(--warm); }
.cargando { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 260px; padding: 24px; text-align: center; color: var(--text-2); }
.cargando .vidrio { width: 72px; height: 96px; border-radius: 6px; border: 2px solid var(--accent); background: linear-gradient(110deg, transparent 30%, rgba(21,158,255,.35) 45%, transparent 60%) 0 0 / 250% 100%; animation: brillo 1.6s linear infinite; }
.resumen { white-space: pre-wrap; font-family: var(--body); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--text-2); font-size: .9rem; margin: 14px 0; }
.acciones { display: grid; gap: 10px; margin-top: 16px; }

/* Navegación inferior */
.navegar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(21,16,26,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.navegar .dentro { max-width: 568px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; }
.navegar .btn.secundario { padding: 0 18px; }

/* Chat */
.chat-boton { position: fixed; right: 16px; bottom: 92px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; min-height: 56px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0,0,0,.4); cursor: pointer; font-weight: 700; font-size: .9rem; }
.chat-boton img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
body.sin-navegar .chat-boton { bottom: 20px; }
.chat { position: fixed; z-index: 60; inset: 0; display: flex; flex-direction: column; background: var(--canvas); }
@media (min-width: 640px) {
  .chat { inset: auto 20px 20px auto; width: 380px; height: min(620px, calc(100vh - 40px)); border-radius: 20px; border: 1px solid var(--line-strong); box-shadow: 0 24px 70px rgba(0,0,0,.55); overflow: hidden; }
}
.chat header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.chat header img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat header div { flex: 1; min-width: 0; }
.chat header strong { display: block; }
.chat header small { color: var(--text-3); font-size: .78rem; }
.chat .cerrar { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 1.3rem; line-height: 1; }
.chat .mensajes { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .95rem; animation: subir .3s var(--ease) both; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.ana { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.cliente { align-self: flex-end; background: var(--accent); color: var(--tinta); border-top-right-radius: 4px; font-weight: 600; }
.msg.cliente img { border-radius: 10px; max-height: 180px; }
.msg a { color: inherit; }
.escribiendo { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: punto 1.2s ease-in-out infinite; }
.escribiendo i:nth-child(2) { animation-delay: .2s; } .escribiendo i:nth-child(3) { animation-delay: .4s; }
.chat .sugerencias { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 10px; }
.chat form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
.chat form .entrada { min-height: 46px; }
.icono { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; display: grid; place-items: center; }
.icono svg { width: 22px; height: 22px; stroke: var(--text-2); }
.icono.enviar { background: var(--accent); border-color: var(--accent); }
.icono.enviar svg { stroke: var(--tinta); }

footer { max-width: 600px; margin: 0 auto; padding: 8px 16px 140px; color: var(--text-3); font-size: .8rem; }
footer a { color: var(--text-2); }

/* Página de imagen compartida */
.pagina-render main.render-solo { padding: 20px 16px 40px; display: grid; gap: 16px; }
.pagina-render .logo { height: 36px; width: auto; }
.pagina-render figure { margin: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.pagina-render figcaption { padding: 10px 14px; font-size: .82rem; color: var(--text-3); }

@keyframes subir { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes brillo { to { background-position: -250% 0; } }
@keyframes punto { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Aviso de privacidad */
.aviso h1 { font-size: clamp(2.2rem, 9vw, 3rem); margin-top: 8px; }
.aviso h2 { font-size: 1.6rem; margin: 22px 0 6px; }
.aviso p { color: var(--text-2); }

/* Dentro del flujo, en celular, el botón del chat se encoge para no tapar las opciones */
@media (max-width: 639px) {
  body.en-flujo .chat-boton { padding: 6px; }
  body.en-flujo .chat-boton span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Dictado por voz */
.dictar { display: inline-flex; align-items: center; gap: 8px; margin: -4px 0 14px; }
.dictar svg { width: 18px; height: 18px; stroke: var(--amber); }
.dictar.grabando, .icono.grabando { border-color: var(--error); background: rgba(248,113,113,.14); }
.dictar.grabando svg, .icono.grabando svg { stroke: var(--error); }
.dictar.grabando span::after { content: ' · escuchando…'; }
@media (max-width: 420px) { #form-chat { gap: 6px; } #form-chat .icono { width: 40px; height: 40px; } }

/* Chat completo: todo lo lleva Ana Paula */
.chat.completo { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; box-shadow: none; }
.chat.completo header, .chat.completo .mensajes, .chat.completo .sugerencias, .chat.completo form { width: 100%; max-width: 760px; margin-inline: auto; }
.chat.completo header { border-inline: 1px solid var(--line); }
.msg.con-imagen { max-width: 96%; }
.msg .render { margin: 10px 0 0; min-height: 0; }
.msg .acciones { margin-top: 12px; }
.msg .legal { display: block; color: var(--text-3); font-size: .78rem; line-height: 1.4; }
.ficha.destacada { background: var(--amber); border-color: var(--amber); color: var(--tinta); font-weight: 800; }
body.solo-chat .chat-boton span { position: static; width: auto; height: auto; clip: auto; }

/* Interfaz del chat, pensada para el celular (30-nov-2026) */
body.solo-chat #portada ~ * .chat-boton, body.solo-chat .chat-boton { display: none; }
.avance { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--panel); scrollbar-width: none; }
.avance::-webkit-scrollbar { display: none; }
.avance span { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--text-3); white-space: nowrap; }
.avance span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.avance span.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.avance span.ok::before { background: currentColor; }
.chat.completo .avance { width: 100%; max-width: 760px; margin-inline: auto; }
.msg .mini { display: block; width: 132px; max-height: 132px; object-fit: cover; border-radius: 10px; margin-bottom: 6px; }
.msg .render img { max-height: 56vh; width: 100%; object-fit: contain; background: #0c0a10; cursor: zoom-in; }
.msg .render figcaption { font-size: .74rem; }
.estado-voz { margin: 0; padding: 8px 14px; font-size: .85rem; font-weight: 700; color: var(--tinta); background: var(--amber); text-align: center; }
.estado-voz.grabando { background: var(--error); }
.acciones-chat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 12px 0; background: var(--panel); border-top: 1px solid var(--line); }
.accion { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel-2); font-weight: 700; font-size: .84rem; cursor: pointer; }
.accion svg { width: 19px; height: 19px; stroke: var(--amber); flex: none; }
.accion.grabando { border-color: var(--error); background: rgba(255,154,138,.16); }
.accion.grabando svg { stroke: var(--error); }
.accion[hidden] { display: none; }
.chat form { border-top: 0; padding-top: 8px; }
.chat.completo .acciones-chat, .chat.completo .estado-voz { width: 100%; max-width: 760px; margin-inline: auto; }
.chat .sugerencias { padding-top: 8px; }
.chat .sugerencias:empty { display: none; }

/* Aviso de privacidad a la vista */
footer .privacidad { max-width: 560px; margin: 0 auto 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text-2); font-size: .82rem; line-height: 1.5; text-align: left; }
footer .privacidad strong { color: var(--text); }
.msg.legal-chat { align-self: stretch; max-width: none; background: transparent; border: 0; padding: 0 2px; color: var(--text-3); font-size: .76rem; line-height: 1.45; }
