:root {
  --blue: #0062a2;
  --blue-dark: #00416d;
  --orange: #f28c00;
  --orange-dark: #bf6e00;
  --ink: #1c2733;
  --ink-soft: #4b5a68;
  --bg: #ffffff;
  --bg-alt: #f4f7fa;
  --border: #e3e9ee;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 98, 162, 0.12);
  --font-head: "Hind", sans-serif;
  --font-body: "Open Sans", sans-serif;
}

* { 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.6;
}

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow { max-width: 760px; }

.section { padding: 64px 0; }
.section--info { background: var(--bg); }

/* Text de contingut justificat a tota la web (landing i pàgines legals).
   La partició de mots és necessària: sense hyphens, el català deixa espais massa
   amples entre paraules en les línies justificades.
   S'exclouen els elements d'interfície centrats (notes, peu, banner). */
.section__lead,
.legal__body p,
.legal__list li {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* El subtítol identificatiu de les pàgines legals es llegeix millor sense
   justificar: són dues línies curtes i el justificat les separa massa. */
.section--legal .section__lead {
  text-align: left;
  hyphens: manual;
}
.section--organiza { background: var(--bg-alt); padding: 48px 0; }
.section--compra { background: var(--bg); }
.section--legal { background: var(--bg-alt); }
.section--suport { background: var(--bg-alt); }

.section__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  color: var(--blue-dark);
  margin: 0 0 20px;
}

.section__lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* ---------- PAGE HEADER (subpàgines legals) ---------- */
.page-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.page-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  flex-wrap: wrap;
}

.page-header__logo { height: 36px; width: auto; }

.page-header__back {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--blue-dark);
  text-decoration: none;
}

.page-header__back:hover { text-decoration: underline; }

/* ---------- AVÍS D'IDIOMA ---------- */
.lang-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--blue-dark);
  color: #fff;
  padding: 12px clamp(44px, 6vw, 64px) 12px clamp(16px, 4vw, 24px);
  font-size: 0.92rem;
  position: relative;
}

.lang-hint__text { color: #cfe0ee; }

.lang-hint__go {
  font-family: var(--font-head);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 1px;
  white-space: nowrap;
}

.lang-hint__go:hover { color: var(--orange); }

.lang-hint__close {
  position: absolute;
  right: clamp(10px, 2vw, 18px);
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #9fc0da;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 6px;
}

.lang-hint__close:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

/* ---------- SELECTOR D'IDIOMA ---------- */
.lang-switch {
  position: absolute;
  top: clamp(16px, 3vh, 28px);
  right: clamp(20px, 5vw, 48px);
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.lang-switch__item {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch__item:hover { background: rgba(255, 255, 255, 0.22); }

.lang-switch__item.is-active {
  background: #fff;
  color: var(--blue-dark);
}

/* Variant per a la capçalera clara de les pàgines legals. */
.lang-switch--inline {
  position: static;
  background: var(--bg);
  border-color: var(--border);
}

.lang-switch--inline .lang-switch__item { color: var(--ink-soft); }
.lang-switch--inline .lang-switch__item:hover { background: var(--border); }

.lang-switch--inline .lang-switch__item.is-active {
  background: var(--blue);
  color: #fff;
}

.page-header__right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  /* El bloc (epígraf + títol + dades + CTA) queda centrat verticalment:
     evita que el contingut s'enganxi a dalt i deixi un buit a sota. */
  justify-content: center;
  overflow: hidden;
  color: #fff;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Contingut centrat verticalment: el degradat és més dens al centre, on hi ha
   el text, i s'aclareix als extrems perquè la fotografia respiri. */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 30, 48, 0.62) 0%, rgba(10, 30, 48, 0.82) 45%, rgba(10, 30, 48, 0.82) 62%, rgba(10, 30, 48, 0.55) 100%);
  z-index: 1;
}

/* Text a dalt a l'esquerra, CTA a la dreta. */
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 clamp(20px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Prou ample perquè "Plasma Enriquit amb Plaquetes (PRP)" càpiga en una línia. */
.hero__text { max-width: 940px; }

/* CTA posicionat de manera absoluta: així queda a l'alçada volguda sense alterar
   el centrat vertical del bloc de títol (si formés part del flux, el marge es
   repartiria amunt i avall i el botó no baixaria prou). */
.hero__action {
  position: absolute;
  left: 63%;
  bottom: 15%;
  z-index: 2;
}

/* Ancorat a la part superior del hero i fora del flux, perquè el bloc de títol
   pugui quedar centrat verticalment sense arrossegar l'epígraf. */
.hero__eyebrow {
  position: absolute;
  top: clamp(48px, 9vh, 92px);
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--orange);
  margin: 0;
  padding: 0 clamp(20px, 5vw, 48px);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
}

.hero__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.8rem, 4.4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 16px;
}

.hero__meta {
  font-size: 1.05rem;
  color: #dce8f2;
  margin: 0;
  line-height: 1.8;
}

/* CTA més gran que la resta de botons: és l'acció principal de la pàgina. */
/* .btn.hero__cta (doble classe) perquè guanyi a .btn, que es declara més avall
   amb la mateixa especificitat i altrament trepitjaria mida i padding. */
.btn.hero__cta {
  font-size: 1.15rem;
  padding: 18px 40px;
  white-space: nowrap;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  background: var(--orange);
  color: #21160a;
  box-shadow: 0 8px 20px rgba(242, 162, 48, 0.35);
}

.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(242, 162, 48, 0.45); }

