/* ============================================================
   Minicreditos24 — comparador financiero (ES)
   Design system: navy + royal blue + emerald, Inter, rounded cards
   ============================================================ */

:root {
  --navy-900: #070D1A;
  --navy-800: #0B1220;
  --navy-700: #101B33;
  --navy-100: #E8EEF9;
  --blue-600: #155EEF;
  --blue-500: #2E74F5;
  --blue-100: #D9E6FD;
  --green-500: #12B76A;
  --green-100: #D6F5E5;
  --amber-500: #F79009;
  --red-500: #F04438;
  --ink: #101828;
  --ink-2: #344054;
  --ink-3: #667085;
  --line: #E4E9F2;
  --bg: #F6F8FC;
  --white: #FFFFFF;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .10);
  --shadow-lg: 0 20px 50px rgba(11, 18, 32, .18);
  --maxw: 1160px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink-2); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.text-center { text-align: center; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blue-600); background: var(--blue-100);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-weight: 600; font-size: 1rem; padding: 13px 26px; border-radius: 12px;
  border: 0; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none !important;
}
.btn--primary { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(21, 94, 239, .35); }
.btn--primary:hover { background: var(--blue-500); transform: translateY(-2px); }
.btn--green { background: var(--green-500); color: #fff; box-shadow: 0 6px 16px rgba(18, 183, 106, .35); }
.btn--green:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn--ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.btn--ghost:hover { border-color: #fff; transform: translateY(-2px); }
.btn--outline { background: #fff; color: var(--blue-600); border: 1.5px solid var(--blue-600); }
.btn--block { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 18, 32, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header__inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.2rem; text-decoration: none !important; }
.brand img { width: 34px; height: 34px; }
.brand span em { font-style: normal; color: var(--green-500); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  color: rgba(255,255,255,.82); font-size: .92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; text-decoration: none !important;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav .btn { padding: 9px 18px; font-size: .9rem; margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; margin-left: auto; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(21,94,239,.35), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(18,183,106,.22), transparent 55%),
    var(--navy-800);
  color: #fff; overflow: hidden;
}
.hero__grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
  padding: 72px 0 64px;
}
.hero h1 { color: #fff; }
.hero h1 .hl { background: linear-gradient(90deg, #6EA8FF, #3CE38A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.12rem; color: rgba(255,255,255,.78); max-width: 34em; }
.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0 22px; }
.hero__trust { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.hero__trust li { display: flex; align-items: center; gap: 7px; font-size: .86rem; color: rgba(255,255,255,.72); }
.hero__trust svg { width: 17px; height: 17px; flex: none; }
.hero__img { border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.12); max-width: 100%; height: auto; }
/* Seguridad anti-desborde: ningún contenido puede ensanchar la página */
.hero__grid > *, .page-hero__grid > * { min-width: 0; }
img { max-width: 100%; height: auto; }

/* ---------- Calculator ---------- */
.calc {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 26px; border: 1px solid var(--line);
}
.calc__row { margin-bottom: 20px; }
.calc__label { display: flex; justify-content: space-between; font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.calc__label output { color: var(--blue-600); font-weight: 800; }
.calc input[type="range"] { width: 100%; accent-color: var(--blue-600); height: 32px; }
.calc__result {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff; border-radius: var(--radius-sm); padding: 18px 20px; text-align: center;
}
.calc__result strong { font-size: 1.7rem; display: block; color: #3CE38A; }
.calc__result span { font-size: .82rem; color: rgba(255,255,255,.72); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card__icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-100); color: var(--blue-600); margin-bottom: 16px;
}
.card__icon svg { width: 24px; height: 24px; }
.card--green .card__icon { background: var(--green-100); color: var(--green-500); }
.card h3 a { color: inherit; text-decoration: none !important; }
.card p { font-size: .94rem; margin-bottom: 14px; }
.card__link { margin-top: auto; font-weight: 600; font-size: .92rem; }

.cat-card { position: relative; overflow: hidden; }
.cat-card::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: linear-gradient(90deg, var(--blue-600), var(--green-500));
  opacity: 0; transition: opacity .2s;
}
.cat-card:hover::after { opacity: 1; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 66px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--blue-600), var(--green-500)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem;
}

/* ---------- Comparison table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: #fff; }
table.compare { width: 100%; border-collapse: collapse; min-width: 680px; background: #fff; }
table.compare th, table.compare td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; }
table.compare thead th { background: var(--navy-800); color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
table.compare tbody tr:hover { background: #F9FBFF; }
table.compare .amount { font-weight: 800; color: var(--ink); white-space: nowrap; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--green-100); color: #067647;
}
.badge--blue { background: var(--blue-100); color: var(--blue-600); }
.badge--amber { background: #FEF0C7; color: #B54708; }

/* ---------- Warning / notice ---------- */
.notice {
  border-radius: var(--radius-sm); padding: 16px 18px; font-size: .9rem;
  display: flex; gap: 12px; align-items: flex-start; margin: 22px 0;
}
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.notice--warn { background: #FEF0C7; color: #7A2E0E; border: 1px solid #FEDF89; }
.notice--info { background: var(--blue-100); color: #123B7A; border: 1px solid #B2CCFB; }
.notice p { margin: 0; color: inherit; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq__item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq__q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 17px 20px; font-size: 1rem; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: inherit;
}
.faq__q::after { content: "+"; font-size: 1.4rem; color: var(--blue-600); transition: transform .2s; line-height: 1; }
.faq__item.open .faq__q::after { transform: rotate(45deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq__a > div { padding: 0 20px 18px; color: var(--ink-2); font-size: .95rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(60,227,138,.25), transparent 60%),
    linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border-radius: 24px; color: #fff; padding: 48px; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.75); max-width: 46em; margin: 0 auto 24px; }

/* ---------- Content pages ---------- */
.page-hero {
  background:
    radial-gradient(700px 320px at 80% -20%, rgba(21,94,239,.30), transparent 60%),
    var(--navy-800);
  color: #fff; padding: 56px 0 48px;
}
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.page-hero p { color: rgba(255,255,255,.78); max-width: 44em; font-size: 1.06rem; }
.page-hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center; }
.page-hero__img { border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.12); }
.page-hero .updated svg { width: 15px; height: 15px; flex: none; }
.breadcrumb { font-size: .82rem; color: rgba(255,255,255,.55); margin-bottom: 18px; }
.breadcrumb a { color: rgba(255,255,255,.75); }
.prose { max-width: 780px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { color: var(--ink-2); padding-left: 22px; margin: 0 0 1.2em; }
.prose li { margin-bottom: 6px; }
.check-list { list-style: none; padding: 0 !important; }
.check-list li { padding-left: 30px; position: relative; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px;
  background: var(--green-500);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}
.updated { font-size: .82rem; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }

/* ---------- Offer cards row ---------- */
.offers { display: grid; gap: 16px; margin: 26px 0; }
.offer {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 14px 26px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.offer--best {
  position: relative;
  border: 2px solid var(--green-500, #12B76A);
  box-shadow: 0 6px 20px rgba(18, 183, 106, .14);
}
.offer__ribbon {
  position: absolute; top: -13px; left: 20px;
  background: var(--green-500, #12B76A); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(18, 183, 106, .4);
}
.offer__brand { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.offer__logo { height: 52px; width: auto; max-width: 150px; object-fit: contain; border-radius: 6px; background: #fff; }
.offer__meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; font-size: .84rem; color: var(--ink-3); }
.offer__meta b { color: var(--ink); display: block; font-size: .93rem; margin-top: 3px; }
.offer__cta { align-self: center; }
.offer__note { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 12px; margin: 0; }

/* ---------- Related ---------- */
.related { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.related a {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: .88rem; font-weight: 600; color: var(--ink-2); text-decoration: none !important;
}
.related a:hover { border-color: var(--blue-600); color: var(--blue-600); }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: rgba(255,255,255,.65); padding: 54px 0 30px; margin-top: 70px; font-size: .9rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.footer a { color: rgba(255,255,255,.65); display: block; margin-bottom: 8px; text-decoration: none !important; }
.footer a:hover { color: #fff; }
.footer .brand { margin-bottom: 12px; }
.footer__legal { border-top: 1px solid rgba(255,255,255,.08); padding-top: 22px; font-size: .8rem; color: rgba(255,255,255,.45); }
.footer__legal p { color: rgba(255,255,255,.45); font-size: .8rem; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .hero__grid { grid-template-columns: 1fr; padding: 28px 20px 40px; gap: 0; }
  /* En móvil/tablet la imagen hero se oculta: el primer pantallazo
     debe ser información (qué es el sitio), no una ilustración. */
  .hero__img { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .page-hero__grid { grid-template-columns: 1fr; }
  .page-hero__img { display: none; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; background: var(--navy-800); padding: 16px 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08); align-items: stretch;
  }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; }
  .nav-toggle { display: block; }
}
@media (max-width: 620px) {
  .grid--3, .grid--2, .grid--4 { grid-template-columns: 1fr; }
  .offer { grid-template-columns: 1fr; }
  .offer__brand { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .offer__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding: 44px 0; }
  .cta-band { padding: 34px 22px; }
  .footer__grid { grid-template-columns: 1fr; }
}
