/* Trobada de la Xarxa Origo · finestra emergent d'inscripció */
.otr, .otr-pastilla {
  --otr-verd: #273837;
  --otr-verd-2: #1d2b2a;
  --otr-blau: #A0C9CB;
  --otr-blau-fosc: #5f8f92;
  --otr-crema: #F5F4ED;
  --otr-paper: #FBFBF7;
  --otr-terra: #733635;
  --otr-linia: rgba(39, 56, 55, 0.14);
  --otr-text: #273837;
  --otr-suau: rgba(39, 56, 55, 0.66);
  font-family: inherit;
  color: var(--otr-text);
}
html.otr-obert { overflow: hidden; }

.otr { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 24px; }
.otr[hidden] { display: none !important; }
.otr__fons {
  position: absolute; inset: 0;
  background: rgba(17, 27, 26, 0.58);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .35s ease;
}
.otr.is-obert .otr__fons { opacity: 1; }

.otr__finestra {
  position: relative;
  display: grid;
  grid-template-columns: 360px 1fr;
  width: min(980px, 100%);
  max-height: calc(100dvh - 48px);
  background: var(--otr-paper);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 40px 120px -30px rgba(10, 20, 19, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  opacity: 0; transform: translateY(18px) scale(.985);
  transition: opacity .45s cubic-bezier(.2,.7,.2,1), transform .45s cubic-bezier(.2,.7,.2,1);
}
.otr.is-obert .otr__finestra { opacity: 1; transform: none; }

.otr__tanca {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(39, 56, 55, 0.06); color: var(--otr-verd);
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.otr__tanca:hover { background: rgba(39, 56, 55, 0.12); transform: rotate(90deg); }
.otr__tanca svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Part visual */
.otr__visual {
  position: relative;
  background: var(--otr-verd) var(--otr-img) center / cover no-repeat;
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 28px;
  min-height: 100%;
}
.otr__visual::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(29, 43, 42, 0.12) 0%, rgba(29, 43, 42, 0.2) 40%, rgba(29, 43, 42, 0.88) 100%);
}
.otr__visual > * { position: relative; }
.otr__data {
  align-self: flex-start;
  display: flex; flex-direction: column; align-items: center;
  min-width: 92px; padding: 12px 14px 10px;
  background: rgba(251, 251, 247, 0.94); color: var(--otr-verd);
  border-radius: 18px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45);
}
.otr__data-dia { font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -0.02em; }
.otr__data-mes { font-size: 14px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-top: 4px; }
.otr__data-setm { font-size: 11px; color: var(--otr-suau); margin-top: 2px; }
.otr__visual-etiqueta {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; background: rgba(160, 201, 203, 0.28); color: #e9f4f4;
  border: 1px solid rgba(160, 201, 203, 0.45); margin-bottom: 12px;
}
.otr__visual-titol { display: block; font-size: 26px; line-height: 1.2; font-weight: 700; max-width: 14ch; }

/* Cos */
.otr__cos { overflow-y: auto; padding: 30px 40px 32px; -webkit-overflow-scrolling: touch; }
.otr__passos { list-style: none; margin: 0 48px 22px 0; padding: 0; display: flex; gap: 18px; counter-reset: none; }
.otr__passos li { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--otr-suau); }
.otr__passos li span {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--otr-linia); color: var(--otr-suau); background: #fff; transition: all .3s ease;
}
.otr__passos li.is-actiu { color: var(--otr-verd); }
.otr__passos li.is-actiu span { border-color: var(--otr-verd); background: var(--otr-verd); color: #fff; }
.otr__passos li.is-fet span { border-color: var(--otr-blau-fosc); background: var(--otr-blau); color: var(--otr-verd); }

.otr__vista[hidden] { display: none !important; }
.otr__vista.is-actiu { animation: otr-entra .45s cubic-bezier(.2,.7,.2,1); }
@keyframes otr-entra { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.otr__previ { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--otr-blau-fosc); }
.otr__titol { margin: 0 0 12px; font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -0.015em; color: var(--otr-verd); }
.otr__titol--petit { font-size: 26px; }
.otr__entrada { margin: 0 0 20px; font-size: 16px; line-height: 1.6; color: var(--otr-suau); }
.otr__entrada--petita { font-size: 14.5px; margin-bottom: 18px; }

.otr__fitxa { margin: 0 0 20px; display: grid; gap: 1px; background: var(--otr-linia); border: 1px solid var(--otr-linia); border-radius: 16px; overflow: hidden; }
.otr__fitxa > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 16px; background: #fff; align-items: center; }
.otr__fitxa dt { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--otr-suau); }
.otr__fitxa dt svg { width: 18px; height: 18px; fill: none; stroke: var(--otr-blau-fosc); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.otr__fitxa dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--otr-verd); }
.otr__nota { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--otr-suau); }
.otr__falta { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #fff1d6; color: #8a5a00; }

.otr__programa { margin-bottom: 24px; }
.otr__subtitol { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--otr-verd); }
.otr__programa ol { margin: 0; padding: 0; list-style: none; counter-reset: otr; display: grid; gap: 10px; }
.otr__programa li { counter-increment: otr; position: relative; padding-left: 38px; font-size: 14.5px; line-height: 1.5; color: var(--otr-suau); }
.otr__programa li strong { color: var(--otr-verd); }
.otr__programa li::before {
  content: counter(otr); position: absolute; left: 0; top: -1px;
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--otr-verd); background: rgba(160, 201, 203, 0.35);
}

