/* ==========================================================================
   PrivacyPolicies — Global Design System
   Shared, token-driven foundation for every app site (support + privacy).
   Each app sets its own brand tokens + fonts in an inline :root block;
   every component here references tokens only, so nothing is duplicated.
   ========================================================================== */

/* ----- Reset --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ----- Default token scale (brand tokens overridden per app) --------------- */
:root {
  /* Fallback brand (neutral) — each site overrides these */
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --accent: #059669;
  --on-brand: #ffffff;

  /* Surfaces (light defaults) */
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef1f5;
  --text: #14181f;
  --text-muted: #586174;
  --border: #e3e7ee;
  --on-accent: #ffffff;

  /* Typography */
  --font-display: var(--font-body);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lead: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --text-h3: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
  --text-h2: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  --text-h1: clamp(2.4rem, 1.4rem + 4.4vw, 4.4rem);
  --text-eyebrow: 0.78rem;

  /* Spacing rhythm (4/8 system) */
  --space-section: clamp(3.5rem, 2.5rem + 4vw, 7rem);
  --gutter: clamp(1.25rem, 0.5rem + 3vw, 2.5rem);
  --container: 72rem;
  --container-narrow: 50rem;

  /* Radius / depth */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
  --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, 0.35);

  /* Motion */
  --dur-fast: 150ms;
  --dur: 240ms;
  --dur-slow: 420ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --header-h: 64px;
}

/* ----- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus-visible { top: 12px; }

/* ----- Focus visibility ---------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----- Layout helpers ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-section); }
.section--alt { background: var(--surface); }

.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.75rem;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; font-weight: 700; }
.section-title { font-size: var(--text-h2); letter-spacing: -0.02em; }
.section-lead { font-size: var(--text-lead); color: var(--text-muted); margin-top: 1rem; }

.stack > * + * { margin-top: 1rem; }

/* ----- Header / Navigation ------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav__brand .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  flex-shrink: 0;
}
.nav__brand .brand-mark svg { width: 20px; height: 20px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav__link {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link.is-active { color: var(--brand); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.nav__actions { display: flex; align-items: center; gap: 0.6rem; }

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}
.nav__toggle:hover { background: var(--surface-2); }
.nav__toggle svg { width: 24px; height: 24px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 820px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav__link { padding: 0.85rem 1rem; font-size: 1.05rem; }
  .nav__link.is-active::after { display: none; }
  .nav__link.is-active { background: var(--surface-2); }
}

/* ----- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.97rem;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
  border: 2px solid transparent;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn:active { transform: translateY(1px) scale(0.98); }

.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-2); box-shadow: var(--shadow); transform: translateY(-2px); }

.btn--accent { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn--accent:hover { box-shadow: var(--shadow); transform: translateY(-2px); filter: brightness(0.97); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

.btn--lg { padding: 1rem 1.8rem; font-size: 1.05rem; }
.btn--block { width: 100%; }

/* ----- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.5rem);
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  box-shadow: var(--shadow);
}
.feature-card .icon-badge { margin-bottom: 1rem; }
.feature-card h3 { font-size: var(--text-h3); margin-bottom: 0.4rem; }
.feature-card p { color: var(--text-muted); font-size: 0.97rem; }

.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}
.icon-badge svg { width: 24px; height: 24px; }

/* ----- Steps (numbered) ---------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: clamp(1.25rem, 0.5rem + 2vw, 2rem);
  counter-reset: step;
}
.step { counter-increment: step; }
.step .step-num {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.9rem;
}
.step .step-num::before { content: counter(step); }
.step h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.step p { color: var(--text-muted); font-size: 0.95rem; }

/* ----- FAQ (native accordion) --------------------------------------------- */
.faq { max-width: var(--container-narrow); margin-inline: auto; display: grid; gap: 0.75rem; }
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.faq__item[open] { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow-sm); }
.faq__q {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 1.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  list-style: none;
  cursor: pointer;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q .faq-chevron {
  margin-left: auto;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  transition: transform var(--dur) var(--ease);
}
.faq__item[open] .faq__q .faq-chevron { transform: rotate(180deg); color: var(--brand); }
.faq__q .faq-index { color: var(--brand); font-variant-numeric: tabular-nums; }
.faq__a { padding: 0 1.35rem 1.3rem; color: var(--text-muted); }
.faq__a p + p { margin-top: 0.75rem; }

/* ----- Language switch (segmented control) -------------------------------- */
.lang-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  gap: 2px;
}
.lang-switch button {
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.lang-switch button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ----- Policy / legal content --------------------------------------------- */
.policy { max-width: var(--container-narrow); margin-inline: auto; }
.policy [data-lang] { display: none; }
.policy.lang-es [data-lang="es"],
.policy.lang-en [data-lang="en"] { display: block; }

.effective {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
  font-weight: 600;
  font-size: 0.92rem;
}
.effective svg { width: 18px; height: 18px; }

.policy-block { margin-top: 2.25rem; }
.policy-block h3 {
  font-size: var(--text-h3);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.policy-block h3 svg { width: 1.2em; height: 1.2em; color: var(--brand); flex-shrink: 0; }
.policy-block h4 { font-size: 1.05rem; margin: 1.25rem 0 0.4rem; }
.policy-block p { color: var(--text-muted); }
.policy-block p + p { margin-top: 0.75rem; }
.policy-block ul { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--text-muted); }
.policy-block ul li { position: relative; padding-left: 1rem; margin-bottom: 0.4rem; }
.policy-block ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.policy-block strong { color: var(--text); }

.callout {
  display: flex;
  gap: 0.85rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  border: 1px solid;
}
.callout svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.callout h4 { margin: 0 0 0.2rem; font-size: 1rem; }
.callout p { margin: 0; }
.callout--info { background: color-mix(in srgb, var(--brand) 8%, transparent); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--text); }
.callout--info svg { color: var(--brand); }
.callout--ok { background: color-mix(in srgb, #16a34a 9%, transparent); border-color: color-mix(in srgb, #16a34a 32%, transparent); }
.callout--ok svg { color: #16a34a; }
.callout--warn { background: color-mix(in srgb, #d97706 11%, transparent); border-color: color-mix(in srgb, #d97706 34%, transparent); }
.callout--warn svg { color: #b45309; }

/* ----- Contact ------------------------------------------------------------- */
.contact-card {
  max-width: var(--container-narrow);
  margin-inline: auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 1rem + 3vw, 3rem);
}
.contact-card h2 { font-size: var(--text-h2); }
.contact-card p { color: var(--text-muted); margin: 0.75rem auto 1.75rem; max-width: 38rem; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

/* ----- Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--footer-bg, var(--text));
  color: var(--footer-text, color-mix(in srgb, white 78%, transparent));
  padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}
.site-footer .footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--footer-strong, #fff);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer nav a { color: inherit; font-size: 0.93rem; transition: color var(--dur-fast) var(--ease); }
.site-footer nav a:hover { color: var(--footer-strong, #fff); }
.site-footer .footer-meta {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, white 14%, transparent);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}

/* ----- Reveal on scroll ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:active { transform: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ----- Scroll offset for sticky header ------------------------------------ */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ----- Small print --------------------------------------------------------- */
.text-muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-section { margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
