/* ==========================================================
   simuladorhipoteca.cat — minimalist fintech
   ========================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f5;
  --ink: #0a0a0a;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e9e9e6;
  --accent: #0ea36b;       /* verd confiança subtil */
  --accent-ink: #066b47;
  --accent-soft: #e6f6ee;
  --danger: #c92a2a;
  --warn: #b97900;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.08);
  --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", Segoe UI, Roboto, Helvetica, Arial, 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.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
img, svg, video, canvas { max-width: 100%; height: auto; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.2rem; }
p  { color: var(--ink-2); }

/* ========== Header ========== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.98rem; color: var(--ink);
}
.logo svg { color: var(--ink); }
.logo span { letter-spacing: -0.01em; }
.logo strong { font-weight: 700; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  font-size: 0.92rem; color: var(--ink-2); font-weight: 500;
  transition: color .15s;
}
.nav a:hover { color: var(--ink); }
.nav-external {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px;
  font-size: 0.82rem;
}

.lang-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 99px;
  padding: 3px; background: var(--bg);
}
.lang-toggle button {
  border: 0; background: transparent; padding: 5px 11px;
  border-radius: 99px; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all .18s;
}
.lang-toggle button.active { background: var(--ink); color: #fff; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px auto; transition: .2s; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border-radius: 99px; font-weight: 600;
  font-size: 0.95rem; border: 1px solid transparent;
  transition: all .2s ease; cursor: pointer;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); border-color: var(--ink); }
.btn-dark { background: var(--accent); color: #fff; }
.btn-dark:hover { background: var(--accent-ink); }

/* ========== Hero ========== */
.hero {
  padding: 80px 0 60px;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-soft) 0, transparent 60%),
    radial-gradient(800px 400px at 10% 90%, #f3f3f0 0, transparent 60%);
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px;
  align-items: center;
}
.badge {
  display: inline-block; padding: 6px 14px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.78rem; font-weight: 600; letter-spacing: .02em;
  margin-bottom: 20px;
}
.hero-text h1 { margin-bottom: 18px; }
.hero-text p { font-size: 1.15rem; max-width: 540px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 36px; margin-top: 48px;
  padding-top: 32px; border-top: 1px solid var(--line);
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; letter-spacing: -0.02em; }
.hero-stats span { font-size: 0.82rem; color: var(--muted); }