.otr__accions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.otr__boto {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px; border: 0;
  background: var(--otr-verd); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
  box-shadow: 0 14px 30px -14px rgba(39, 56, 55, 0.8);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.otr__boto:hover { background: var(--otr-verd-2); transform: translateY(-1px); color: #fff; }
.otr__boto svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.otr__boto:hover svg { transform: translateX(3px); }
.otr__boto[disabled] { opacity: .6; cursor: progress; transform: none; }
.otr__boto--clar { background: #fff; color: var(--otr-verd); border: 1px solid var(--otr-linia); box-shadow: none; }
.otr__boto--clar:hover { background: var(--otr-crema); color: var(--otr-verd); }
.otr__boto--clar:hover svg { transform: none; }
.otr__enllac { border: 0; background: none; padding: 6px 2px; font: inherit; font-size: 14px; font-weight: 600; color: var(--otr-suau); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.otr__enllac:hover { color: var(--otr-verd); }
.otr__suport { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--otr-linia); font-size: 12px; color: var(--otr-suau); }

/* Formulari */
.otr__graella { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-bottom: 18px; }
.otr__camp { display: flex; flex-direction: column; gap: 6px; }
.otr__camp[hidden] { display: none !important; }
.otr__camp > span, .otr__grup legend { font-size: 13px; font-weight: 700; color: var(--otr-verd); }
.otr__camp em, .otr__grup legend em, .otr__check em { color: var(--otr-terra); font-style: normal; }
.otr__camp small { font-weight: 500; color: var(--otr-suau); }
.otr__camp input, .otr__camp textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; color: var(--otr-verd);
  padding: 12px 14px; border: 1px solid var(--otr-linia); border-radius: 12px; background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.otr__camp textarea { resize: vertical; min-height: 64px; }
.otr__camp input:focus, .otr__camp textarea:focus { outline: none; border-color: var(--otr-blau-fosc); box-shadow: 0 0 0 4px rgba(160, 201, 203, 0.35); }
.otr__camp.is-error input { border-color: #b4483f; box-shadow: 0 0 0 4px rgba(180, 72, 63, 0.12); }
.otr__camp--org { margin-bottom: 18px; }
.otr__camp--ampli { margin: 18px 0 16px; }

.otr__grup { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.otr__grup legend { padding: 0; margin-bottom: 10px; }
.otr__xips { display: flex; flex-wrap: wrap; gap: 8px; }
.otr__xip { position: relative; cursor: pointer; }
.otr__xip input { position: absolute; opacity: 0; pointer-events: none; }
.otr__xip span {
  display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--otr-linia);
  background: #fff; font-size: 14px; font-weight: 600; color: var(--otr-verd); transition: all .2s ease;
}
.otr__xip:hover span { border-color: var(--otr-blau-fosc); }
.otr__xip input:checked + span { background: var(--otr-verd); border-color: var(--otr-verd); color: #fff; }
.otr__xip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(160, 201, 203, 0.45); }
.otr__grup.is-error .otr__xip span { border-color: #b4483f; }

.otr__acomp { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.otr__acomp-text { font-size: 14px; font-weight: 600; color: var(--otr-verd); }
.otr__comptador { display: inline-flex; align-items: center; border: 1px solid var(--otr-linia); border-radius: 999px; background: #fff; }
.otr__comptador button { width: 38px; height: 38px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--otr-verd); cursor: pointer; border-radius: 50%; }
.otr__comptador button:hover { background: var(--otr-crema); }
.otr__comptador output { min-width: 22px; text-align: center; font-weight: 800; font-size: 15px; }

.otr__grup--arees legend { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--otr-blau-fosc); }
.otr__arees { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.otr__area {
  position: relative; display: block; cursor: pointer;
  padding: 12px 14px 12px 44px; border: 1px solid var(--otr-linia); border-radius: 14px; background: #fff;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.otr__area:hover { border-color: var(--otr-blau-fosc); transform: translateY(-1px); }
.otr__area input { position: absolute; opacity: 0; pointer-events: none; }
.otr__area-marca {
  position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid rgba(39, 56, 55, 0.3); background: #fff; transition: all .2s ease;
}
.otr__area-marca::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .2s ease;
}
.otr__area-nom { display: block; font-size: 14.5px; font-weight: 700; color: var(--otr-verd); line-height: 1.3; }
.otr__area-desc { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--otr-suau); }
.otr__area input:checked ~ .otr__area-marca { background: var(--otr-verd); border-color: var(--otr-verd); }
.otr__area input:checked ~ .otr__area-marca::after { transform: rotate(45deg) scale(1); }
.otr__area:has(input:checked) { border-color: var(--otr-verd); background: #f2f7f6; box-shadow: 0 10px 24px -18px rgba(39, 56, 55, 0.7); }
.otr__area--recursos:has(input:checked) { background: #f8f3ef; }
.otr__area input:focus-visible ~ .otr__area-marca { box-shadow: 0 0 0 4px rgba(160, 201, 203, 0.45); }

.otr__nosaber, .otr__check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; line-height: 1.5; color: var(--otr-verd); }
.otr__nosaber { margin: 2px 0 0; font-weight: 600; }
.otr__nosaber input, .otr__check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--otr-verd); flex-shrink: 0; }
.otr__consentiments { display: grid; gap: 10px; margin-bottom: 18px; }
.otr__check a { color: var(--otr-verd); font-weight: 700; }
.otr__check.is-error span { color: #b4483f; }
.otr__legal { margin: 2px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--otr-suau); }
.otr__parany { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.otr__error { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: #fbeceb; color: #8f2f28; font-size: 14px; font-weight: 600; }
.otr__error[hidden] { display: none !important; }

/* Confirmació */
.otr__vista--fet { text-align: center; padding: 18px 0 6px; }
.otr__fet-icona svg { width: 84px; height: 84px; fill: none; stroke: var(--otr-verd); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.otr__fet-icona circle { stroke: var(--otr-blau); stroke-dasharray: 151; stroke-dashoffset: 151; animation: otr-traça .8s ease forwards; }
.otr__fet-icona path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: otr-traça .5s .55s ease forwards; }
@keyframes otr-traça { to { stroke-dashoffset: 0; } }
.otr__vista--fet .otr__titol { margin-top: 14px; }
.otr__vista--fet .otr__entrada { max-width: 46ch; margin-left: auto; margin-right: auto; }
.otr__accions--fet { justify-content: center; margin: 6px 0 14px; }

/* Pastilla per tornar a obrir la finestra */
.otr-pastilla {
  position: fixed; left: 20px; bottom: 20px; z-index: 9990;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 7px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--otr-verd); color: #fff; font: inherit; font-size: 14px;
  box-shadow: 0 16px 34px -14px rgba(10, 20, 19, 0.7);
  transform: translateY(120%); opacity: 0; transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .5s ease, background .2s ease;
}
.otr-pastilla[hidden] { display: none !important; }
.otr-pastilla.is-visible { transform: none; opacity: 1; }
.otr-pastilla:hover { background: var(--otr-verd-2); }
.otr-pastilla__data { padding: 7px 10px; border-radius: 999px; background: var(--otr-blau); color: var(--otr-verd); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.otr-pastilla__text strong { font-weight: 800; }

/* Mòbil i tauleta */
@media (max-width: 860px) {
  .otr__finestra { grid-template-columns: 300px 1fr; }
  .otr__cos { padding: 26px 28px 28px; }
}
@media (max-width: 720px) {
  .otr { padding: 0; align-items: end; }
  .otr__finestra {
    grid-template-columns: 1fr; grid-template-rows: auto 1fr;
    width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0;
    transform: translateY(40px);
  }
  .otr__visual { min-height: 0; height: 150px; flex-direction: row; align-items: flex-end; padding: 16px 18px; gap: 14px; }
  .otr__data { align-self: auto; min-width: 70px; padding: 8px 10px 7px; border-radius: 14px; }
  .otr__data-dia { font-size: 30px; }
  .otr__data-mes { font-size: 11px; }
  .otr__data-setm { display: none; }
  .otr__visual-peu { padding-bottom: 2px; }
  .otr__visual-etiqueta { margin-bottom: 6px; padding: 4px 8px; font-size: 10px; }
  .otr__visual-titol { font-size: 18px; max-width: none; }
  .otr__tanca { background: rgba(251, 251, 247, 0.92); }
  .otr__cos { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
  .otr__passos { gap: 10px; margin-right: 0; }
  .otr__passos li { font-size: 0; gap: 0; }
  .otr__passos li span { font-size: 11px; }
  .otr__passos li + li::before { content: ''; width: 18px; height: 1.5px; background: var(--otr-linia); margin-right: 10px; }
  .otr__titol { font-size: 26px; }
  .otr__titol--petit { font-size: 22px; }
  .otr__entrada { font-size: 15px; }
  .otr__fitxa > div { grid-template-columns: 1fr; gap: 4px; }
  .otr__graella, .otr__arees { grid-template-columns: 1fr; }
  .otr__accions { gap: 12px; }
  .otr__boto { flex: 1 1 auto; justify-content: center; }
  .otr-pastilla { left: 12px; bottom: 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .otr__fons, .otr__finestra, .otr-pastilla, .otr__area, .otr__boto { transition: none; }
  .otr__vista.is-actiu { animation: none; }
  .otr__fet-icona circle, .otr__fet-icona path { animation: none; stroke-dashoffset: 0; }
}

/* Context: trobada (anunci + inscripció) o xarxa (formulari de col·laboració) */
.otr[data-context="trobada"] .nomes-xarxa,
.otr[data-context="xarxa"] .nomes-trobada { display: none !important; }
.otr:not(.amb-anunci) .nomes-amb-anunci { display: none !important; }
.otr[data-vista="anunci"] .otr__passos,
.otr[data-vista="fet"] .otr__passos { display: none; }
.otr__marca {
  align-self: flex-start; padding: 8px 14px; border-radius: 999px;
  background: rgba(251, 251, 247, 0.94); color: var(--otr-verd);
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45);
}
.otr__assistencia {
  margin: 0 0 20px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(160, 201, 203, 0.22), rgba(160, 201, 203, 0.08));
  border: 1px solid rgba(95, 143, 146, 0.35);
}
.otr__assistencia-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.otr__assistencia-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--otr-verd); flex-shrink: 0; }
.otr__assistencia-text { display: flex; flex-direction: column; gap: 2px; }
.otr__assistencia-text strong { font-size: 15px; color: var(--otr-verd); }
.otr__assistencia-text small { font-size: 13px; color: var(--otr-suau); }
.otr__assistencia .otr__acomp { margin: 12px 0 0 32px; }
.otr__assistencia .otr__acomp[hidden] { display: none !important; }
.otr__grup--arees.is-error .otr__area { border-color: #d9a29d; }
.otr__acomp { flex-wrap: wrap; row-gap: 8px; }
.otr__acomp-text { white-space: nowrap; }
@media (max-width: 720px) {
  .otr__marca { display: none !important; }
  .otr__assistencia .otr__acomp { margin-left: 0; }
}
/* Relació amb Origo: targetes de selecció múltiple */
.otr__grup--vincle legend small { font-weight: 500; color: var(--otr-suau); margin-left: 4px; }
.otr__vincles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.otr__vincle {
  position: relative; display: block; cursor: pointer;
  padding: 10px 12px 10px 42px; border: 1px solid var(--otr-linia); border-radius: 12px; background: #fff;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.otr__vincle:hover { border-color: var(--otr-blau-fosc); }
.otr__vincle input { position: absolute; opacity: 0; pointer-events: none; }
.otr__vincle .otr__area-marca { left: 12px; top: 11px; }
.otr__vincle-nom { display: block; font-size: 14px; font-weight: 700; color: var(--otr-verd); line-height: 1.3; }
.otr__vincle-desc { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--otr-suau); }
.otr__vincle input:checked ~ .otr__area-marca { background: var(--otr-verd); border-color: var(--otr-verd); }
.otr__vincle input:checked ~ .otr__area-marca::after { transform: rotate(45deg) scale(1); }
.otr__vincle:has(input:checked) { border-color: var(--otr-verd); background: #f2f7f6; }
.otr__vincle input:focus-visible ~ .otr__area-marca { box-shadow: 0 0 0 4px rgba(160, 201, 203, 0.45); }
.otr__grup--vincle.is-error .otr__vincle { border-color: #d9a29d; }
@media (max-width: 720px) { .otr__vincles { grid-template-columns: 1fr; } }
/* 09-10-2026: el cos de la finestra ha de poder desplaçar-se (abans el contingut quedava tallat) */
.otr__finestra { grid-template-rows: minmax(0, 1fr); }
.otr__cos { min-height: 0; overscroll-behavior: contain; }
@media (max-width: 720px) {
  .otr__finestra { grid-template-rows: auto minmax(0, 1fr); }
}
.otr__camp--org-graella { grid-column: 1 / -1; }
.otr__camp--org-graella .otr__obligatori[hidden] { display: none; }
