/* =====================================================================
   page.css — static page family: about, help center, legal (privacy, cookie,
   terms, DSA) and the error pages. Loaded by Pages::cssFor() for every template
   that has no family stylesheet of its own.

   Ported from the old static-pages.css + the Bootstrap cards/grid it relied on:
   green gradient hero, rounded white cards, colour-tinted icons, CTA box.
   Prefix: .pg-*
   ===================================================================== */

/* ===== Flat reading pages (.pg-flat: legal, about, help) + legal page index ===== */
.pg-legal-grid { max-width: 1140px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 1100px) {
  .pg-legal-grid { grid-template-columns: 250px minmax(0, 780px); gap: 3.25rem; justify-content: center; }
  .pg-toc-box { position: sticky; top: calc(var(--rx-header-h) + 1.5rem); }
}
.pg-legal-body { min-width: 0; }
.pg-toc-box { border: 1px solid var(--rx-line); border-radius: var(--rx-radius-sm); background: #fff; padding: .35rem .35rem .5rem; }
.pg-toc-box summary {
  display: flex; align-items: center; gap: .45rem; cursor: pointer; list-style: none;
  padding: .6rem .7rem; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rx-muted);
}
.pg-toc-box summary::-webkit-details-marker { display: none; }
.pg-toc-box ol { list-style: none; margin: 0; padding: 0 .2rem; counter-reset: toc; }
.pg-toc-box li { counter-increment: toc; }
.pg-toc-box a {
  display: flex; gap: .55rem; padding: .45rem .55rem; border-radius: 10px;
  font-size: .88rem; line-height: 1.35; color: var(--rx-ink-soft); text-decoration: none;
}
.pg-toc-box a::before { content: counter(toc, decimal-leading-zero); font-size: .72rem; font-weight: 700; color: var(--rx-brand); padding-top: .12rem; }
.pg-toc-box a:hover { background: var(--rx-cream); color: var(--rx-ink); }
@media (max-width: 1099.98px) {
  .pg-toc-box:not([open]) { padding-bottom: .35rem; }
}
/* reading column: section titles start on the left, lighter cards, anchors land below the header */
.pg-flat .pg-h2 { scroll-margin-top: calc(var(--rx-header-h) + 1.25rem); }
.pg-flat .pg-h2--center { justify-content: flex-start; text-align: left; }
.pg-flat .pg-section.pg-cta, .pg-flat .pg-cta .pg-h2 { text-align: left; justify-content: flex-start; }
.pg-flat .pg-cta p { margin-left: 0; }
.pg-flat .pg-btn-row { justify-content: flex-start; }
/* Flat reading (owner, 2026-10-14): no boxed sections. Sections are separated by space and a
   hairline, text sits on the page; small grids become plain items with a thin coloured line;
   callouts a light band; accordions plain rows with dividers. */
