/* ============================================================
   ipoteka.es — design system (Version 2)
   Tokens, base, animations, utilities, responsive.
   Recreated natively from the design handoff (no prototype runtime).
   ============================================================ */

:root{
  --blue:#0F5BD8; --blue-d:#0A3FA8; --navy:#0A1B3D;
  --accent:#FFD200; --accent-d:#F2BE00;
  --ink:#0A1B3D; --muted:#566488; --muted-2:#8492B4;
  --line:#E7ECF8; --tint:#F4F7FF; --tint-2:#EAF1FF;
  --success:#1F9254; --success-bg:#E6F4EC; --danger:#E5484D;
  --radius:20px; --maxw:1180px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:#fff;color:var(--ink);
  font-family:'Manrope',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;overflow-x:hidden;
}
img{max-width:100%;display:block}
::selection{background:var(--accent);color:var(--navy)}
a{color:inherit}

/* ---------- keyframes ---------- */
@keyframes floatA{0%,100%{transform:translateY(0)}50%{transform:translateY(-16px)}}
@keyframes floatB{0%,100%{transform:translateY(0)}50%{transform:translateY(13px)}}
@keyframes drift{0%,100%{transform:translate(0,0) scale(1)}33%{transform:translate(28px,-22px) scale(1.08)}66%{transform:translate(-22px,18px) scale(.95)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes dash{to{stroke-dashoffset:-340}}
@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.12);opacity:.85}}

/* ---------- FAQ <details> ---------- */
details[data-faq] > summary::-webkit-details-marker{display:none}
details[data-faq] > summary{list-style:none}
details[data-faq][open] .faq-chev{transform:rotate(45deg)}

/* ---------- form focus ---------- */
select:focus,input:focus,textarea:focus{
  outline:none;border-color:var(--blue)!important;
  box-shadow:0 0 0 4px rgba(15,91,216,.12)!important;
}

/* ---------- range inputs (calculator) ---------- */
input[type=range]{-webkit-appearance:none;appearance:none;height:8px;border-radius:99px;background:var(--tint-2);outline:none}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:26px;height:26px;border-radius:50%;background:var(--blue);border:4px solid #fff;box-shadow:0 4px 12px rgba(15,91,216,.45);cursor:pointer}
input[type=range]::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:var(--blue);border:4px solid #fff;box-shadow:0 4px 12px rgba(15,91,216,.45);cursor:pointer}

/* ---------- documents checklist ---------- */
.doc-check{width:20px;height:20px;accent-color:var(--blue);flex:none;cursor:pointer;margin:0}
.doc-item{transition:opacity .25s}
.doc-item:has(.doc-check:checked) .doc-text{text-decoration:line-through;color:var(--muted-2)}

/* ---------- coverage map dots ---------- */
.map-dot{transition:transform .2s,fill .2s;transform-box:fill-box;transform-origin:center;cursor:pointer}
.map-dot:hover{transform:scale(1.55);fill:var(--accent)!important}

/* ---------- hover utilities (replace prototype style-hover) ---------- */
.lift{transition:transform .25s,box-shadow .25s,border-color .25s}
.lift-card:hover{box-shadow:0 24px 50px -24px rgba(10,27,61,.28);border-color:var(--blue)}
.lift-shadow:hover{box-shadow:0 18px 40px -22px rgba(10,27,61,.3)}
.lift-shadow-navy:hover{box-shadow:0 18px 40px -22px rgba(10,27,61,.5)}
.lift-up:hover{transform:translateY(-4px);box-shadow:0 18px 40px -22px rgba(10,27,61,.3)}
.cta-blue:hover{transform:translateY(-3px);box-shadow:0 20px 40px rgba(15,91,216,.38)}
.cta-blue-sm:hover{transform:translateY(-2px);box-shadow:0 18px 38px rgba(15,91,216,.4)}
.cta-yellow:hover{transform:translateY(-2px);box-shadow:0 14px 28px rgba(255,210,0,.5)}
.btn-outline:hover{border-color:var(--blue)}

