/* ============================================================
   TrámiteFácil — estilos de la web mobile.
   Tokens y componentes derivados 1:1 del mockup "TramiteFacil Mobile".
   Pensado para mostrarse a pantalla completa desde el teléfono.
   ============================================================ */

:root {
  --tf-ink: #3f448c;      /* primario / títulos */
  --tf-ink-2: #2f3470;
  --tf-ink-3: #3a3f7d;
  --tf-ink-4: #4a4f96;
  --tf-violet: #7178df;
  --tf-violet-2: #5a61bd;
  --tf-lilac: #9ca2ef;
  --tf-lilac-2: #bbbeef;
  --tf-muted: #7b80b8;
  --tf-muted-2: #8489c4;
  --tf-border: #d5d8f8;
  --tf-border-2: #e4e6fa;
  --tf-card: #ffffff;
  --tf-bg: #f6f7ff;
  --tf-bg-soft: #f7f8ff;
  --tf-bg-2: #e9ebfd;

  --tf-grad-brand: linear-gradient(120deg, #3f448c 0%, #5a61bd 55%, #7178df 100%);
  --tf-grad-header: linear-gradient(120deg, #3f448c 0%, #5a61bd 100%);
  --tf-grad-icon: linear-gradient(140deg, #3f448c, #7178df);
  --tf-grad-icon-2: linear-gradient(140deg, #9ca2ef, #7178df);
  --tf-grad-cost: linear-gradient(120deg, #3f448c, #5a61bd 60%, #7178df);

  --tf-shadow-btn: 0 16px 34px -8px rgba(63, 68, 140, 0.55);
  --tf-shadow-card: 0 6px 18px rgba(63, 68, 140, 0.07);
  --tf-radius: 22px;

  --tf-safe-top: env(safe-area-inset-top, 0px);
  --tf-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: #eceefb;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--tf-ink);
  overscroll-behavior: none;
}

/* Contenedor: en móvil ocupa toda la pantalla; en escritorio se ve como
   una columna tipo teléfono, centrada. */
.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--tf-bg);
  overflow: hidden;
}
@media (min-width: 520px) {
  body { display: flex; align-items: center; justify-content: center; }
  .app {
    height: min(880px, 96dvh);
    border-radius: 34px;
    box-shadow: 0 30px 70px -20px rgba(63, 68, 140, 0.45);
  }
}

/* -------- Navegación entre pantallas -------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px);
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ============================================================
   PANTALLA 1 — Inicio
   ============================================================ */
.home {
  /* position:absolute + inset:0 vienen de .screen y llenan el alto; además
     .home ya sirve de contenedor para los blobs (hijos absolutos). */
  background: linear-gradient(180deg, #f7f8ff 0%, #e9ebfd 52%, #dfe2fb 100%);
  padding: calc(var(--tf-safe-top) + 30px) 26px calc(var(--tf-safe-bottom) + 26px);
  overflow: hidden;
}
.home__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.home__blob--1 {
  top: -130px; right: -110px; width: 330px; height: 330px;
  background: radial-gradient(circle, rgba(113,120,223,.5), rgba(113,120,223,0) 68%);
  animation: tf-float 7s ease-in-out infinite;
}
.home__blob--2 {
  bottom: 120px; left: -120px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(187,190,239,.7), rgba(187,190,239,0) 70%);
}
.home__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand__logo {
  width: 42px; height: 42px; flex: none;
  border-radius: 14px;
  background: var(--tf-grad-icon);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(63, 68, 140, 0.32);
}
.brand__name {
  font-weight: 800;
  font-size: 27px;
  letter-spacing: -0.7px;
  color: var(--tf-ink);
}
.brand--sm .brand__name { font-size: 15.5px; letter-spacing: -0.2px; color: #fff; }

.home__lead {
  margin: 22px 0 0;
  font-weight: 500;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--tf-ink-4);
  text-wrap: pretty;
  max-width: 330px;
}
.home__lead strong { color: var(--tf-ink); font-weight: 700; }

.eyebrow {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--tf-muted-2);
}

.covered { margin-top: 34px; display: flex; flex-direction: column; gap: 11px; }
.covered__list { display: flex; flex-direction: column; gap: 10px; }

/* Tarjetas "Hoy cubrimos": solo informativas (no interactivas). */
.tramite-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--tf-card);
  border: 1px solid var(--tf-border);
  border-radius: 18px;
  padding: 14px 15px;
  box-shadow: var(--tf-shadow-card);
  text-align: left;
  width: 100%;
}
.tramite-card__icon {
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  background: var(--tf-grad-icon-2);
  display: flex; align-items: center; justify-content: center;
}
.tramite-card__text {
  font-weight: 600; font-size: 13.5px; line-height: 1.35; color: var(--tf-ink);
}
.tramite-card__text small { font-weight: 500; color: var(--tf-muted); font-size: 12.5px; }

