/* ============================================================
   Dínamis Economistes & Advocats — estils web
   Disseny: estil "Business & Commercial" (21st.dev) adaptat a
   la marca Dínamis: gris carbó + vermell corporatiu, cantonades
   rectes, línies fines, etiquetes en majúscules, xifres tabulars.
   Tipografia: Cinzel (logo) · Lora (titulars) · Inter (text)
   ============================================================ */

:root {
  --carbon-900: #2c2c2e;   /* panell fosc */
  --carbon-800: #38383a;
  --carbon-700: #5b5b5b;   /* gris del logotip */
  --red: #c1121f;          /* vermell corporatiu */
  --red-dark: #9c0e18;
  --ink: #333333;
  --muted: #6e6e74;
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --line: #e4e4e6;
  --line-dark: rgba(255,255,255,.12);
  --container: 1200px;
  --space: clamp(72px, 9vw, 128px);
  --font-head: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Logo: la tipografia oficial és Exotc350 Lt BT (no disponible en CDN);
     Josefin Sans Light és el substitut web acordat */
  --font-logo: "Josefin Sans", "Century Gothic", "Avenir Next", sans-serif;
  --logo-grey: #605e5e;   /* gris oficial del logotip */
  --logo-red: #c72726;    /* vermell oficial de la Í */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--carbon-700); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--red-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.18;
  font-weight: 600;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); letter-spacing: -.5px; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.section { padding: var(--space) 0; }
.bg-soft { background: var(--bg-soft); }
.bg-dark { background: var(--carbon-900); color: #c9c9cc; }
.bg-dark h1, .bg-dark h2, .bg-dark h3 { color: #fff; }

/* Secció amb foto de fons difuminada + vel fosc perquè el text es llegeixi */
.bg-photo { position: relative; background: var(--carbon-900); color: #c9c9cc; overflow: hidden; }
.bg-photo h1, .bg-photo h2, .bg-photo h3 { color: #fff; }
.bg-photo::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("../img/oficina-facana.jpg");
  background-size: cover; background-position: center;
  filter: grayscale(.3) blur(3px); transform: scale(1.06);
  opacity: .28;
}
.bg-photo > * { position: relative; z-index: 1; }

/* Etiqueta en majúscules, tracking ample (patró 21st) */
.eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--red-dark);
  margin-bottom: 16px;
}
.bg-dark .eyebrow { color: rgba(255,255,255,.45); }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }
.num-tab { font-variant-numeric: tabular-nums; }