/* ---------- image placeholder (client fills with real photo) ---------- */
.img-slot{
  width:100%;height:100%;display:grid;place-items:center;gap:10px;text-align:center;
  padding:26px;background:linear-gradient(135deg,#123A78,#0A1B3D);
  color:#C2CFEC;font-weight:700;font-size:14px;line-height:1.5;
}
.img-slot svg{opacity:.7}

/* ---------- language switcher ---------- */
.lang-switch{display:inline-flex;align-items:center;gap:6px;padding:8px 11px;border-radius:11px;background:var(--tint);border:1px solid var(--line);font-weight:800;font-size:12.5px;color:var(--muted);text-decoration:none;line-height:1;flex:none}
.lang-switch:hover{border-color:var(--blue);color:var(--navy)}
.lang-switch svg{border-radius:3px;display:block;box-shadow:0 1px 2px rgba(0,0,0,.12)}

/* ---------- language choice chips (wizard) ---------- */
.lang-opt{cursor:pointer;border:1.5px solid var(--line);border-radius:11px;padding:12px 14px;font-weight:700;font-size:14px;color:var(--navy);display:inline-flex;align-items:center;gap:8px;flex:1 1 0;min-width:120px;justify-content:center;transition:border-color .2s,background .2s,box-shadow .2s;user-select:none}
.lang-opt input{position:absolute;opacity:0;width:0;height:0}
.lang-opt svg{border-radius:2px;box-shadow:0 1px 2px rgba(0,0,0,.12);flex:none}
.lang-opt:hover{border-color:var(--blue)}
.lang-opt.is-checked,
.lang-opt:has(input:checked){border-color:var(--blue);background:var(--tint-2);box-shadow:0 0 0 3px rgba(15,91,216,.12)}

/* ---------- nav (shared chrome) ---------- */
.nav-burger{
  display:none;width:44px;height:44px;border-radius:12px;border:1.5px solid var(--line);
  background:#fff;cursor:pointer;place-items:center;color:var(--navy);flex:none;
}
.nav-cta-mobile{display:none}

/* ============================================================
   RESPONSIVE
   The prototype is desktop-first with inline grid styles.
   These attribute-substring rules collapse those grids without
   touching the markup (!important beats inline styles).
   ============================================================ */

@media(max-width:1000px){
  [style*="repeat(4,1fr)"]{grid-template-columns:repeat(2,1fr)!important}
  [style*="1.4fr 1fr 1fr 1fr"]{grid-template-columns:repeat(2,1fr)!important}
  [style*="padding:64px"]{padding:42px!important}
}

@media(max-width:860px){
  /* nav: hide inline link row + extras, show burger */
  [data-nav-links]{
    display:none!important;position:absolute;top:100%;left:0;right:0;
    flex-direction:column;align-items:flex-start;gap:6px!important;
    background:#fff;padding:14px 22px 20px;
    box-shadow:0 24px 40px -20px rgba(10,27,61,.3);border-top:1px solid var(--line);
  }
  [data-nav-links].open{display:flex!important}
  [data-nav-links] a{padding:9px 0;font-size:16px!important}
  .nav-extra{display:none!important}
  .nav-burger{display:grid!important}
  /* el CTA ancho de la barra se oculta en móvil (va dentro del menú) */
  [data-nav] .cta-yellow{display:none!important}
  .nav-cta-mobile{display:block!important;margin-top:10px;background:var(--accent);color:var(--navy)!important;font-weight:800!important;text-align:center;padding:13px 16px!important;border-radius:11px;font-size:15px!important;box-shadow:0 10px 22px rgba(255,210,0,.4)}

  /* split / hero / form grids → single column */
  [style*="1.05fr .95fr"],
  [style*=".95fr 1.05fr"],
  [style*=".9fr 1.1fr"],
  [style*="1.05fr 1fr"],
  [style*="1.2fr .8fr"],
  [style*="1.15fr .85fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="1fr auto"],
  [style*="auto 1fr"]{grid-template-columns:1fr!important}
  [style*="repeat(3,1fr)"]{grid-template-columns:repeat(2,1fr)!important}

  /* hide decorative floating cards (they overlap on small screens) */
  .hero-float,[style*="animation:floatA"],[style*="animation:floatB"]{display:none!important}
  /* hero photo column: let it size to content */
  [style*="height:540px"]{height:auto!important;min-height:300px!important}

  [style*="padding:54px 48px"]{padding:38px 26px!important}
}

@media(max-width:680px){
  [style*="repeat(2,1fr)"],
  [style*="repeat(3,1fr)"],
  [style*="repeat(4,1fr)"],
  [style*="1.4fr 1fr 1fr 1fr"],
  [style*=".95fr 1.05fr"],
  [style*=".9fr 1.1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  form[data-form]{grid-template-columns:1fr!important}
  form[data-form] > label,
  form[data-form] > button{grid-column:1 / -1!important}

  /* fluid headline scaling */
  [style*="font-size:60px"]{font-size:35px!important}
  [style*="font-size:56px"]{font-size:33px!important}
  [style*="font-size:52px"]{font-size:32px!important}
  [style*="font-size:48px"]{font-size:30px!important}
  [style*="font-size:46px"]{font-size:33px!important}
  [style*="font-size:44px"]{font-size:30px!important}
  [style*="font-size:42px"]{font-size:28px!important}
  [style*="font-size:40px"]{font-size:27px!important}
  [style*="font-size:38px"]{font-size:26px!important}
  [style*="font-size:36px"]{font-size:25px!important}
  [style*="font-size:34px"]{font-size:24px!important}
  [style*="font-size:30px"]{font-size:23px!important}

  /* trim oversized paddings */
  [style*="padding:160px 28px 90px"]{padding:116px 18px 46px!important}
  [style*="padding:140px 28px 40px"]{padding:108px 18px 30px!important}
  [style*="padding:64px"]{padding:30px!important}
  [style*="padding:34px"]{padding:24px!important}
  [style*="padding:38px"]{padding:26px!important}
}

@media(max-width:520px){
  /* keep side gutters comfortable on phones */
  section[style*="28px"]{padding-left:16px!important;padding-right:16px!important}
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *{animation:none!important;scroll-behavior:auto!important}
  [data-reveal]{opacity:1!important;transform:none!important;transition:none!important}
  [data-parallax]{transform:none!important}
}

/* ---------- cookie / legal notice banner ---------- */
.ipo-cookie{position:fixed;left:16px;right:16px;bottom:16px;z-index:99998;max-width:620px;margin:0 auto;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:16px 20px;box-shadow:0 18px 50px -16px rgba(10,27,61,.45);display:flex;flex-direction:column;gap:12px;font-size:14px;line-height:1.55}
.ipo-cookie[hidden]{display:none}
.ipo-cookie p{margin:0;color:var(--muted)}
.ipo-cookie a{color:var(--blue);font-weight:700;text-decoration:underline}
.ipo-cookie-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.ipo-cookie-btn{cursor:pointer;border:none;background:var(--blue);color:#fff;border-radius:10px;padding:10px 24px;font-weight:800;font-size:14px;font-family:inherit;transition:background .2s}
.ipo-cookie-btn:hover{background:var(--blue-d)}
.ipo-cookie-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ipo-cookie-btn--ghost{background:transparent;color:var(--muted);border:1px solid var(--line)}
.ipo-cookie-btn--ghost:hover{background:var(--tint);color:var(--navy)}
@media(min-width:620px){.ipo-cookie{flex-direction:row;align-items:center;justify-content:space-between;gap:22px}.ipo-cookie-actions{flex:none}}

/* ---------- content tables (blog / enriched pages) ---------- */
.ipo-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:10px 0 26px;border:1px solid var(--line);border-radius:16px;box-shadow:0 14px 34px -22px rgba(10,27,61,.22)}
.ipo-table{width:100%;border-collapse:collapse;font-size:15px;min-width:520px;background:#fff}
.ipo-table caption{caption-side:top;text-align:left;padding:14px 16px 0;font-weight:800;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--blue)}
.ipo-table th{background:var(--tint);color:var(--navy);font-weight:800;text-align:left;padding:13px 16px;border-bottom:1px solid var(--line);font-size:13.5px;line-height:1.4}
.ipo-table td{padding:12px 16px;border-bottom:1px solid var(--line);color:var(--muted);line-height:1.55;vertical-align:top}
.ipo-table tr:last-child td{border-bottom:none}
.ipo-table tbody td:first-child{color:var(--navy);font-weight:700}
.ipo-table tbody tr:hover td{background:var(--tint)}

/* ---------- blog hub / article cards ---------- */
.blog-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.blog-card{display:flex;flex-direction:column;gap:9px;text-decoration:none;background:#fff;border:1px solid var(--line);border-radius:18px;padding:24px;transition:box-shadow .25s,border-color .25s,transform .25s}
.blog-card:hover{box-shadow:0 22px 50px -24px rgba(10,27,61,.28);border-color:var(--blue);transform:translateY(-3px)}
.blog-card .bc-eyebrow{font-size:12px;font-weight:800;letter-spacing:.05em;color:var(--blue)}
.blog-card .bc-title{font-size:18px;font-weight:800;color:var(--navy);line-height:1.28;letter-spacing:-.01em}
.blog-card .bc-text{font-size:14.5px;color:var(--muted);line-height:1.55;margin:0}
.blog-card .bc-more{margin-top:auto;padding-top:6px;font-size:13.5px;font-weight:800;color:var(--blue);display:inline-flex;align-items:center;gap:6px}
@media(max-width:860px){.blog-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:680px){.blog-grid{grid-template-columns:1fr}}

/* ---------- POI map (banks / notary / town hall / utilities) ---------- */
.poi-map{margin:10px 0 26px}
.poi-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.poi-btn{cursor:pointer;border:1.5px solid var(--line);background:#fff;color:var(--navy);border-radius:11px;padding:9px 13px;font-weight:700;font-size:13.5px;font-family:inherit;display:inline-flex;align-items:center;gap:7px;transition:border-color .2s,background .2s,color .2s}
.poi-btn svg{flex:none}
.poi-ext{margin-left:5px;opacity:.45;font-size:11px;font-weight:700}
.poi-btn:hover .poi-ext{opacity:.8}
.poi-btn:hover{border-color:var(--blue)}
.poi-btn.is-active{background:var(--blue);border-color:var(--blue);color:#fff;box-shadow:0 8px 18px -8px rgba(15,91,216,.55)}
.poi-btn.poi-route{border-color:var(--accent-d);background:#FFF8DC;color:var(--navy)}
.poi-btn.poi-route:hover{border-color:var(--accent-d)}
.poi-btn.poi-route.is-active{background:var(--accent);border-color:var(--accent);color:var(--navy);box-shadow:0 8px 18px -8px rgba(255,210,0,.6)}
.poi-frame{position:relative;width:100%;height:560px;border-radius:18px;overflow:hidden;border:1px solid var(--line);background:var(--tint);box-shadow:0 16px 38px -24px rgba(10,27,61,.3)}
.poi-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.poi-ph{position:absolute;inset:0;display:grid;place-items:center;gap:12px;text-align:center;padding:24px;color:var(--muted);font-weight:600;font-size:14px;line-height:1.5}
.poi-ph svg{opacity:.45}
.poi-note{margin:10px 0 0;font-size:12.5px;color:var(--muted-2);line-height:1.5}

@media(max-width:560px){.poi-tabs{gap:6px}.poi-btn{padding:8px 11px;font-size:13px}.poi-frame{height:400px}}

/* ---------- own price chart (public-data approximation) ---------- */
.price-chart{border:1px solid var(--line);border-radius:18px;padding:20px 22px;background:#fff;box-shadow:0 16px 38px -26px rgba(10,27,61,.28)}
.pcx-stats{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.pcx-stat{flex:1 1 200px;background:var(--tint);border:1px solid var(--line);border-radius:14px;padding:12px 16px;display:flex;flex-direction:column;gap:2px}
.pcx-l{font-size:11.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted-2)}
.pcx-v{font-size:22px;font-weight:800;color:var(--navy);line-height:1.1}
.pcx-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.pcx-tab{cursor:pointer;border:1.5px solid var(--line);background:#fff;color:var(--navy);border-radius:10px;padding:8px 14px;font-weight:700;font-size:13.5px;font-family:inherit;transition:border-color .2s,background .2s,color .2s}
.pcx-tab:hover{border-color:var(--blue)}
.pcx-tab.is-active{background:var(--blue);border-color:var(--blue);color:#fff}
.pcx-chart{position:relative}
.pcx-svg{width:100%;height:auto;display:block;touch-action:pan-y}
.pcx-axt{fill:var(--muted-2);font-size:11px;font-weight:600;font-family:'Manrope',sans-serif}
.pcx-guide{stroke:var(--muted-2);stroke-width:1;stroke-dasharray:3 3}
.pcx-tip{position:absolute;top:6px;transform:translateX(-50%);background:var(--navy);color:#fff;font-size:12.5px;font-weight:600;padding:5px 10px;border-radius:8px;white-space:nowrap;pointer-events:none;box-shadow:0 8px 18px -8px rgba(10,27,61,.6)}
.pcx-tip[hidden]{display:none}
.pcx-tip b{font-weight:800}
.pcx-empty{padding:40px 10px;text-align:center;color:var(--muted-2);font-weight:600;font-size:14px}
.pcx-more{margin-top:12px;cursor:pointer;border:none;background:none;color:var(--blue);font-weight:800;font-size:13.5px;font-family:inherit;padding:4px 0}
.pcx-more:hover{text-decoration:underline}
.pcx-proxy{margin:0 0 14px;font-size:13.5px;color:var(--navy);background:var(--tint-2);border-radius:10px;padding:9px 13px;border:1px solid var(--line)}
.pcx-note{margin:12px 0 0;font-size:12px;color:var(--muted-2);line-height:1.5}
@media(max-width:560px){.pcx-stat{flex:1 1 100%}}