.spacer { flex: 1; }

/* Botón primario grande */
.btn-primary {
  width: 100%;
  min-height: 64px;
  border: none;
  border-radius: var(--tf-radius);
  background: var(--tf-grad-brand);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 11px;
  cursor: pointer;
  box-shadow: var(--tf-shadow-btn);
  transition: transform .16s ease, box-shadow .16s ease;
}
.btn-primary:hover { box-shadow: 0 20px 40px -8px rgba(63,68,140,.65); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }

.home__foot {
  margin: 16px 0 0;
  text-align: center;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--tf-muted-2);
}

/* ============================================================
   Header con gradiente (pantallas 2 y 3)
   ============================================================ */
.top {
  flex: none;
  z-index: 10;
  background: var(--tf-grad-header);
  border-radius: 0 0 26px 26px;
  padding: calc(var(--tf-safe-top) + 16px) 22px 18px;
  box-shadow: 0 10px 26px -12px rgba(63, 68, 140, 0.6);
  color: #fff;
}
.top__row { display: flex; align-items: center; gap: 13px; }
.icon-btn {
  width: 36px; height: 36px; flex: none;
  border-radius: 12px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s ease;
}
.icon-btn:hover { background: rgba(255,255,255,.26); }
.top__title { font-weight: 700; font-size: 17px; letter-spacing: -0.2px; color: #fff; }
.top__meta {
  display: flex; align-items: center; gap: 6px;
  font-weight: 500; font-size: 11.5px; color: rgba(255,255,255,.72);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tf-lilac-2); display: inline-block;
}
.dot--live { background: #7ce0a8; }

/* ============================================================
   PANTALLA 2 — Conversación
   ============================================================ */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}
.chat::-webkit-scrollbar { display: none; }

.chat__day {
  align-self: center;
  font-weight: 600; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--tf-lilac);
  background: var(--tf-bg-2);
  padding: 5px 12px; border-radius: 20px;
}