.btn--primary:disabled {
  background: #cfd6dc;
  color: #7c8791;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn--outline {
  background: transparent;
  color: var(--blue-dark);
  border: 2px solid var(--blue);
  padding: 12px 26px;
}

.btn--outline:hover { background: var(--blue); color: #fff; }

.btn--block { display: block; width: 100%; text-align: center; }

/* ---------- ORGANITZA ---------- */
.organiza__label {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.organiza__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.organiza__logo { height: 56px; width: auto; }

/* ---------- COMPRA CARD ---------- */
.compra-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0 24px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--ink);
}

.check input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  flex-shrink: 0;
}

.check a { color: var(--blue-dark); font-weight: 600; }

.compra-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 12px 0 0;
}

.compra-note[hidden] { display: none; }

/* Porta de consentiment del mòdul extern */
.compra-gate {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 8px;
}

.compra-gate[hidden] { display: none; }

.compra-gate__note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
}

.compra-gate__note a { color: var(--blue-dark); font-weight: 600; }

/* Contenidor del widget de Weezevent */
.weez-widget { margin-top: 8px; }
.weez-widget[hidden] { display: none; }

.weez-widget iframe {
  width: 100%;
  min-height: 650px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

/* Estat previ a la transformació per weez.js: l'ancora es veu com un botó, de
   manera que segueix sent útil si l'script no arriba a carregar. */
.weez-widget > a.weezevent-widget-integration {
  display: block;
  text-align: center;
  background: var(--orange);
  color: #21160a;
  font-family: var(--font-head);
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
}

.weez-widget__pending {
  margin: 0;
  padding: 18px 20px;
  background: #fff7e6;
  border: 1px solid #f2d896;
  border-radius: 10px;
  font-size: 0.92rem;
  color: #8b6b1f;
}

/* ---------- BANNER DE COOKIES ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: #fff;
  border-top: 3px solid var(--blue);
  box-shadow: 0 -6px 24px rgba(0, 65, 109, 0.18);
  padding: 20px clamp(16px, 4vw, 32px);
}

.cookie-banner[hidden] { display: none; }

.cookie-banner__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner__text { flex: 1 1 420px; }

.cookie-banner__title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.cookie-banner__text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.cookie-banner__text a { color: var(--blue-dark); font-weight: 600; }

/* Mateixa mida i pes visual per acceptar i rebutjar: l'AEPD exigeix que
   rebutjar no tingui més fricció que acceptar. */
.cookie-banner__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn--sm {
  padding: 11px 24px;
  font-size: 0.92rem;
  min-width: 132px;
  text-align: center;
}

/* ---------- LEGAL ---------- */
.legal__subtitle {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--ink);
  margin: 0 0 16px;
}