.hero-visual { display: flex; justify-content: center; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px; padding: 28px;
}
.floating { animation: float 6s ease-in-out infinite; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}
.card-head {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.card-head .dot { width: 9px; height: 9px; border-radius: 99px; background: var(--line); }
.card-head small { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
.quota-mock .big-num { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; }
.quota-mock .big-num span { font-size: 1.6rem; color: var(--muted); font-weight: 500; }
.quota-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.82rem; margin: 10px 0 22px; }
.bar { width: 100%; height: 10px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; }
.bar-fill { width: 62%; height: 100%; background: var(--ink); border-radius: 99px; }
.quota-split { display: flex; gap: 16px; margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.quota-split em { display: inline-block; width: 10px; height: 10px; background: var(--ink); border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.quota-split em.alt { background: var(--bg-alt); border: 1px solid var(--line); }

/* ========== Sections ========== */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.eyebrow {
  display: inline-block; padding: 5px 12px; border-radius: 99px;
  background: var(--ink); color: #fff; font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  margin-bottom: 16px;
}
.section-head h2 { margin-bottom: 14px; }
.section-head p { font-size: 1.05rem; }
.disclaimer { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 14px; }

/* ========== Simulador ========== */
.sim-grid {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow-sm);
}
.sim-form { display: flex; flex-direction: column; gap: 16px; }
.sim-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.input-wrap {
  position: relative; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
.input-wrap:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.input-wrap input {
  flex: 1; border: 0; padding: 12px 14px; font-size: 1rem; font-weight: 500;
  border-radius: 12px; outline: none; background: transparent; color: var(--ink);
  font-family: inherit;
}
.suffix { padding-right: 14px; color: var(--muted); font-size: 0.9rem; font-weight: 500; }

select, input[type="text"], input[type="email"], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1rem; background: #fff;
  font-family: inherit; color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
select:focus, input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
textarea { resize: vertical; font-family: inherit; }

.sim-advanced { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.sim-advanced summary { font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.sim-advanced summary:hover { color: var(--ink); }
.sim-advanced label { margin-top: 12px; }

.sim-results { display: flex; flex-direction: column; gap: 20px; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.result-card {
  padding: 18px; border-radius: 12px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; background: var(--bg-alt);
}
.result-card span { font-size: 0.78rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.result-card strong { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.result-card.primary { background: var(--ink); color: #fff; border-color: var(--ink); grid-column: span 2; }
.result-card.primary span { color: rgba(255,255,255,.7); }
.result-card.primary strong { font-size: 2.2rem; }

.chart-wrap {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  height: 260px; background: #fff;
}
.table-details { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.table-details summary {
  padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 0.9rem;
  list-style: none; color: var(--ink-2);
}
.table-details summary::-webkit-details-marker { display: none; }
.table-details summary::after { content: " →"; transition: .2s; }
.table-details[open] summary::after { transform: rotate(90deg); display: inline-block; }
.table-scroll { overflow-x: auto; max-height: 420px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { background: var(--bg-alt); font-weight: 600; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; position: sticky; top: 0; }

/* ========== Ofertes ========== */
.filters {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter {
  padding: 9px 18px; border-radius: 99px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; font-size: 0.88rem; cursor: pointer;
  color: var(--ink-2); transition: all .2s;
}
.filter:hover { border-color: var(--ink); }
.filter.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.offers-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.offer {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; display: flex; flex-direction: column; gap: 14px;
  transition: all .25s ease; position: relative;
}
.offer:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ink); }
.offer.featured { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft) 0%, #fff 60%); }
.offer.featured::before {
  content: "★ TOP"; position: absolute; top: 14px; right: 14px;
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 4px 9px; border-radius: 99px; letter-spacing: 0.06em;
}
.offer-head { display: flex; align-items: center; justify-content: space-between; }
.offer-bank {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px; background: var(--bg-alt);
  font-weight: 700; color: var(--ink); font-size: 1.1rem;
  border: 1px solid var(--line);
}
.offer-type {
  padding: 4px 10px; background: var(--bg-alt); border-radius: 99px;
  font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.offer h3 { font-size: 1.1rem; }
.offer-tin { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.offer-tin small { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.offer-meta { font-size: 0.85rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.offer-meta strong { color: var(--ink); font-weight: 600; }
.offer-cta { margin-top: auto; display: flex; gap: 8px; }
.offer-cta a { flex: 1; text-align: center; padding: 11px; border-radius: 99px; font-weight: 600; font-size: 0.88rem; transition: all .2s; }
.offer-cta .go { background: var(--ink); color: #fff; }
.offer-cta .go:hover { background: #000; }
.offer-cta .info { border: 1px solid var(--line); color: var(--ink-2); }
.offer-cta .info:hover { border-color: var(--ink); color: var(--ink); }

/* ========== Comparador ========== */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.cmp-col {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 14px;
}
.cmp-col h3 { margin-bottom: 6px; }
.cmp-col label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }

.cmp-results {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
.cmp-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr; padding: 16px 24px;
  border-bottom: 1px solid var(--line); align-items: center;
}
.cmp-row:last-child { border-bottom: 0; }
.cmp-row span { color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.cmp-row b { text-align: right; font-size: 1.05rem; font-weight: 600; }
.cmp-row.highlight { background: var(--bg-alt); font-size: 1.05rem; }
.cmp-row.highlight span { color: var(--ink); font-weight: 600; }
.cmp-row.highlight b { font-size: 1.2rem; }
.cmp-winner {
  padding: 18px 24px; background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 600; text-align: center; font-size: 0.98rem;
}
.cmp-winner:empty { display: none; }

.cmp-help {
  margin-top: 28px; text-align: center;
  padding: 28px; background: var(--ink); color: #fff; border-radius: var(--radius-lg);
}
.cmp-help p { color: rgba(255,255,255,.85); margin-bottom: 16px; }
.cmp-help .btn-primary { background: #fff; color: var(--ink); }

/* ========== FAQ ========== */
.faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-list details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; transition: border-color .2s;
}
.faq-list details[open] { border-color: var(--ink); }
.faq-list summary {
  cursor: pointer; font-weight: 600; font-size: 1rem;
  display: flex; justify-content: space-between; align-items: center;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p { margin-top: 10px; color: var(--ink-2); line-height: 1.65; }
.faq-list a { color: var(--accent-ink); text-decoration: underline; }

/* ========== Contact ========== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact-grid h2 { margin-top: 14px; margin-bottom: 14px; }
.bullets { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.bullets li {
  padding-left: 28px; position: relative; color: var(--ink-2);
}
.bullets li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; background: var(--accent); color: #fff;
  border-radius: 99px; text-align: center; font-size: 0.75rem; line-height: 20px; font-weight: 700;
}

.contact-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-sm);
}
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.file-label input[type="file"] {
  border: 1px dashed var(--line); padding: 16px; border-radius: 12px;
  background: var(--bg-alt); width: 100%; font-size: 0.88rem;
}
.checkbox { flex-direction: row !important; align-items: flex-start; gap: 10px; font-weight: 500 !important; font-size: 0.85rem; }
.checkbox input { margin-top: 3px; accent-color: var(--ink); }

/* ========== Ecosystem ========== */
.ecosystem { padding: 60px 0; }
.eco-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; padding: 36px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.eco-card h3 { font-size: 1.5rem; margin-bottom: 8px; }
.eco-card p { color: rgba(255,255,255,.8); max-width: 560px; margin: 0; }

/* ========== Footer ========== */
.footer { background: var(--bg-alt); padding: 60px 0 30px; border-top: 1px solid var(--line); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px;
  padding-bottom: 36px; border-bottom: 1px solid var(--line);
}
.footer-grid p { font-size: 0.9rem; margin-top: 14px; max-width: 320px; }
.footer-grid h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.footer-grid a {
  display: block; color: var(--ink-2); font-size: 0.92rem;
  padding: 4px 0; transition: color .15s;
}
.footer-grid a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; padding-top: 24px;
  gap: 20px; flex-wrap: wrap;
}
.footer-bottom small { color: var(--muted); font-size: 0.82rem; }

/* ========== Article / Legal pages ========== */
.article-hero {
  padding: 80px 0 40px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.breadcrumb {
  font-size: 0.85rem; color: var(--muted); margin-bottom: 18px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span { color: var(--ink-2); }

.article-hero h1 { margin-bottom: 14px; }
.article-hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 620px; }

.article-content { padding: 60px 0 80px; }
.article-content h2 {
  font-size: 1.5rem; margin-top: 44px; margin-bottom: 14px;
  letter-spacing: -0.015em;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 { font-size: 1.15rem; margin-top: 28px; margin-bottom: 10px; }
.article-content p { margin: 0 0 14px; line-height: 1.72; }
.article-content ul, .article-content ol {
  padding-left: 22px; margin: 0 0 18px;
}
.article-content li { margin-bottom: 8px; line-height: 1.65; color: var(--ink-2); }
.article-content a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { color: var(--ink); }
.article-content strong { color: var(--ink); }
.article-content blockquote {
  margin: 20px 0; padding: 16px 22px; background: var(--bg-alt);
  border-left: 3px solid var(--ink); border-radius: 4px;
  color: var(--ink-2); font-style: italic;
}
.article-content .toc {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin: 0 0 36px;
}
.article-content .toc h4 {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.article-content .toc ul { padding-left: 18px; margin: 0; }
.article-content .toc li { margin-bottom: 4px; font-size: 0.92rem; }
.article-content .toc a { color: var(--ink-2); text-decoration: none; }
.article-content .toc a:hover { color: var(--ink); text-decoration: underline; }

.article-content .highlight-box {
  background: var(--accent-soft); border: 1px solid #c7ebd8;
  border-radius: var(--radius); padding: 20px 24px; margin: 22px 0;
}
.article-content .highlight-box h4 {
  font-size: 1rem; color: var(--accent-ink); margin-bottom: 8px;
}
.article-content .highlight-box p:last-child { margin: 0; }

.article-content table {
  margin: 20px 0; font-size: 0.92rem;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.article-content table th { background: var(--bg-alt); }
.article-content table td, .article-content table th {
  padding: 12px 16px; text-align: left;
}

.article-cta {
  margin: 40px 0 0; padding: 28px; background: var(--ink); color: #fff;
  border-radius: var(--radius-lg); text-align: center;
}
.article-cta h3 { color: #fff; margin-bottom: 10px; }
.article-cta p { color: rgba(255,255,255,.8); margin-bottom: 16px; }
.article-cta .btn-primary { background: #fff; color: var(--ink); }
.article-cta .btn-primary:hover { background: var(--bg-alt); }

.legal-footer-note { color: var(--muted); font-size: 0.9rem; margin-top: 40px; }

/* Related articles */
.related {
  padding: 60px 0; background: var(--bg-alt); border-top: 1px solid var(--line);
}
.related h3 { margin-bottom: 24px; }
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.related-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: all .2s ease; display: block;
}
.related-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.related-card .eyebrow-small {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600;
}
.related-card h4 { font-size: 1.02rem; margin: 8px 0; color: var(--ink); }
.related-card p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ========== Responsive ========== */

/* Tablet i sota */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .sim-grid { grid-template-columns: 1fr; padding: 24px; }
  .cmp-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .offers-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { gap: 8px; }
  .nav { gap: 18px; }
}

/* Mòbil ample (≤720px) */
@media (max-width: 720px) {
  :root {
    --radius: 12px;
    --radius-lg: 16px;
  }
  .container, .container-narrow { padding: 0 16px; }

  /* Tipografia */
  h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  h2 { font-size: clamp(1.4rem, 5vw, 1.9rem); }
  h3 { font-size: 1.1rem; }
  body { font-size: 0.97rem; }

  /* Header mòbil */
  .header-inner { height: 60px; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute;
    top: 60px; left: 0; right: 0; background: #fff; padding: 20px;
    border-bottom: 1px solid var(--line); gap: 18px;
    box-shadow: var(--shadow-md);
  }
  .nav-toggle { display: block; }
  .lang-toggle button { padding: 5px 9px; font-size: 0.74rem; }
  .logo { font-size: 0.9rem; }

  /* Seccions i hero */
  .section { padding: 56px 0; }
  .hero { padding: 40px 0 36px; }
  .hero-text p { font-size: 1.02rem; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; min-width: 140px; padding: 12px 16px; font-size: 0.92rem; }
  .hero-stats {
    gap: 18px; margin-top: 32px; padding-top: 24px;
    flex-wrap: wrap; justify-content: space-between;
  }
  .hero-stats div { flex: 1 1 30%; min-width: 90px; }
  .hero-stats strong { font-size: 1.25rem; }
  .hero-stats span { font-size: 0.74rem; }

  /* Card hero */
  .card { padding: 22px; }
  .quota-mock .big-num { font-size: 2.1rem; }
  .quota-mock .big-num span { font-size: 1.3rem; }

  /* Section head */
  .section-head { margin-bottom: 32px; }
  .section-head p { font-size: 0.97rem; }

  /* Simulador */
  .sim-grid { padding: 18px; gap: 24px; }
  .result-grid { gap: 10px; }
  .result-card { padding: 14px; }
  .result-card strong { font-size: 1.2rem; }
  .result-card.primary strong { font-size: 1.7rem; }
  .chart-wrap { height: 220px; padding: 10px; }

  /* Filtres ofertes */
  .filters {
    margin-bottom: 28px; gap: 6px;
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 6px; margin-left: -16px; margin-right: -16px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { padding: 8px 14px; font-size: 0.82rem; flex-shrink: 0; }

  /* Ofertes */
  .offers-grid { grid-template-columns: 1fr; gap: 14px; }
  .offer { padding: 22px; }
  .offer-tin { font-size: 1.7rem; }

  /* Comparador */
  .cmp-col { padding: 20px; }
  .cmp-row {
    grid-template-columns: 1fr;
    gap: 4px; padding: 14px 18px;
  }
  .cmp-row span { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .cmp-row b { text-align: left; font-size: 1rem; }
  .cmp-row.highlight b { font-size: 1.15rem; }
  .cmp-row.highlight { padding: 16px 18px; }
  .cmp-help { padding: 22px; margin-top: 22px; }

  /* FAQ */
  .faq-list details { padding: 16px 18px; }
  .faq-list summary { font-size: 0.96rem; gap: 10px; }

  /* Contact */
  .contact-form { padding: 22px; }
  .file-label input[type="file"] { padding: 12px; font-size: 0.82rem; }

  /* Ecosystem */
  .eco-card { flex-direction: column; text-align: center; padding: 26px; gap: 18px; }
  .eco-card h3 { font-size: 1.25rem; }
  .eco-card p { font-size: 0.94rem; }

  /* Footer */
  .footer { padding: 48px 0 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; padding-bottom: 26px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  /* Article / legal */
  .article-hero { padding: 50px 0 30px; }
  .article-hero h1 { font-size: clamp(1.6rem, 6vw, 2.1rem); }
  .article-hero .lead { font-size: 1rem; }
  .article-content { padding: 40px 0 60px; }
  .article-content h2 { font-size: 1.3rem; margin-top: 32px; }
  .article-content h3 { font-size: 1.05rem; }
  .article-content .toc { padding: 16px 18px; }
  .article-content .highlight-box { padding: 16px 18px; }
  .article-content table { font-size: 0.86rem; }
  .article-content table td, .article-content table th { padding: 9px 11px; }

  /* Related */
  .related { padding: 44px 0; }
  .related-grid { grid-template-columns: 1fr; gap: 12px; }
  .related-card { padding: 18px; }

  /* Article CTA */
  .article-cta { padding: 22px; }
  .article-cta h3 { font-size: 1.1rem; }

  /* Inputs i formularis */
  input, select, textarea { font-size: 16px !important; } /* prevents iOS zoom */
  .input-wrap input { font-size: 16px; }
}

/* Mòbil estret (≤420px) */
@media (max-width: 420px) {
  .container, .container-narrow { padding: 0 14px; }
  .btn { padding: 11px 16px; font-size: 0.9rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .hero-stats div { flex: 1 1 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .lang-toggle button { padding: 4px 8px; font-size: 0.72rem; }
  .logo svg { width: 22px; height: 22px; }
  .logo { font-size: 0.86rem; }
  .offer { padding: 18px; }
  .offer-tin { font-size: 1.5rem; }
  .quota-mock .big-num { font-size: 1.8rem; }
  .result-card.primary strong { font-size: 1.5rem; }
  .filter { padding: 7px 12px; font-size: 0.78rem; }
}

/* Article tables — scroll horitzontal automàtic en mòbil */
@media (max-width: 720px) {
  .article-content .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px -16px;
    padding: 0 16px;
  }
  .article-content .table-wrap table { margin: 0; min-width: 480px; }
}
@media (min-width: 721px) {
  .article-content .table-wrap { display: contents; }
}