/* ---------- Botons (rectes, sense radi) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 48px; padding: 0 28px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; border-radius: 0;
  cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--carbon-800); }
.btn-ghost:hover { border-color: var(--red); color: var(--red-dark); }
/* variants sobre fons fosc */
.btn-light { background: #fff; color: var(--carbon-900); }
.btn-light:hover { background: #f0f0f1; color: var(--carbon-900); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.75); }
.btn-outline:hover { border-color: rgba(255,255,255,.6); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.brand .logo { font-family: var(--font-logo); font-size: 1.7rem; font-weight: 300; color: var(--logo-grey); letter-spacing: .28em; text-transform: uppercase; }
.brand .logo .ac { color: var(--logo-red); }
.brand .tag { font-family: var(--font-logo); font-size: .56rem; font-weight: 300; letter-spacing: .52em; text-transform: uppercase; color: var(--logo-grey); padding-left: .1em; }

.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-weight: 500; font-size: .94rem; color: var(--ink); }
.nav-links a:hover { color: var(--red-dark); }

.nav-actions { display: flex; align-items: center; gap: 16px; }
.lang-switch { font-size: .85rem; font-weight: 600; color: var(--muted); }
.lang-switch a.active { color: var(--ink); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 30px; height: 24px; position: relative; }
.nav-toggle span { position: absolute; left: 0; width: 100%; height: 2.5px; background: var(--ink); transition: .3s; }
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 22px; }
.nav-toggle.open span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

/* ---------- Hero clar, centrat, amb trama subtil ---------- */
.hero {
  position: relative;
  background-color: #fcfcfc;
  /* trama elegant molt suau: punts finíssims + degradat blanc */
  background-image:
    radial-gradient(rgba(44,44,46,.045) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f4f4f5 100%);
  background-size: 22px 22px, 100% 100%;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-inner {
  position: relative; text-align: center;
  padding: clamp(52px, 6.5vw, 84px) 0;
  max-width: 760px; margin: 0 auto;
}
.hero-badge {
  display: block;
  font-size: .72rem; font-weight: 600; letter-spacing: .3em;
  text-transform: uppercase; color: var(--red-dark); margin-bottom: 20px;
}
.hero h1 { color: var(--ink); margin-bottom: 18px; font-size: clamp(2rem, 4vw, 2.9rem); }
.hero h1 .ac { color: var(--red); }
.hero .sub { font-size: 1.1rem; color: var(--muted); max-width: 52ch; margin: 0 auto 30px; }

/* taula d'especificacions amb línies fines, centrada */
.hero-specs { margin: 0 auto 30px; border-top: 1px solid var(--line); max-width: 520px; }
.hero-specs > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hero-specs dt { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hero-specs dd { margin: 0; font-weight: 600; font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Franja d'àrees de servei */
.areas-strip { background: #fff; border-bottom: 1px solid var(--line); text-align: center; padding: 16px 0; }
.areas-strip .inner { font-family: var(--font-logo); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: #7a7a7a; }
.areas-strip span:not(:last-child)::after { content: "·"; color: var(--red); margin: 0 .55em; font-weight: 700; }

/* ---------- Pilars de valor afegit ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-right: 0; }
.pillar { border-right: 1px solid var(--line); padding: 40px 34px 36px; background: #fff; display: flex; flex-direction: column; transition: background .2s ease; }
.pillar:hover { background: var(--bg-soft); }
.pillar .n { font-size: .78rem; font-weight: 600; letter-spacing: .2em; color: var(--red); margin-bottom: 22px; font-variant-numeric: tabular-nums; }
.pillar h3 { margin-bottom: 10px; }
.pillar > p { color: var(--muted); font-size: .96rem; }
.pillar ul { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.pillar li { font-size: .9rem; color: var(--ink); display: flex; gap: 10px; align-items: baseline; }
.pillar li::before { content: "—"; color: var(--red); flex-shrink: 0; }

/* banda de qualitat diferencial */
.quality-band {
  margin-top: 0; border: 1px solid var(--line); border-top: 0;
  background: var(--carbon-900); color: #fff;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  padding: 30px 34px;
}
.quality-band p { margin: 0; font-family: var(--font-head); font-size: 1.15rem; color: rgba(255,255,255,.92); }
.quality-band p b { color: #fff; }
.quality-band .eyebrow { margin: 0 0 6px; display: block; }

/* ---------- Grids i targetes ---------- */
.grid { display: grid; gap: 0; }
.grid-2 { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 56px; }

.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-right: 0; border-bottom: 0; }
.card {
  background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 36px 32px; transition: background .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { background: var(--bg-soft); }
.card .k { font-size: .72rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--red-dark); margin-bottom: 16px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); margin-bottom: 0; font-size: .96rem; }
.card .more { margin-top: 18px; font-weight: 600; color: var(--red-dark); font-size: .92rem; }

/* ---------- Capçalera de secció ---------- */
.section-head { max-width: 660px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* ---------- Qui som ---------- */
.about-text p { color: var(--muted); }
.about-quote {
  border-left: 3px solid var(--red); padding: 6px 0 6px 22px;
  font-family: var(--font-head); font-size: 1.22rem; color: var(--carbon-800);
  font-style: italic; margin: 26px 0;
}
.values-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.values-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); }
.values-list svg { color: var(--red-dark); flex-shrink: 0; margin-top: 4px; }

/* Foto de l'oficina enquadrada dins Qui som */
.about-photo { margin-top: 28px; border: 1px solid var(--line); overflow: hidden; }
.about-photo img { width: 100%; height: auto; display: block; }
.about-photo figcaption { font-size: .78rem; color: var(--muted); padding: 10px 14px; background: var(--bg-soft); border-top: 1px solid var(--line); }

.about-aside { background: var(--carbon-900); padding: 42px 38px; color: #cfcfcf; }
.about-aside h3 { color: #fff; }
.about-aside > p { color: #b5b5b5; }
.about-aside .partner { padding: 15px 0; border-bottom: 1px solid var(--line-dark); }
.about-aside .partner:last-child { border-bottom: 0; padding-bottom: 0; }
.about-aside .partner strong { color: #e6606a; display: block; font-family: var(--font-head); font-size: 1.02rem; }
.about-aside .partner span { font-size: .9rem; color: #b0b0b0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-dark); border-right: 0; }
.stat { text-align: center; padding: 34px 16px; border-right: 1px solid var(--line-dark); }
.stat .num { font-family: var(--font-head); font-size: clamp(2.2rem, 4.6vw, 3.1rem); color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .num .ac { color: #e6606a; }
.stat .lbl { color: rgba(255,255,255,.5); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 12px; }

/* ---------- Ressenyes ---------- */
.reviews-grid.filled { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-right: 0; }
.review { background: #fff; border-right: 1px solid var(--line); padding: 32px 30px; display: flex; flex-direction: column; }
.review .stars { color: var(--red); font-size: 1.05rem; letter-spacing: 3px; margin-bottom: 14px; }
.review .quote { color: var(--ink); font-family: var(--font-head); font-style: italic; font-size: 1.02rem; line-height: 1.55; margin-bottom: 20px; flex: 1; }
.review .who { font-weight: 600; color: var(--ink); }
.review .who span { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); margin-top: 2px; }
@media (max-width: 940px) { .reviews-grid.filled { grid-template-columns: 1fr; border-right: 1px solid var(--line); } .review { border-right: 0; border-bottom: 1px solid var(--line); } .review:last-child { border-bottom: 0; } }
.reviews-cta { text-align: center; margin-top: 44px; }
.g-badge { display: inline-flex; align-items: center; gap: 9px; font-size: .95rem; color: var(--muted); margin-bottom: 26px; }
.g-badge b { color: var(--ink); font-size: 1.05rem; }
.g-badge .gstars { color: var(--red); letter-spacing: 2px; }

/* ---------- Contacte ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-info .item { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.contact-info .item .ic {
  width: 44px; height: 44px; border: 1px solid var(--line); background: #fff;
  color: var(--carbon-800); display: grid; place-items: center; flex-shrink: 0;
}
.contact-info .item strong { display: block; color: var(--ink); font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 3px; }
.contact-info .item a, .contact-info .item span { color: var(--muted); }
.contact-info .item a:hover { color: var(--red-dark); }

form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
form label { display: block; font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--carbon-800); margin: 0 0 7px; }
form .field { margin-bottom: 18px; }
form input, form select, form textarea {
  width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 0;
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
form input:focus, form select:focus, form textarea:focus {
  outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px rgba(193,18,31,.12);
}
form textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: .82rem; color: var(--muted); margin-top: 6px; }

/* Bloc de consentiment RGPD del formulari */
.consent { border: 1px solid var(--line); background: var(--bg-soft); padding: 16px 18px; margin-bottom: 20px; }
.consent .form-note { margin: 0 0 10px; }
.consent label.check {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .82rem; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--ink); margin-bottom: 10px; cursor: pointer;
}
.consent label.check:last-child { margin-bottom: 0; }
.consent label.check input { width: auto; margin-top: 3px; accent-color: var(--red); }

/* ---------- Mapa ---------- */
.map-embed { margin-top: 46px; border: 1px solid var(--line); }
.map-embed iframe { width: 100%; height: 380px; border: 0; display: block; filter: grayscale(.2); }

/* ---------- WhatsApp flotant ---------- */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; background: #25d366;
  display: grid; place-items: center; box-shadow: 0 6px 22px rgba(37,211,102,.45);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; color: #fff; }

/* ---------- Footer ---------- */
.footer { background: var(--carbon-900); color: #a8a8ad; padding: 64px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.footer h4 { color: #fff; font-family: var(--font-body); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 18px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer a { color: #a8a8ad; font-size: .95rem; }
.footer a:hover { color: #e6606a; }
.footer .brand .logo { color: #fff; }
.footer .brand .tag { color: #a8a8ad; }
.footer .desc { font-size: .95rem; max-width: 40ch; margin-top: 16px; color: #a8a8ad; }
.footer-bottom { border-top: 1px solid var(--line-dark); padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .85rem; color: #8a8a90; }

/* ---------- Banner de cookies ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--carbon-900); color: rgba(255,255,255,.85);
  border-top: 3px solid var(--red);
  padding: 20px 28px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.25);
}
.cookie-banner p { max-width: 980px; margin: 0 auto 14px; font-size: .84rem; line-height: 1.55; }
.cookie-banner a { color: #e6606a; font-weight: 600; }
.cookie-banner a:hover { color: #fff; }
.cookie-config { max-width: 980px; margin: 0 auto 14px; display: grid; gap: 8px; font-size: .88rem; }
.cookie-config[hidden] { display: none; }
.cookie-config label { display: flex; align-items: center; gap: 9px; }
.cookie-actions { max-width: 980px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .btn { height: 42px; padding: 0 22px; font-size: .88rem; }

/* ---------- Animació d'aparició ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .pillars { grid-template-columns: 1fr; border-right: 1px solid var(--line); border-bottom: 0; }
  .pillar { border-right: 0; border-bottom: 1px solid var(--line); }
  .quality-band { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .about-aside { margin-top: 8px; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 760px) {
  .nav-links {
    position: fixed; inset: 78px 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 0; background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 24px 24px; transform: translateY(-130%); transition: transform .3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,.1);
  }
  .nav-links.open { transform: none; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; }
  .nav-toggle { display: block; }
  .desktop-cta { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-dark); }
  .stat { border-bottom: 1px solid var(--line-dark); }
  form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