.legal__list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}

.legal__list li { margin-bottom: 12px; }

.legal__body p { color: var(--ink-soft); margin: 0 0 14px; }

.table-scroll {
  overflow-x: auto;
  margin: 0 0 24px;
  -webkit-overflow-scrolling: touch;
}

.legal__table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.legal__table th,
.legal__table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.legal__table th {
  background: var(--blue);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
}

.legal__table td { color: var(--ink-soft); }

.legal__table tr:last-child td { border-bottom: none; }

.legal__table code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.legal__disclaimer {
  font-size: 0.85rem;
  font-style: italic;
  color: #8b6b1f;
  background: #fff7e6;
  border: 1px solid #f2d896;
  border-radius: 8px;
  padding: 10px 14px;
}

/* ---------- SUPORT ---------- */
/* Sense flex-wrap: el correu queda sempre a la dreta, a la mateixa línia que el
   text, igual a les dues caixes. En mòbil la media query les apila en columna. */
.suport-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.suport-banner__text {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.suport-banner__mail {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--blue-dark);
  text-decoration: none;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 2px;
  white-space: nowrap;
}

.suport-banner__mail:hover { color: var(--blue); }

.suport-banner + .suport-banner { margin-top: 16px; }

/* ---------- FOOTER ---------- */
.footer {
  background: var(--blue-dark);
  color: #cfe0ee;
  padding: 48px 0 32px;
}

/* Organitzadors a l'esquerra, col·laboradors a la dreta, en una sola fila. */
.footer__brands {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.footer__brand-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__brand-group--right { align-items: flex-end; }

.footer__brand-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: #9fc0da;
}

.footer__brand-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer__brand-group--right .footer__brand-logos { justify-content: flex-end; }

.footer__logo {
  height: 46px;
  width: auto;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}

/* Excepció: el logo de BSA porta transparència i el seu propi fons de color,
   així que llueix directament sobre el blau del peu, sense caixa blanca.
   La resta de logos sí que la necessiten (l'Ajuntament és blau sobre blau i el
   de Fixaplus ni tan sols té canal alfa). */
.footer__logo--bsa {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Més alts que abans: a 34px els logos de BTI i Fixaplus resultaven il·legibles. */
.footer__sponsor-logo {
  height: 46px;
  width: auto;
  background: #fff;
  padding: 6px 12px;
  border-radius: 6px;
}

.footer__divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 24px 0;
}

.footer__legal {
  text-align: center;
  font-size: 0.8rem;
  color: #9fc0da;
}

.footer__legal p { margin: 4px 0; }

.footer__links { margin-top: 12px !important; }
.footer__links a { color: #cfe0ee; text-decoration: underline; }
.footer__links a:hover { color: #fff; }
.footer__links span { margin: 0 8px; color: #6f97b3; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .suport-banner { flex-direction: column; text-align: center; }
  .organiza__logos { gap: 28px; }
  /* En mòbil el CTA torna al flux normal, sota el text i al marge esquerre. */
  .hero__action {
    position: static;
    margin-top: 36px;
    padding: 0 clamp(20px, 5vw, 48px);
  }
  .footer__brands { flex-direction: column; gap: 28px; }
  .footer__brand-group--right { align-items: flex-start; }
  .footer__brand-group--right .footer__brand-logos { justify-content: flex-start; }
  .cookie-banner__actions { width: 100%; }
  .cookie-banner__actions .btn { flex: 1 1 auto; }
}