.msg { display: flex; gap: 9px; align-items: flex-end; max-width: 88%; }
.msg__avatar {
  width: 28px; height: 28px; flex: none;
  border-radius: 10px;
  background: var(--tf-grad-icon);
  display: flex; align-items: center; justify-content: center;
}
.bubble {
  border-radius: 20px 20px 20px 6px;
  padding: 14px 16px;
  font-weight: 500; font-size: 14.5px; line-height: 1.5;
  text-wrap: pretty;
}
.bubble--ai { background: #fff; color: var(--tf-ink-2); box-shadow: 0 6px 18px rgba(63,68,140,.09); }
.msg--user { align-self: flex-end; max-width: 84%; }
.bubble--user {
  background: linear-gradient(120deg, #5a61bd, #7178df);
  color: #fff;
  border-radius: 20px 20px 6px 20px;
  box-shadow: 0 10px 24px -8px rgba(90,97,189,.6);
}

.typing { display: flex; align-items: center; gap: 8px; padding-left: 4px; }
.typing__wave { display: flex; gap: 3px; align-items: flex-end; height: 12px; }
.typing__wave span {
  width: 3px; height: 12px; border-radius: 2px; background: var(--tf-lilac); display: block;
  animation: tf-wave .9s ease-in-out infinite;
}
.typing__wave span:nth-child(2) { animation-delay: .15s; }
.typing__wave span:nth-child(3) { animation-delay: .3s; }
.typing__label { font-weight: 500; font-size: 11.5px; color: var(--tf-muted-2); }

/* Barra inferior de voz */
.voice {
  flex: none;
  background: #fff;
  border-top: 1px solid var(--tf-border-2);
  border-radius: 26px 26px 0 0;
  padding: 20px 22px calc(var(--tf-safe-bottom) + 24px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: 0 -10px 30px -18px rgba(63, 68, 140, 0.5);
}
.mic-wrap {
  position: relative;
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
}
.mic-ring {
  position: absolute; inset: 14px;
  border-radius: 50%;
  background: rgba(113,120,223,.3);
  animation: tf-ring 2.4s ease-out infinite;
  display: none;
}
.mic-wrap.is-listening .mic-ring { display: block; }
.mic-ring:nth-child(2) { animation-delay: .8s; }
.mic-ring:nth-child(3) { animation-delay: 1.6s; }
.mic-btn {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #3f448c, #7178df);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 30px -6px rgba(63, 68, 140, 0.6);
  transition: transform .14s ease, filter .2s ease;
}
.mic-btn:hover { transform: scale(1.03); }
.mic-btn:active { transform: scale(.97); }
.mic-btn.is-muted { filter: grayscale(.5) brightness(.9); }

.voice__status { font-weight: 600; font-size: 13px; color: var(--tf-muted-2); text-align: center; }
.voice__status.is-listening { color: var(--tf-ink); }

.wave-lg { display: flex; gap: 4px; align-items: center; height: 22px; }
.wave-lg span {
  width: 3.5px; border-radius: 2px; display: block;
  animation: tf-wave .8s ease-in-out infinite;
}
.wave-lg span:nth-child(1){ height:10px; background: var(--tf-lilac-2); animation-delay: 0s; }
.wave-lg span:nth-child(2){ height:18px; background: var(--tf-lilac); animation-delay: .1s; }
.wave-lg span:nth-child(3){ height:22px; background: var(--tf-violet); animation-delay: .2s; }
.wave-lg span:nth-child(4){ height:14px; background: var(--tf-lilac); animation-delay: .3s; }
.wave-lg span:nth-child(5){ height:20px; background: var(--tf-violet); animation-delay: .4s; }
.wave-lg span:nth-child(6){ height:11px; background: var(--tf-lilac-2); animation-delay: .5s; }
.wave-lg span:nth-child(7){ height:16px; background: var(--tf-lilac); animation-delay: .6s; }

/* Entrada de texto ("o escribí") */
.composer {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
}
.composer input {
  flex: 1;
  height: 46px;
  border: 1px solid var(--tf-border);
  border-radius: 15px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--tf-ink-2);
  background: var(--tf-bg-soft);
  outline: none;
}
.composer input:focus { border-color: var(--tf-lilac); }
.composer button {
  width: 46px; height: 46px; flex: none;
  border: none; border-radius: 14px;
  background: var(--tf-grad-icon);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.composer button:disabled { opacity: .5; cursor: default; }

/* ============================================================
   PANTALLA 3 — Checklist
   ============================================================ */
.sheet {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px calc(var(--tf-safe-bottom) + 30px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }

.card {
  background: #fff;
  border-radius: 24px;
  padding: 20px 18px;
  box-shadow: 0 10px 30px -14px rgba(63, 68, 140, 0.35);
  display: flex; flex-direction: column; gap: 20px;
}

.badge {
  align-self: flex-start;
  font-weight: 700; font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--tf-violet-2);
  background: var(--tf-bg-2);
  padding: 5px 10px; border-radius: 8px;
}
.card__title { margin: 0; font-weight: 800; font-size: 22px; letter-spacing: -0.5px; color: var(--tf-ink); }
.card__sub { margin: 0; font-weight: 500; font-size: 13px; line-height: 1.45; color: var(--tf-muted); }

.divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(156,162,239,0), #d5d8f8 20%, #d5d8f8 80%, rgba(156,162,239,0));
}

.section { display: flex; flex-direction: column; gap: 11px; }
.section__head { display: flex; align-items: center; justify-content: space-between; }
.section__label {
  font-weight: 700; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--tf-muted-2);
}
.section__hint { font-weight: 600; font-size: 11px; color: var(--tf-lilac); }

.checks { display: flex; flex-direction: column; gap: 8px; }
.check {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--tf-bg-soft);
  border: 1px solid var(--tf-border-2);
  border-radius: 14px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .16s ease;
}
.check:hover { border-color: var(--tf-lilac); }
.check__box {
  width: 21px; height: 21px; flex: none;
  border-radius: 7px;
  border: 2px solid var(--tf-lilac);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s ease, border-color .16s ease;
}
.check.is-done .check__box { background: #eef0ff; border-color: var(--tf-violet-2); }
.check__box svg { opacity: 0; transition: opacity .16s ease; }
.check.is-done .check__box svg { opacity: 1; }
.check__text { font-weight: 500; font-size: 13.5px; line-height: 1.4; color: var(--tf-ink-3); }
.check.is-done .check__text { color: var(--tf-muted); text-decoration: line-through; text-decoration-color: rgba(90,97,189,.4); }

.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 11px; align-items: flex-start; }
.step__num {
  width: 23px; height: 23px; flex: none;
  border-radius: 8px;
  background: linear-gradient(140deg, #5a61bd, #7178df);
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.step__text { font-weight: 500; font-size: 13.5px; line-height: 1.45; color: var(--tf-ink-3); padding-top: 2px; }

.orgs { display: flex; flex-direction: column; gap: 0; }
.org {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(100deg, #f2f3ff, #e9ebfd);
  border: 1px solid var(--tf-border);
  border-radius: 16px;
  padding: 12px 14px;
}
.org--last { background: linear-gradient(100deg, #eef0ff, #e3e6fc); border-color: var(--tf-lilac-2); }
.org__num {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.org__text { font-weight: 700; font-size: 14px; color: var(--tf-ink); }
.org__text small { font-weight: 500; font-size: 12px; color: var(--tf-muted); }
.org-arrow { display: flex; justify-content: center; padding: 3px 0; }

.cost {
  background: var(--tf-grad-cost);
  border-radius: 20px;
  padding: 16px 17px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 12px 26px -12px rgba(63, 68, 140, 0.6);
}
.cost__label {
  font-weight: 700; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,.65);
}
.cost__value { font-weight: 800; font-size: 21px; letter-spacing: -0.4px; color: #fff; }
.cost__note { font-weight: 500; font-size: 13px; line-height: 1.45; color: #d9dbf8; }

/* Acciones Telegram */
.actions { display: flex; flex-direction: column; gap: 10px; }
.btn-tg {
  width: 100%; min-height: 56px;
  border: none; border-radius: 18px;
  background: linear-gradient(120deg, #3f448c, #7178df);
  color: #fff; font-family: inherit; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  box-shadow: 0 14px 28px -10px rgba(63, 68, 140, 0.55);
  text-decoration: none;
  transition: transform .16s ease;
}
.btn-tg:hover { transform: translateY(-1px); }
.btn-tg:active { transform: translateY(1px); }

.btn-locked {
  width: 100%; min-height: 56px;
  border-radius: 18px;
  border: 1.5px dashed #c8cbf4;
  background: #f2f3ff;
  color: #a3a7d6;
  font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}

.btn-done {
  width: 100%; min-height: 56px;
  border-radius: 18px;
  border: 1.5px solid var(--tf-lilac);
  background: #eef0ff;
  color: var(--tf-ink);
  font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

.actions__note { margin: 0; text-align: center; font-weight: 500; font-size: 11.5px; color: var(--tf-muted-2); }
.link-again {
  margin-top: 4px; text-align: center;
  font-weight: 600; font-size: 13px;
  color: var(--tf-violet-2);
  text-decoration: underline; text-underline-offset: 3px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.link-again:hover { color: var(--tf-ink); }

.link-tg {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin: 2px auto 0; text-align: center;
  font-weight: 700; font-size: 13px;
  color: var(--tf-violet-2);
  text-decoration: underline; text-underline-offset: 3px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.link-tg:hover { color: var(--tf-ink); }

.hidden { display: none !important; }

/* ============================================================
   Modal (atajo para iniciar un trámite desde las tarjetas)
   ============================================================ */
.modal {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(30, 32, 60, 0.42);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__sheet {
  width: 100%;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 22px 22px calc(var(--tf-safe-bottom) + 22px);
  display: flex; flex-direction: column; gap: 16px;
  transform: translateY(20px);
  transition: transform .28s ease;
  box-shadow: 0 -14px 40px -20px rgba(63,68,140,.6);
}
.modal.is-open .modal__sheet { transform: none; }
.modal__title { margin: 0; font-weight: 800; font-size: 18px; color: var(--tf-ink); letter-spacing: -0.3px; }
.modal__q { font-weight: 600; font-size: 13px; color: var(--tf-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--tf-border);
  background: var(--tf-bg-soft);
  color: var(--tf-ink-3);
  font-family: inherit; font-weight: 600; font-size: 13.5px;
  padding: 10px 16px; border-radius: 13px; cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--tf-lilac); }
.chip.is-sel {
  border-color: var(--tf-violet-2);
  background: var(--tf-grad-brand);
  color: #fff;
}

/* Toast / avisos */
.toast {
  position: absolute;
  left: 50%; bottom: calc(var(--tf-safe-bottom) + 20px);
  transform: translateX(-50%) translateY(10px);
  z-index: 60;
  background: #14152a;
  color: #fff;
  font-weight: 500; font-size: 13px;
  padding: 12px 18px; border-radius: 14px;
  max-width: 88%;
  box-shadow: 0 14px 30px -10px rgba(20,21,42,.6);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  text-align: center;
}
.toast.is-show { opacity: 1; visibility: visible; transform: translateX(-50%); }

/* Banner de configuración/estado */
.banner {
  margin: 0 20px;
  background: #fff5f5;
  border: 1px solid #f3c9c9;
  color: #a23c3c;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 500; font-size: 12.5px; line-height: 1.4;
}

/* ============================================================
   Animaciones (del mockup)
   ============================================================ */
@keyframes tf-ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes tf-wave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes tf-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
