/* ==========================================================================
   MON-CAP GESTIÓ — styles.css
   ========================================================================== */

:root {
  --paper: #FBFAF6;
  --surface: #FFFFFF;
  --ink: #16232E;
  --ink-soft: #4A5A66;
  --line: #E5E0D5;
  --brand: #1E57E6;
  --brand-deep: #1A54EA;
  --brand-on: #F3F6FF;
  --accent: #BC8130;
  --accent-soft: #E7D5AC;
  --shadow: 0 1px 2px rgba(20,35,46,.05), 0 8px 28px rgba(20,35,46,.06);
  --maxw: 1120px;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F191F; --surface: #16232C; --ink: #EDE9DF; --ink-soft: #A3B0B8;
    --line: #26333C; --brand: #6EA4F7; --brand-deep: #12224E; --brand-on: #EAF1FF;
    --accent: #D6A24E; --accent-soft: #3A3320;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="light"] {
  --paper: #FBFAF6; --surface: #FFFFFF; --ink: #16232E; --ink-soft: #4A5A66;
  --line: #E5E0D5; --brand: #1E57E6; --brand-deep: #1A54EA; --brand-on: #F3F6FF;
  --accent: #BC8130; --accent-soft: #E7D5AC;
  --shadow: 0 1px 2px rgba(20,35,46,.05), 0 8px 28px rgba(20,35,46,.06);
}
:root[data-theme="dark"] {
  --paper: #0F191F; --surface: #16232C; --ink: #EDE9DF; --ink-soft: #A3B0B8;
  --line: #26333C; --brand: #6EA4F7; --brand-deep: #12224E; --brand-on: #EAF1FF;
  --accent: #D6A24E; --accent-soft: #3A3320;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.15; text-wrap: balance; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }
.eyebrow {
  font-family: -apple-system, "Segoe UI", sans-serif;
  text-transform: uppercase; letter-spacing: .16em; font-size: .72rem;
  font-weight: 700; color: var(--accent); margin: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- Header ---------- */
#site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; min-height: 70px; }
.brand-mark { display: flex; align-items: center; margin-right: auto; text-decoration: none; }
.logo-img { display: block; height: 44px; width: auto; background: #fff; padding: 4px 10px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links > a { text-decoration: none; font-size: .93rem; color: var(--ink-soft); font-weight: 500; transition: color .15s; }
.nav-links > a:hover, .nav-links > a[aria-current="page"] { color: var(--brand); }
.nav-cta {
  background: var(--brand); color: #fff !important; padding: 9px 16px; border-radius: 8px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--brand-deep); }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang a { text-decoration: none; font-size: .76rem; font-weight: 600; letter-spacing: .03em; padding: 6px 10px; color: var(--ink-soft); transition: background .15s, color .15s; }
.lang a.on { background: var(--brand); color: #fff; }
.lang a:not(.on):hover { color: var(--ink); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--surface); cursor: pointer; padding: 0 11px; margin-left: auto;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .brand-mark { margin-right: 0; }
  .nav { flex-wrap: wrap; }
  .nav-links {
    flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 4px;
    max-height: 0; overflow: hidden; transition: max-height .28s ease; margin: 0;
  }
  .nav-links.open { max-height: 520px; padding-bottom: 16px; }
  .nav-links > a { padding: 12px 6px; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav-cta { text-align: center; margin-top: 8px; }
  .lang { align-self: flex-start; margin-top: 10px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  font-weight: 600; font-size: .92rem; border-radius: 8px; padding: 12px 20px;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #1a1206; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-ghost { background: transparent; border-color: color-mix(in srgb, var(--brand-on) 45%, transparent); color: var(--brand-on); }
.btn-ghost:hover { background: color-mix(in srgb, var(--brand-on) 14%, transparent); }
.btn-line { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--brand-deep); color: var(--brand-on); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0 46px, color-mix(in srgb, var(--brand-on) 6%, transparent) 46px 47px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, #000);
  mask-image: linear-gradient(to bottom, transparent, #000 40%, #000);
  pointer-events: none;
}
.hero-inner { position: relative; padding: clamp(52px, 8vw, 96px) 0 clamp(48px, 7vw, 84px); max-width: 720px; }
.hero .eyebrow { color: var(--accent-soft); }
:root[data-theme="dark"] .hero .eyebrow { color: var(--accent); }
:root[data-theme="light"] .hero .eyebrow { color: var(--accent-soft); }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); margin: 16px 0 0; letter-spacing: -.015em; }
.hero .lede { margin-top: 20px; font-size: clamp(1.05rem, 2.2vw, 1.26rem); color: color-mix(in srgb, var(--brand-on) 84%, transparent); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.trust { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 42px; padding-top: 26px; border-top: 1px solid color-mix(in srgb, var(--brand-on) 18%, transparent); }
.trust div { max-width: 15em; }
.trust dt { font-family: Georgia, serif; font-size: 1.04rem; color: var(--brand-on); }
.trust dd { margin-top: 4px; font-size: .88rem; color: color-mix(in srgb, var(--brand-on) 74%, transparent); }

/* ---------- Sections ---------- */
section { scroll-margin-top: 84px; }
.band { padding: clamp(56px, 8vw, 92px) 0; }
.pt-0 { padding-top: clamp(32px, 5vw, 52px); }
.pt-0-tight { padding-top: 0; }
.sec-head { max-width: 640px; margin-bottom: 40px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin-top: 12px; letter-spacing: -.01em; }
.sec-head p { margin-top: 14px; color: var(--ink-soft); font-size: 1.05rem; }

/* Page head (interior pages) */
.page-head { padding: clamp(30px, 5vw, 52px) 0 8px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-top: 10px; letter-spacing: -.015em; }
.page-sub { margin-top: 14px; color: var(--ink-soft); font-size: 1.1rem; max-width: 40em; }
.crumb { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--ink-soft); margin-bottom: 18px; flex-wrap: wrap; }
.crumb a { text-decoration: none; color: var(--ink-soft); }
.crumb a:hover { color: var(--brand); }
.crumb span[aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Service cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 24px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.card .ico { width: 40px; height: 40px; margin-bottom: 18px; color: var(--brand); }
.card h3 { font-size: 1.16rem; }
.card p { margin-top: 8px; color: var(--ink-soft); font-size: .93rem; line-height: 1.55; }
.card-more { margin-top: 16px; color: var(--brand); font-weight: 600; font-size: .88rem; }

/* ---------- About ---------- */
.about { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 68px); align-items: center; }
.about-grid h2 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); }
.pillars { display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pillars.pillars-3 { grid-template-columns: repeat(3, 1fr); }
.pillars div { background: var(--surface); padding: 22px 24px; }
.pillars dt { font-family: Georgia, serif; font-size: 1.14rem; color: var(--brand); }
.pillars dd { margin-top: 6px; color: var(--ink-soft); font-size: .92rem; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } .pillars.pillars-3 { grid-template-columns: 1fr; } }

/* ---------- Prose ---------- */
.prose { max-width: 66ch; }
.prose p { color: var(--ink-soft); font-size: 1.05rem; }
.prose p + p { margin-top: 16px; }
.prose .lead { color: var(--ink); font-size: 1.18rem; }

/* ---------- Service detail ---------- */
.service-head .service-title { display: flex; gap: 18px; align-items: flex-start; margin-top: 8px; }
.service-ico { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 13px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand); }
.service-ico .ico { width: 30px; height: 30px; }
.service-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.service-cta-card { position: sticky; top: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.service-cta-card h2 { font-size: 1.35rem; }
.service-cta-card p { color: var(--ink-soft); font-size: .95rem; margin-bottom: 4px; }
@media (max-width: 820px) { .service-grid { grid-template-columns: 1fr; } .service-cta-card { position: static; } }

.points-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.point h3 { font-size: 1.05rem; color: var(--ink); }
.point p { margin-top: 7px; color: var(--ink-soft); font-size: .9rem; }

.other-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.other-item { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.other-item:hover { border-color: var(--brand); transform: translateX(2px); }
.other-item .ico-sm { width: 22px; height: 22px; color: var(--brand); flex: 0 0 auto; }
.other-item span:nth-child(2) { flex: 1; font-weight: 500; font-size: .95rem; }
.other-item .arr { color: var(--brand); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--brand-deep); color: var(--brand-on); }
.cta-inner { padding: clamp(44px, 6vw, 68px) 0; display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; }
.cta-inner h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.cta-inner p { margin-top: 8px; color: color-mix(in srgb, var(--brand-on) 82%, transparent); max-width: 34em; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 6vw, 60px); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { display: grid; gap: 22px; }
.ci { display: flex; gap: 14px; align-items: flex-start; }
.ci .ico { width: 22px; height: 22px; color: var(--brand); flex: 0 0 auto; margin-top: 2px; }
.ci .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); font-weight: 700; }
.ci .v { font-size: 1.02rem; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.ci a.v:hover { color: var(--brand); }

form { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(24px, 4vw, 32px); box-shadow: var(--shadow); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; width: 100%; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.form-note { margin-top: 10px; font-size: .82rem; color: var(--ink-soft); }
.alert { border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; font-size: .95rem; }
.alert-ok { background: color-mix(in srgb, #1f9d55 16%, var(--surface)); border: 1px solid color-mix(in srgb, #1f9d55 45%, var(--line)); color: color-mix(in srgb, #1f9d55 70%, var(--ink)); }
.alert-err { background: color-mix(in srgb, #d64545 14%, var(--surface)); border: 1px solid color-mix(in srgb, #d64545 45%, var(--line)); color: color-mix(in srgb, #d64545 72%, var(--ink)); }

.map-wrap { border-top: 1px solid var(--line); }

/* ---------- Footer ---------- */
footer { background: var(--brand-deep); color: var(--brand-on); padding: 56px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr; gap: 36px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand .logo-img { height: 40px; margin-bottom: 14px; }
.foot-brand p { color: color-mix(in srgb, var(--brand-on) 76%, transparent); font-size: .95rem; max-width: 30em; }
footer h4 { font-family: -apple-system, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: var(--accent-soft); margin-bottom: 14px; }
:root[data-theme="dark"] footer h4 { color: var(--accent); }
.foot-links { display: grid; gap: 9px; }
footer a, footer .foot-links span { color: color-mix(in srgb, var(--brand-on) 80%, transparent); text-decoration: none; font-size: .93rem; }
footer a:hover { color: var(--brand-on); }
.foot-bottom { margin-top: 42px; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--brand-on) 18%, transparent); font-size: .82rem; color: color-mix(in srgb, var(--brand-on) 64%, transparent); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Legal page ---------- */
.prose.legal { max-width: 74ch; }
.prose.legal h2 { font-size: 1.4rem; margin-top: 36px; margin-bottom: 10px; color: var(--ink); }
.prose.legal h2:first-child { margin-top: 0; }
.prose.legal p { margin-top: 10px; }

/* ---------- Map consent placeholder ---------- */
.map-holder { position: relative; width: 100%; height: 400px; background: var(--surface); border-top: 1px solid var(--line); }
.map-holder iframe { width: 100%; height: 100%; border: 0; filter: saturate(.95); display: block; }
.map-consent { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.map-consent p { color: var(--ink-soft); font-size: .95rem; max-width: 32em; margin: 0; }

/* ---------- Cookie modal ---------- */
.cookie-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 14, 20, .55);
  display: none; align-items: flex-end; justify-content: center; padding: 16px;
}
.cookie-overlay.show { display: flex; }
@media (min-width: 640px) { .cookie-overlay { align-items: center; } }
.cookie-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.4);
  padding: 24px; width: min(560px, 100%);
  display: flex; flex-direction: column; gap: 18px;
}
.cookie-text { margin: 0; font-size: .93rem; color: var(--ink-soft); line-height: 1.6; }
.cookie-text a { color: var(--brand); font-weight: 600; text-decoration: none; }
.cookie-text a:hover { text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.cookie-actions .btn { padding: 11px 22px; }
@media (max-width: 460px) { .cookie-actions .btn { flex: 1; } }
html.cookie-lock { overflow: hidden; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .nav-links { transition: none; }
}
