/* =========================================================
   Secciones: buscador, confianza, proceso, actualizaciones,
   cotización, footer, responsive
   ========================================================= */

/* Ilustraciones animadas */
.gear { transform-box: fill-box; transform-origin: center; animation: spin 10s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gear--rev { animation-direction: reverse; animation-duration: 7s; }
.leaf { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 4s ease-in-out infinite; }
.leaf--2 { animation-delay: -1.5s; animation-duration: 5s; }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.wave { animation: wave 6s linear infinite; }
@keyframes wave { to { transform: translateX(-120px); } }
.pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
.pulse--2 { animation-delay: 1.2s; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.bob { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Confianza ---------- */
.trust { overflow: hidden; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar {
  position: relative; padding: 32px 28px; border-radius: var(--radius);
  background: var(--ink-2); border: 1px solid var(--line-dark); overflow: hidden;
  transition: transform .45s var(--spring), border-color .3s;
}
.pillar::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s; pointer-events: none;
  background: radial-gradient(400px circle at var(--px, 50%) var(--py, 0%), rgba(127,181,188,.18), transparent 60%);
}
.pillar:hover { transform: translateY(-6px); border-color: rgba(127,181,188,.4); }
.pillar:hover::before { opacity: 1; }
.pillar svg { width: 56px; height: 56px; color: var(--brand-light); margin-bottom: 22px; }
.pillar svg .draw { stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 1.6s var(--ease) .2s; }
.pillar.is-visible svg .draw { stroke-dashoffset: 0; }
.pillar h3 { font-size: 1.6rem; margin-bottom: 10px; }
.pillar p { margin: 0; color: var(--muted-dark); }
.pillar__n { position: absolute; top: 18px; right: 24px; font-family: var(--serif); font-size: 4rem; line-height: 1; color: rgba(255,255,255,.06); }

/* ---------- Actualizaciones: últimas publicaciones del blog ---------- */
.updates__head { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 40px; flex-wrap: wrap; }
.updates__head > div { max-width: 720px; }
.updates__head h2 { text-wrap: balance; }
.updates__all { flex: none; color: var(--white); }
.updates__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.update {
  --c: var(--q);
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 300px;
  padding: clamp(24px, 3.4vw, 40px); border-radius: var(--radius);
  background: var(--ink-2); border: 1px solid var(--line-dark); text-decoration: none; overflow: hidden;
  transition: transform .45s var(--spring), border-color .3s;
}
.update--e { --c: var(--e); }
.update::after {
  content: ""; position: absolute; right: -80px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: var(--c); opacity: .18; filter: blur(10px); transition: transform .6s var(--ease), opacity .4s;
}
.update:hover { transform: translateY(-6px) rotate(-.4deg); border-color: var(--c); }
.update:hover::after { transform: scale(1.4); opacity: .3; }
.update__tag { align-self: flex-start; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: color-mix(in srgb, var(--c) 30%, transparent); color: var(--white); }
.version { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; display: flex; align-items: flex-end; flex-wrap: wrap; }
.year { display: inline-block; height: 1.05em; overflow: hidden; }
.year span { display: block; transition: transform 1s var(--ease) .4s; }
.year span:last-child { color: color-mix(in srgb, var(--c) 60%, var(--white)); }
.update.is-visible .year span { transform: translateY(-100%); }
.update p { margin: 0; color: var(--muted-dark); max-width: 440px; position: relative; z-index: 1; }
/* Con versión de norma, el título acompaña en texto; sin versión, el título es el protagonista */
.update__title {
  position: relative; z-index: 1; max-width: 440px;
  font-family: var(--sans); font-size: 1rem; font-weight: 500; line-height: 1.55; letter-spacing: 0; color: var(--muted-dark);
}
.update__title--lg { max-width: 18ch; font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; letter-spacing: -.02em; color: var(--white); }
.update__foot {
  position: relative; z-index: 1; margin-top: auto; padding-top: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  color: var(--muted-dark); font-size: .88rem;
}
.update .link-arrow { color: var(--white); }
.update:hover .link-arrow { background-size: 100% 2px; }
.update:hover .link-arrow svg { transform: translateX(4px); }

/* ---------- Cotización ---------- */
.quote { background: var(--paper); }
.quote__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 70px); align-items: start; }
.quote__aside { position: sticky; top: 100px; }
.quote__aside h2 em { color: var(--brand-ink); font-style: normal; }
.quote__aside p { color: var(--muted); font-size: 1.08rem; }
.wa-list { display: grid; gap: 12px; margin-top: 30px; }
.wa {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 18px;
  background: var(--white); text-decoration: none; box-shadow: var(--shadow);
  transition: transform .4s var(--spring);
}
.wa:hover { transform: translateX(6px); }
.wa__ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: var(--white); flex: none; }
.wa__ico svg { width: 24px; height: 24px; }
.wa small { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.wa__flag { flex: none; width: 20px; height: 14px; border-radius: 2px; outline: 1px solid rgba(13,18,20,.16); outline-offset: -1px; }
.wa b { font-size: 1.15rem; letter-spacing: .01em; }
.wa > svg { margin-left: auto; width: 20px; height: 20px; color: var(--muted); }

.form { position: relative; background: var(--white); border-radius: 28px; padding: clamp(22px, 3.6vw, 40px); box-shadow: var(--shadow); overflow: hidden; }
.form__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.form__top h3 { font-size: 1.1rem; font-family: var(--sans); font-weight: 800; letter-spacing: 0; }
.form__count { font-weight: 600; font-size: .88rem; color: var(--muted); }
.bar { height: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; margin: 12px 0 28px; }
.bar i { display: block; height: 100%; width: 33%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-ink), var(--brand)); transition: width .6s var(--ease); }
.fstep { display: none; border: 0; padding: 0; margin: 0; min-width: 0; }
.fstep.is-active { display: block; animation: slideIn .5s var(--ease); }
.fstep.is-back { animation-name: slideInBack; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slideInBack { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.fstep legend { font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -.02em; padding: 0; margin-bottom: 6px; }
.fstep .lead { color: var(--muted); margin: 0 0 22px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.opt label {
  --c: var(--ink);
  display: flex; gap: 12px; align-items: center; height: 100%;
  padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); cursor: pointer;
  transition: border-color .25s, background .25s, transform .35s var(--spring);
}
.opt label:hover { transform: translateY(-2px); border-color: var(--c); }
.opt input:checked + label { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--white)); }
.opt input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: 2px; }
.opt b { display: block; }
.opt small { color: var(--muted); font-size: .84rem; }
.opt .tick { margin-left: auto; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; transition: background .25s, border-color .25s, transform .35s var(--spring); }
.opt .tick svg { width: 14px; height: 14px; color: var(--white); opacity: 0; transition: opacity .2s; }
.opt input:checked + label .tick { background: var(--c); border-color: var(--c); transform: scale(1.1); }
.opt input:checked + label .tick svg { opacity: 1; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; border-radius: 16px; background: var(--paper); margin-bottom: 18px; }
.seg button { border: 0; padding: 12px; border-radius: 12px; background: transparent; font-weight: 700; display: inline-flex; justify-content: center; align-items: center; gap: 10px; transition: background .3s, box-shadow .3s; }
.seg button[aria-pressed="true"] { background: var(--white); box-shadow: var(--shadow); }
.seg abbr { text-decoration: none; font-size: .72rem; padding: 3px 7px; border-radius: 6px; background: var(--ink); color: var(--white); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: .9rem; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper);
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.field input::placeholder { color: #7f8a8c; }
.field input:focus { outline: none; border-color: var(--brand-ink); background: var(--white); box-shadow: 0 0 0 4px rgba(30,77,84,.18); }
.field.has-error input { border-color: #c8412b; background: #fdf3f1; }
.field .err { color: #b2391f; font-size: .82rem; font-weight: 600; min-height: 1.25em; }
.phone { display: flex; align-items: stretch; }
.phone span { display: grid; place-items: center; padding: 0 14px; border-radius: 14px 0 0 14px; background: var(--paper-2); font-weight: 700; border: 1.5px solid var(--line); border-right: 0; }
.phone input { border-radius: 0 14px 14px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; font-size: .92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand-ink); flex: none; }
.check.has-error { color: #b2391f; }
.opts-err { color: #b2391f; font-size: .85rem; font-weight: 600; min-height: 1.3em; margin: 10px 0 0; }
.form__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.form__nav .btn--back { --bg: var(--paper); --fg: var(--ink); }
.form__nav .btn--back:hover svg { transform: translateX(-4px); }
.form__nav [hidden] { display: none; }
.form__nav .btn--ink { margin-left: auto; }
.form__note { margin: 16px 0 0; font-size: .85rem; color: var(--muted); }
.success { text-align: center; padding: 24px 0 8px; }
.success[hidden] { display: none; }
.success svg { width: 150px; height: 150px; margin: 0 auto 20px; animation: stampIn .8s var(--spring) forwards; }
@keyframes stampIn { 0% { transform: scale(2.4) rotate(-30deg); opacity: 0; } 60% { transform: scale(.92) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(-6deg); opacity: 1; } }
.success h3 { font-size: 2rem; }
.success p { color: var(--muted); max-width: 400px; margin: 10px auto 24px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--muted-dark); padding: 72px 0 28px; font-size: .93rem; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 40px; border-bottom: 1px solid var(--line-dark); }
.footer .brand { color: var(--white); margin-bottom: 16px; }
.footer h4 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; color: var(--brand-light); margin: 0 0 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--white); }
.footer address { font-style: normal; line-height: 1.7; }
.footer__tel { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--white); font-weight: 700; }
.footer__tel svg { width: 16px; height: 16px; color: var(--brand-light); }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ink-3); color: var(--white); transition: transform .35s var(--spring), background .25s; }
.social a:hover { transform: translateY(-4px) rotate(-6deg); background: var(--brand-ink); }
.social svg { width: 18px; height: 18px; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding-top: 24px; }
.footer__bottom ul { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------- WhatsApp flotante ---------- */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab__btn { width: 60px; height: 60px; border-radius: 50%; border: 0; background: #25d366; color: var(--white); display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(37,211,102,.8); position: relative; isolation: isolate; transition: transform .4s var(--spring); }
.fab__btn::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #25d366; animation: ping 2.4s ease-out infinite; z-index: -1; }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.7); opacity: 0; } }
.fab__btn:hover { transform: scale(1.08) rotate(-8deg); }
.fab__btn svg { width: 28px; height: 28px; }
.fab__menu { display: grid; gap: 8px; opacity: 0; visibility: hidden; transform: translateY(10px) scale(.95); transform-origin: bottom right; transition: opacity .25s, transform .35s var(--spring), visibility .25s; }
.fab.is-open .fab__menu { opacity: 1; visibility: visible; transform: none; }
.fab__menu a { background: var(--white); color: var(--ink); padding: 10px 16px; border-radius: 14px; text-decoration: none; font-weight: 700; box-shadow: var(--shadow); font-size: .92rem; }
.fab__menu a small { display: block; font-weight: 600; color: var(--muted); font-size: .76rem; }

/* ---------- Revelado y confeti ---------- */
.js .reveal:not(.is-visible) { opacity: 0; translate: 0 28px; }
.reveal.is-visible { animation: revealIn .9s var(--ease) var(--d, 0s) backwards; }
@keyframes revealIn { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero__scroll { display: none; }
  .pillars, .updates__grid, .quote__grid { grid-template-columns: 1fr; }
  .quote__aside { position: static; }
}
@media (max-width: 600px) {
  .opts, .fields { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .form__nav .btn { padding: 13px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal:not(.is-visible) { opacity: 1; translate: none; }
}
