/* ─────────────────────────────────────────────────────────────
   Secondary public pages (privacy, terms, contact, account deletion;
   <body class="pg-page">) in the homepage's "Splash world" look (owner,
   2026-11-17: "redesign privacy and terms and policy, contact and those
   pages to also fit more the site we have"). A night hero with dots, soap
   bubbles and a drifting wave (css/site.css .wave-band); the content as
   white cards on a soft lavender page; the homepage's buttons and fields;
   a wave into the footer. Only restyles the pages' existing classes, so
   their scripts, i18n keys and legal text are untouched.
   ───────────────────────────────────────────────────────────── */
body.pg-page {
  background: var(--site-soft); color: var(--site-ink);
  font: 400 17px/1.6 'Nunito', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  --pg-acc: #5B2BC4; --pg-tint: #ECE6FB;
}
.pg-page h1, .pg-page h2, .pg-page h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }

/* ─── Hero: night sky, dots, bubbles, wave ───────────────────── */
.pg-page .legal-hero {
  position: relative; max-width: none; margin: 0; overflow: hidden; text-align: center;
  padding: 132px 24px 200px; background: var(--site-night); color: #fff;
}
.pg-page .legal-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(rgba(255, 255, 255, .08) 1.5px, transparent 1.6px) 0 0 / 28px 28px;
}
.pg-page .legal-hero > :not(.pg-bubbles):not(.pg-wave) { position: relative; z-index: 1; }
.pg-page .legal-hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; font-weight: 600; margin: 14px 0 14px; color: #fff; }
.pg-page .legal-date { font-size: 17px; line-height: 26px; color: #D9D5F2; font-weight: 600; margin: 0; text-wrap: balance; }
.pg-page .legal-hero h1 { text-wrap: balance; }
/* back link: a quiet pill on the night sky */
.pg-page .back-link {
  gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; font-size: 15px; font-weight: 700;
  color: #fff; background: rgba(255, 255, 255, .1); transition: background .25s var(--site-ease);
}
.pg-page .back-link:hover { color: #fff; background: rgba(255, 255, 255, .18); }
/* the arrow is drawn here: i18n replaces the link's contents (its inline svg included) with the label */
.pg-page .back-link svg { display: none; }
.pg-page .back-link::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor; transition: transform .25s var(--site-ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pg-page .back-link:hover::before { transform: translateX(-3px); }

/* soap bubbles in the margins beside the title (never across it): a ring + a highlight, a steady rise */
.pg-bubbles { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.pg-bubbles i {
  position: absolute; bottom: 112px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle closest-side at 34% 32%, #fff 0 15%, rgba(255, 255, 255, 0) 32%),
    radial-gradient(circle closest-side, rgba(255, 255, 255, .08) 0 60%, rgba(255, 255, 255, .6) 86%, rgba(255, 255, 255, .9) 94%, transparent 100%);
  animation: pg-rise 16s linear infinite, hp-sway-x 16s ease-in-out infinite alternate;
}
.pg-bubbles i:nth-child(1) { left: 8%; width: 30px; animation-delay: -3s; }
.pg-bubbles i:nth-child(2) { left: 16%; width: 20px; animation-duration: 21s; animation-delay: -11s; }
.pg-bubbles i:nth-child(3) { right: 15%; width: 36px; animation-duration: 19s; animation-delay: -7s; }
.pg-bubbles i:nth-child(4) { right: 7%; width: 22px; animation-duration: 14s; animation-delay: -2s; }
/* the rise is keyed only at its ends (a steady speed); it fades in and out so no restart is seen */
@keyframes pg-rise { 0% { opacity: 0; transform: translateY(0); } 12% { opacity: 1; } 62% { opacity: 1; } 78%, 100% { opacity: 0; transform: translateY(-260px); } }
@keyframes hp-sway-x { from { translate: 0 0; } to { translate: 14px 0; } }

.pg-wave { position: relative; height: 96px; overflow: hidden; }
.pg-wave .wave-band { height: 97px; -webkit-mask-size: 720px 97px; mask-size: 720px 97px; }
.legal-hero .pg-wave { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; color: var(--site-soft); }
.pg-wave-foot { color: var(--site-night); margin-bottom: -1px; }
.pg-wave-foot .wave-band { animation-duration: 22s; animation-direction: reverse; }

/* ─── Body: white cards on lavender ─────────────────────────── */
/* the first card starts in the navy, above the wave, so the wave never ends on a card corner */
.pg-page .legal-body { position: relative; z-index: 2; max-width: 800px; margin: -128px auto 0; padding: 0 24px 72px; }
.pg-page .legal-intro,
.pg-page .legal-section,
.pg-page .glass-card {
  background: #fff; border: 0; border-radius: 28px; color: var(--site-ink);
  backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 24px 48px -36px rgba(26, 20, 66, .55);
}
.pg-page .glass-card:hover { background: #fff; transform: none; }
.pg-page .legal-intro { gap: 14px; margin-bottom: 24px; padding: 36px 40px; background: linear-gradient(160deg, #fff 40%, var(--pg-tint)); }
.pg-page .legal-intro p { font-size: 18px; line-height: 30px; color: var(--site-ink); margin: 0; }

/* numbered sections: a soft number tile beside each heading */
.pg-page #privacy-sections, .pg-page #terms-sections, .pg-page .legal-body { counter-reset: pg-sec; }
.pg-page .legal-section { margin-bottom: 20px; padding: 32px 40px; counter-increment: pg-sec; }
.pg-page .legal-section h2 { font-size: 26px; line-height: 32px; color: var(--site-ink); gap: 14px; margin: 0 0 14px; font-weight: 600; }
.pg-page .legal-section h2::before {
  content: counter(pg-sec); width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--pg-tint); color: var(--pg-acc); font: 700 18px/1 var(--font-display);
}
.pg-page .legal-section p, .pg-page .legal-section ul li { font-size: 17px; line-height: 28px; color: var(--site-ink-2); }
.pg-page .legal-section p { margin: 0 0 12px; }
/* long URLs in the legal text wrap instead of widening a phone screen */
.pg-page .legal-section, .pg-page .legal-intro, .pg-page .deletion-notice, .pg-page .adid-platform { overflow-wrap: anywhere; }
.pg-page .legal-section p:last-child { margin-bottom: 0; }
.pg-page .legal-section ul { gap: 6px; margin: 4px 0 14px; padding-left: 4px; }
.pg-page .legal-section ul li { padding-left: 24px; }
.pg-page .legal-section ul li::before { top: 10px; width: 9px; height: 9px; background: var(--pg-acc); opacity: .55; }
.pg-page .legal-section a:not(.legal-contact) { color: var(--pg-acc); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pg-page .legal-contact {
  min-height: 48px; padding: 0 22px; margin-top: 10px; border: 0; border-radius: 999px; font-size: 16px; font-weight: 800;
  background: var(--site-sun); color: var(--site-ink); box-shadow: 0 5px 0 #FFB000; transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s var(--site-ease);
}
.pg-page .legal-contact:hover { background: var(--site-sun); transform: translateY(-2px); box-shadow: 0 7px 0 #FFB000; }

/* ─── Forms (contact, account deletion) ─────────────────────── */
.pg-page .contact-card { max-width: 680px; margin: 0 auto 24px; padding: 44px 48px 48px; }
.pg-page .contact-form { gap: 22px; }
.pg-page .form-group { gap: 8px; }
.pg-page .form-group label { font-size: 16px; font-weight: 800; color: var(--site-ink); }
.pg-page .contact-form input,
.pg-page .contact-form select,
.pg-page .contact-form textarea {
  min-height: 52px; padding: 13px 18px; border-radius: 16px; font-size: 16px; font-weight: 600; color: var(--site-ink);
  background: var(--site-soft); border: 2px solid var(--site-line); transition: border-color .2s var(--site-ease), box-shadow .2s var(--site-ease), background .2s var(--site-ease);
}
.pg-page .contact-form input::placeholder, .pg-page .contact-form textarea::placeholder { color: #67628A; } /* 5:1 on the field fill */
.pg-page .contact-form input:focus,
.pg-page .contact-form select:focus,
.pg-page .contact-form textarea:focus { background: #fff; border-color: var(--pg-acc); box-shadow: 0 0 0 4px rgba(91, 43, 196, .16); }
.pg-page .contact-form input.input-error,
.pg-page .contact-form select.input-error,
.pg-page .contact-form textarea.input-error { border-color: #D93636; box-shadow: 0 0 0 4px rgba(217, 54, 54, .14); }
.pg-page .contact-form select { padding-right: 44px; }
.pg-page .select-wrapper::after { right: 18px; border-top-color: var(--site-ink-2); }
.pg-page .contact-form textarea { min-height: 170px; }
.pg-page .form-hint { color: var(--site-ink-2); margin: 0; line-height: 22px; }
.pg-page .field-error { font-size: 14px; color: #C42B2B; font-weight: 700; margin-top: 0; }
.pg-page .form-required-note { font-size: 15px; color: var(--site-ink-2); border-bottom-color: var(--site-line); margin: 0; }
.pg-page .form-submit { margin-top: 6px; }
/* the submit is the homepage's sun button */
.pg-page .form-submit .btn {
  min-height: 56px; padding: 0 34px; border-radius: 999px; font: 800 17px 'Nunito', sans-serif; gap: 10px;
  background: var(--site-sun); color: var(--site-ink); text-shadow: none; filter: none;
  box-shadow: 0 6px 0 #FFB000; transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s var(--site-ease);
}
.pg-page .form-submit .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #FFB000; filter: none; }
.pg-page .form-submit .btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #FFB000; }
.pg-page .form-message {
  display: flex; align-items: center; gap: 12px; border-radius: 16px; font-size: 16px; line-height: 24px; padding: 14px 18px;
  scroll-margin-top: 96px; /* the form scrolls it into view; it must not land under the fixed header */
}
/* an icon per state (the script sets textContent, which keeps a pseudo-element) */
.pg-page .form-message::before {
  content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%; background: currentColor center / 16px no-repeat;
}
.pg-page .form-message--success { background: #E3F7EE; border: 0; color: #116B43; }
.pg-page .form-message--success::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E"); }
.pg-page .form-message--error { background: #FDE8E8; border: 0; color: #A82323; }
.pg-page .form-message--error::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17.5v.01'/%3E%3C/svg%3E"); }

/* account deletion: the ad-ID help and the notice */
.pg-page .adid-help { background: var(--site-soft); border: 0; border-radius: 16px; }
.pg-page .adid-help summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; font-size: 15px; color: var(--pg-acc); list-style: none; }
.pg-page .adid-help summary::-webkit-details-marker { display: none; }
/* the open/close cue (critic: the bar gave no sign that it opens); drawn here because data-i18n replaces the summary's contents */
.pg-page .adid-help summary::after {
  content: ""; flex: none; width: 12px; height: 12px; margin-right: 4px; border: solid currentColor; border-width: 0 3px 3px 0; border-radius: 1px;
  transform: translateY(-3px) rotate(45deg); transition: transform .25s var(--site-ease);
}
.pg-page .adid-help[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.pg-page .adid-help[open] summary { border-bottom-color: var(--site-line); }
.pg-page .adid-platform + .adid-platform { border-top-color: var(--site-line); }
.pg-page .adid-platform h3 { font-size: 18px; color: var(--site-ink); }
.pg-page .adid-platform li, .pg-page .adid-platform p { font-size: 15px; color: var(--site-ink-2); }
.pg-page .adid-platform strong { color: var(--site-ink); }
.pg-page .adid-link { font-size: 15px; color: var(--pg-acc); display: inline-flex; align-items: center; min-height: 44px; }
.pg-page .deletion-notice { padding: 20px 22px; border-radius: 18px; background: #FFF7E0; }
.pg-page .deletion-notice p { font-size: 15px; line-height: 24px; color: var(--site-ink); margin: 0; }
.pg-page .deletion-notice a { color: var(--pg-acc); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .pg-page .back-link, .pg-page .back-link::before, .pg-page .adid-help summary::after, .pg-page .legal-contact, .pg-page .form-submit .btn, .pg-page .contact-form input,
  .pg-page .contact-form select, .pg-page .contact-form textarea { transition: none; }
}

/* ─── Phones ────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .pg-bubbles i:nth-child(2), .pg-bubbles i:nth-child(3) { display: none; }
  .pg-bubbles i:nth-child(1) { left: 12px; }
  .pg-bubbles i:nth-child(4) { right: 20px; }
}
@media (max-width: 640px) {
  body.pg-page { font-size: 16px; }
  .pg-page .legal-hero { padding: 112px 16px 150px; }
  .pg-page .legal-body { padding: 0 16px 56px; margin-top: -86px; }
  .pg-page .legal-intro, .pg-page .legal-section { padding: 26px 22px; border-radius: 24px; }
  .pg-page .legal-intro p { font-size: 17px; line-height: 28px; }
  .pg-page .legal-section h2 { font-size: 22px; line-height: 28px; gap: 12px; }
  .pg-page .legal-section h2::before { width: 36px; height: 36px; font-size: 16px; }
  .pg-page .legal-section p, .pg-page .legal-section ul li { font-size: 16px; line-height: 26px; }
  .pg-page .contact-card { padding: 28px 20px 32px; border-radius: 24px; }
  .pg-page .form-submit .btn { width: 100%; max-width: 100%; justify-content: center; }
  .pg-wave { height: 64px; }
  .pg-wave .wave-band { height: 65px; width: calc(100% + 480px); -webkit-mask-size: 480px 65px; mask-size: 480px 65px; animation-name: wave-drift-sm; }
  .pg-bubbles { display: none; } /* no room beside a phone-width title (they brushed "Account Deletion") */
}
@keyframes wave-drift-sm { to { transform: translateX(-480px); } }

/* ─── "On this page" (js/legal-toc.js; BUG-05: navigation between sections) ── */
.pg-page .legal-section { scroll-margin-top: 92px; }
.pg-page .legal-toc { background: #fff; border-radius: 24px; padding: 22px 22px 18px; box-shadow: 0 24px 48px -36px rgba(26, 20, 66, .55); margin-bottom: 20px; }
.pg-page .legal-toc-h { font: 600 18px/24px var(--font-display); color: var(--site-ink); margin: 0 0 10px; padding-left: 10px; }
.pg-page .legal-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pg-page .legal-toc a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: 14px;
  font-size: 15px; line-height: 20px; font-weight: 700; color: var(--site-ink-2); transition: background .2s var(--site-ease), color .2s var(--site-ease);
}
.pg-page .legal-toc a:hover { background: var(--site-soft); color: var(--site-ink); }
.pg-page .legal-toc a[aria-current="true"] { background: var(--pg-tint); color: var(--pg-acc); }
.pg-page .legal-toc-n { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--site-soft); color: var(--pg-acc); font: 700 14px/1 var(--font-display); }
.pg-page .legal-toc a[aria-current="true"] .legal-toc-n { background: #fff; }
/* wide screens: the list sits beside the text and stays in view while reading */
@media (min-width: 1120px) {
  .pg-page .legal-body.has-toc { max-width: 1124px; display: grid; grid-template-columns: 284px minmax(0, 800px); column-gap: 40px; align-items: start; }
  .pg-page .legal-body.has-toc > .legal-toc { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 92px; margin: 0; max-height: calc(100vh - 116px); overflow-y: auto; }
  .pg-page .legal-body.has-toc > :not(.legal-toc) { grid-column: 2; }
}
/* narrower: a card above the sections, two columns of links when there is room */
@media (min-width: 641px) and (max-width: 1119px) { .pg-page .legal-toc ol { grid-template-columns: 1fr 1fr; column-gap: 8px; } }
@media (max-width: 1119px) { .pg-page .legal-body.has-toc > .legal-toc { order: 0; } .pg-page .legal-body.has-toc { display: flex; flex-direction: column; } .pg-page .legal-body.has-toc > .legal-intro { order: -1; } }

/* ─── Field hover and keyboard focus (BUG-05: hover, focus, keyboard navigation, contrast) ── */
/* hover never hides an error's red border */
.pg-page .contact-form input:hover:not(:focus):not(.input-error),
.pg-page .contact-form select:hover:not(:focus):not(.input-error),
.pg-page .contact-form textarea:hover:not(:focus):not(.input-error) { border-color: #C9C1EA; background: #fff; }
.pg-page a:focus-visible, .pg-page button:focus-visible, .pg-page summary:focus-visible,
.pg-page .nav a:focus-visible, .pg-page .footer a:focus-visible {
  outline: 3px solid var(--pg-acc); outline-offset: 3px; border-radius: 12px;
}
/* on the navy hero and footer the ring is the yellow sun (11:1 on navy); the violet one is for white */
.pg-page .legal-hero a:focus-visible, .pg-page .footer a:focus-visible, .pg-page .legal-hero a.back-link:focus-visible { outline: 3px solid var(--site-sun); outline-offset: 3px; }
.pg-page .form-submit .btn:focus-visible { outline: 3px solid var(--site-ink); outline-offset: 4px; }
/* last on purpose: the small-screen rules above set animation-name and would otherwise beat the earlier reduced-motion rule */
@media (prefers-reduced-motion: reduce) {
  .wave-band, .pg-wave .wave-band { animation-duration: 48s; }
}