.pg-flat .pg-section { margin: 0; padding: clamp(1.75rem, 4vw, 2.5rem) 0; border-top: 1px solid var(--rx-line-strong); }
.pg-flat :is(.pg-legal-body, .pg-flat-body) > .pg-section:first-child { border-top: 0; padding-top: 0; }
.pg-flat .pg-card,
.pg-flat .pg-card--lg { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.pg-flat .pg-section.pg-card:not(.pg-card--soft) { padding: clamp(1.75rem, 4vw, 2.5rem) 0; border-top: 1px solid var(--rx-line-strong); }   /* a section that was a card keeps the section rhythm */
.pg-flat :is(.pg-legal-body, .pg-flat-body) > .pg-section.pg-card:first-child { border-top: 0; padding-top: 0; }
.pg-flat .pg-card--soft { background: var(--rx-cream); border-radius: var(--rx-radius-sm); padding: 1.1rem 1.25rem; }
.pg-flat .pg-section.pg-card--soft { border-top: 0; padding: clamp(1.25rem, 3vw, 1.75rem); margin: 1rem 0; }
.pg-flat .pg-grid .pg-card { padding: .15rem 0 .15rem 1.1rem; border-left: 2px solid var(--pg-accent, var(--rx-brand)); }
.pg-flat .pg-card--accent { border-top: 0; }
.pg-flat .pg-grid { gap: 1.5rem 2rem; }
.pg-flat .pg-sub { text-align: left; margin-left: 0; }
.pg-flat .pg-callout { border: 0; border-left: 3px solid var(--rx-teal); border-radius: 0 var(--rx-radius-sm) var(--rx-radius-sm) 0; background: #f1f8f8; }
.pg-flat .pg-section.pg-callout { margin: 1rem 0; padding: 1.1rem 1.3rem; border-top: 0; }
.pg-flat .pg-callout--danger { border-left-color: #c2410c; background: #fdf3f1; }
.pg-flat .pg-acc-group { gap: 0; border-top: 1px solid var(--rx-line-strong); }
.pg-flat .pg-acc { border: 0; border-bottom: 1px solid var(--rx-line-strong); border-radius: 0; box-shadow: none; background: none; }
.pg-flat .pg-acc[open] { box-shadow: none; }
.pg-flat .pg-acc summary { padding: 1rem .25rem; }
.pg-flat .pg-acc summary:hover { background: none; color: var(--rx-brand-dark); }
.pg-flat .pg-acc[open] summary { background: none; color: var(--rx-brand-dark); }
.pg-flat .pg-acc-body { border-top: 0; padding: 0 .25rem 1.2rem 2rem; }
.pg-flat .pg-section.pg-cta { padding-top: clamp(1.75rem, 4vw, 2.5rem); }
.pg-flat .pg-acc-group .pg-acc:last-child { border-bottom: 0; }   /* the next section's hairline closes the list */
.pg-flat .pg-feature { text-align: left; }
.pg-flat .pg-feature .i { font-size: 1.9rem; }

/* about / help: one reading column, no index */
.pg-flat .pg-section .pg-section { border-top: 0; padding: 1.25rem 0; }   /* a grid nested in a section is not a new section */
.pg-flat .pg-grid .pg-contact { border-left: 0; padding-left: 0; }   /* contact tiles already have their icon badge */
.pg-flat-body { max-width: 880px; }
.pg-flat .pg-grid .pg-card { background: none; border-radius: 0; }
.pg-flat .pg-vision { background: none; color: var(--rx-ink-soft); box-shadow: none; border-radius: 0; padding-left: 0; padding-right: 0; font-size: 1.08rem; line-height: 1.8; }
.pg-flat .pg-vision .pg-h2 { color: var(--rx-ink); }
.pg-flat .pg-vision .pg-sub { color: var(--rx-muted); }
.pg-flat .pg-vision .pg-sub + p { font-family: var(--rx-font-head); font-size: clamp(1.25rem, 2.4vw, 1.5rem); line-height: 1.5; color: var(--rx-ink); }
.pg-flat .pg-contact .pg-contact-icon { width: 40px; height: 40px; border-radius: 12px; }
.pg-flat a.pg-contact:hover, .pg-flat a.pg-contact:focus-visible { transform: none; box-shadow: none; color: inherit; }
.pg-flat a.pg-contact:hover .pg-contact-value { color: var(--rx-brand-dark); text-decoration: underline; }
.pg-flat .pg-quote { border-radius: 0 var(--rx-radius-sm) var(--rx-radius-sm) 0; }

/* ===== Body & containers ===== */
.pg-body { padding-top: clamp(2rem, 5vw, 3.25rem); }
.pg-body .container { max-width: 1140px; }
.pg-body .pg-narrow { max-width: 920px; }
.pg-legal { font-size: 1rem; line-height: 1.7; color: var(--rx-ink-soft); }

.pg-updated {
  display: flex; align-items: center; gap: .45rem;
  font-size: .9rem; color: var(--rx-muted); margin: 0 0 1.75rem;
}

.pg-section { margin: 0 0 clamp(2rem, 4.5vw, 3rem); }
.pg-h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  display: flex; align-items: center; gap: .55rem;
  margin: 0 0 1rem;
}
.pg-h2--center { justify-content: center; text-align: center; }
.pg-h3 { font-size: 1.15rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.pg-sub { text-align: center; color: var(--rx-muted); margin: -.35rem auto 1.75rem; max-width: 60ch; }
.pg-intro { font-size: clamp(1.05rem, 1.9vw, 1.2rem); line-height: 1.65; color: var(--rx-ink-soft); }
.pg-strong { font-weight: 600; color: var(--rx-ink); }

/* Icon tints (the old text-primary / -success / -info / -warning / -danger) */
.t-brand  { color: var(--rx-brand); }
.t-teal   { color: var(--rx-teal); }
.t-gold   { color: var(--rx-gold); }
.t-danger { color: #c2410c; }
.t-muted  { color: var(--rx-muted); }

/* ===== Cards ===== */
.pg-card {
  background: #fff;
  border: 1px solid var(--rx-line);
  border-radius: 20px;
  box-shadow: var(--rx-shadow-sm);
  padding: clamp(1.15rem, 3vw, 1.75rem);
}
.pg-card > :last-child, .pg-card-body > :last-child { margin-bottom: 0; }
.pg-card ul, .pg-callout ul { padding-left: 1.25rem; margin: 0 0 1em; }
.pg-card li + li, .pg-callout li + li { margin-top: .35rem; }
.pg-card--soft { background: var(--rx-cream); border-color: transparent; box-shadow: none; }
.pg-card--lg { padding: clamp(1.35rem, 4vw, 2.5rem); }
.pg-card--accent { border-top: 4px solid var(--pg-accent, var(--rx-brand)); }
.pg-card-icon { font-size: 2rem; line-height: 1; margin-bottom: .6rem; color: var(--pg-accent, var(--rx-brand)); }
.pg-card .pg-h3 { font-size: 1.1rem; }
.pg-small { font-size: .93rem; line-height: 1.6; color: var(--rx-ink-soft); }

/* Grids (replace Bootstrap row/col) */
.pg-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .pg-grid--2, .pg-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  .pg-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-grid--3x { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 720px) and (max-width: 991.98px) {
  .pg-grid--3x { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== About ===== */
.pg-vision {
  background: linear-gradient(135deg, #2f8c62 0%, #72a24b 100%);
  color: #fff;
  border-radius: 24px;
  box-shadow: var(--rx-shadow-md);
  padding: clamp(1.5rem, 5vw, 3rem);
  font-size: 1.02rem; line-height: 1.75;
}
.pg-vision .pg-h2 { color: #fff; }
.pg-vision .pg-sub { color: rgba(255, 255, 255, .78); }
.pg-vision p:last-child { margin-bottom: 0; }

.pg-checks { list-style: none; padding: 0; margin: 0; }
.pg-checks li { display: flex; align-items: flex-start; gap: .65rem; }
.pg-checks li + li { margin-top: .9rem; }
.pg-checks .i { flex-shrink: 0; margin-top: .25rem; color: var(--rx-brand); font-size: 1.1rem; }
.pg-checks.pg-grid li + li { margin-top: 0; }

.pg-quote {
  margin: 1.75rem 0 0;
  background: var(--rx-cream);
  border-left: 4px solid var(--rx-accent);
  border-radius: 0 18px 18px 0;
  padding: 1.25rem 1.5rem;
  font-style: italic; color: var(--rx-ink-soft);
}
.pg-quote p { margin: 0; }

.pg-feature { text-align: center; }
.pg-feature .i { font-size: 2.5rem; }
.pg-feature h3 { font-size: 1.05rem; margin: .65rem 0 .35rem; }
.pg-feature p { margin: 0; font-size: .93rem; color: var(--rx-muted); }

/* ===== Help center ===== */
.pg-contact {
  display: flex; align-items: flex-start; gap: .9rem;
  text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
a.pg-contact:hover, a.pg-contact:focus-visible { transform: translateY(-2px); box-shadow: var(--rx-shadow-md); border-color: rgba(47, 140, 98, .35); color: inherit; }
.pg-contact-icon {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(47, 140, 98, .1); color: var(--rx-brand); font-size: 1.3rem;
}
.pg-contact-icon--wa { background: rgba(37, 211, 102, .14); color: #128C4A; }
.pg-contact-label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rx-muted); }
.pg-contact-value { display: block; font-weight: 700; color: var(--rx-ink); word-break: break-word; }
.pg-contact-note { display: block; font-size: .88rem; color: var(--rx-muted); margin-top: .15rem; }

.pg-address { margin: 1.25rem 0 0; }
.pg-links { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.pg-links a { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }

/* ===== Legal: callouts, table, accordion, CTA ===== */
.pg-callout {
  border-radius: var(--rx-radius-sm);
  padding: 1rem 1.2rem;
  margin: 0 0 1.25rem;
  border: 1px solid #bfe0e4; background: #eef7f8; color: #164e57;
}
.pg-callout > :last-child { margin-bottom: 0; }
.pg-callout .i { margin-right: .3rem; }
.pg-section.pg-callout { margin-bottom: clamp(2rem, 4.5vw, 3rem); padding: clamp(1.1rem, 3vw, 1.5rem); }
.pg-callout--danger { border-color: #f3c3be; background: #fdf0ef; color: #7a1d14; }
.pg-callout--danger .pg-h2 { color: #7a1d14; font-size: 1.25rem; }

.pg-dl { list-style: none; padding: 0; margin: 0; }
.pg-dl li + li { margin-top: .25rem; }

.pg-table { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.5; margin: 0 0 1rem; }
.pg-table th, .pg-table td { text-align: left; vertical-align: top; padding: .7rem .75rem; border-bottom: 1px solid var(--rx-line-strong); }
.pg-table thead th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--rx-muted); border-bottom-width: 2px; }
.pg-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--rx-cream-warm); padding: .1rem .35rem; border-radius: 6px; color: var(--rx-ink); white-space: nowrap; }
.pg-tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: var(--rx-pill); background: rgba(47, 140, 98, .12); color: var(--rx-brand-dark); white-space: nowrap; }
.pg-tag--stats { background: rgba(45, 149, 163, .14); color: #165963; }
@media (max-width: 719.98px) {
  .pg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .pg-table, .pg-table tbody, .pg-table tr, .pg-table td { display: block; width: 100%; }
  .pg-table tr { border: 1px solid var(--rx-line-strong); border-radius: 14px; padding: .4rem .2rem; margin-bottom: .85rem; }
  .pg-table td { border: 0; padding: .35rem .75rem; }
  .pg-table td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rx-muted); }
}

/* Accordion: native <details>; name="" makes it exclusive in browsers that support it */
.pg-acc-group { display: flex; flex-direction: column; gap: .65rem; }
.pg-acc {
  border: 1px solid rgba(45, 140, 98, .22); border-radius: 14px; overflow: hidden;
  background: #fff; box-shadow: 0 2px 12px rgba(26, 48, 64, .06);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.pg-acc[open] { border-color: rgba(45, 149, 163, .35); box-shadow: 0 4px 18px rgba(45, 149, 163, .12); }
.pg-acc summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.15rem; color: #1a3030;
  transition: background .2s ease;
}
.pg-acc summary::-webkit-details-marker { display: none; }
.pg-acc summary:hover { background: rgba(45, 149, 163, .08); }
.pg-acc summary:focus-visible { outline: 3px solid var(--rx-accent); outline-offset: -3px; }
.pg-acc[open] summary { background: linear-gradient(135deg, rgba(45, 149, 163, .14) 0%, rgba(47, 140, 98, .08) 100%); color: #0d4f5c; }
.pg-acc summary > .i:first-child { color: var(--rx-teal); font-size: 1.15em; }
.pg-acc-title { margin: 0; font-family: var(--rx-font-body); font-size: .98rem; font-weight: 600; letter-spacing: 0; line-height: 1.35; color: inherit; flex: 1; }
.pg-acc-chev { margin-left: auto; opacity: .65; transition: transform .22s ease; }
.pg-acc[open] .pg-acc-chev { transform: rotate(-180deg); }
.pg-acc-body { padding: 1.1rem 1.2rem 1.25rem; border-top: 1px solid rgba(45, 140, 98, .12); font-size: .96rem; line-height: 1.62; color: #3d4f52; }
.pg-acc-body > :last-child { margin-bottom: 0; }

.pg-ext { list-style: none; padding: 0; margin: 0; }
.pg-ext li { display: flex; align-items: flex-start; gap: .5rem; }
.pg-ext li + li { margin-top: .5rem; }
.pg-ext .i { flex-shrink: 0; margin-top: .3rem; color: var(--rx-brand); }

.pg-cta { text-align: center; padding: clamp(1.25rem, 4vw, 2.25rem) 0 0; }
.pg-cta .pg-h2 { justify-content: center; font-size: clamp(1.25rem, 2.4vw, 1.5rem); }
.pg-cta p { max-width: 60ch; margin: 0 auto 1.25rem; }
.pg-btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem 1rem; }

@media (max-width: 575.98px) {
  .pg-btn-row .rx-btn { width: 100%; }
}

/* ===== Error pages (404 / 500) ===== */
.page-error { padding: clamp(3rem, 8vw, 6rem) 0; background: var(--rx-cream); border-bottom: 1px solid var(--rx-line); }
.page-error-code { font-family: var(--rx-font-head); font-size: clamp(4rem, 12vw, 7rem); line-height: 1; color: var(--rx-brand); margin: 0 0 .5rem; opacity: .25; }

/* ===== Payment page (pages/payment.php): bank details, "Copia" next to the IBAN ===== */
.pay-card { max-width: 680px; }
.pay-list { margin: 0; }
.pay-row {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); align-items: center; gap: .25rem 1rem;
  padding: .85rem 0; border-bottom: 1px solid var(--rx-line);
}
.pay-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pay-row dt { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rx-muted); }
.pay-row dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.pay-value { font-weight: 600; color: var(--rx-ink); }
.pay-value--code { font-variant-numeric: tabular-nums; letter-spacing: .03em; word-break: break-word; }
.pay-copy {
  padding: .3rem .95rem; border: 1.5px solid var(--rx-brand); border-radius: var(--rx-pill);
  background: transparent; color: var(--rx-brand); font: 600 .82rem/1.3 var(--rx-font-body); cursor: pointer;
  transition: background .2s, color .2s;
}
.pay-copy:hover, .pay-copy:focus-visible, .pay-copy.is-copied { background: var(--rx-brand); color: #fff; }
.pay-copy:focus-visible { outline: 3px solid color-mix(in srgb, var(--rx-brand) 35%, transparent); outline-offset: 2px; }
@media (max-width: 540px) { .pay-row { grid-template-columns: 1fr; } }
