/* EuroLatam shared styles: accessibility, legal footer, legal pages, form consent.
   Loaded last in <head> so it can override page styles where contrast needs fixing. */

:root {
  --brand-blue-on-light: #0a68a0;   /* 6.0:1 on white, 5.6:1 on #f5f8fc — use for text/links on light surfaces */
  --footer-text: #c3c6cb;           /* 10:1 on #0d1a2e */
  --focus-ring: #31b0f2;
  --focus-ring-on-light: #0a68a0;
  --error-ink: #b42323;             /* 6.5:1 on white */
  --success-ink: #256b43;
}

/* ─── Skip link ─── */
.skip-link {
  position: fixed; left: 1rem; top: 0.75rem; z-index: 10000;
  padding: 0.75rem 1.25rem; border-radius: 8px;
  background: #ffffff; color: #0d1a2e; font: 600 0.9375rem/1.2 'Inter', system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(13, 26, 46, 0.35), 0 2px 6px rgba(13, 26, 46, 0.2);
  transform: translateY(-200%);
  text-decoration: none;
}
.skip-link:focus-visible { transform: translateY(0); outline: 3px solid var(--focus-ring); outline-offset: 2px; }

main:focus { outline: none; }

/* ─── Visible keyboard focus everywhere ─── */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
.on-light-surface a:focus-visible, .legal-main a:focus-visible, .features-section a:focus-visible, .contact-section a:focus-visible {
  outline-color: var(--focus-ring-on-light);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ─── Footer: business details ─── */
.footer-business {
  margin: 0; max-width: 46rem; text-align: center;
  font-size: 0.8125rem; line-height: 1.7; color: var(--footer-text);
}
.footer-business a { color: #ffffff; text-decoration: underline; text-underline-offset: 3px; }
.footer-business a:hover { text-decoration-thickness: 2px; }
.footer-business a:active { opacity: 0.7; }
.footer-business a:focus-visible { outline-color: var(--focus-ring); }

/* Footer contrast overrides (were ~25–40% white) */
.site-footer .footer-copy { color: var(--footer-text); font-size: 0.8125rem; }
.site-footer .bottom-social a { color: #d5d8dc; padding: 0.375rem; border-radius: 6px; }
.site-footer .bottom-social a:hover { color: #ffffff; }
.site-footer .bottom-social a:active { opacity: 0.7; }
.site-footer .bottom-social a:focus-visible { outline-color: var(--focus-ring); }

/* Contact page footer: the one place the Legal & Privacy link lives.
   Deliberately quiet: 12px, softer than "Powered by", #8e98a5 = 5.97:1 on #0d1a2e. */
.site-footer .footer-meta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  column-gap: 0.625rem; row-gap: 0.125rem;
}
.footer-sep { color: #8e98a5; font-size: 0.75rem; }
.site-footer .footer-legal {
  display: inline-block; padding: 0.3125rem 0.125rem; line-height: 1.2;
  font-size: 0.75rem; letter-spacing: 0.01em; color: #8e98a5;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(142, 152, 165, 0.45);
  border-radius: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.site-footer .footer-legal:hover { color: #ffffff; text-decoration-color: currentColor; }
.site-footer .footer-legal:focus-visible {
  color: #ffffff; text-decoration-color: currentColor;
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.site-footer .footer-legal:active { opacity: 0.7; }
@media (max-width: 359px) {
  .footer-sep { display: none; }
  .site-footer .footer-meta { flex-direction: column; }
}

/* ─── Header: keep the active link readable and the toggle targets ≥ 24px ─── */
.hamburger { min-width: 44px; min-height: 44px; }
.translate-btn { min-height: 36px; }

/* ─── Forms ─── */
.consent-row {
  display: flex; gap: 0.75rem; align-items: flex-start;
  margin: 0.5rem 0 1.25rem;
}
.consent-row input[type="checkbox"] {
  flex: 0 0 auto; width: 1.375rem; height: 1.375rem; margin-top: 0.15rem;
  accent-color: var(--brand-blue-on-light);
}
.consent-row label { font-size: 0.9375rem; line-height: 1.6; color: #2d3748; cursor: pointer; }
.consent-row a { color: var(--brand-blue-on-light); text-underline-offset: 3px; }
.consent-row a:hover { text-decoration: none; }
.consent-row a:active { opacity: 0.7; }

.field-error { display: block; margin-top: 0.375rem; font-size: 0.875rem; line-height: 1.5; color: var(--error-ink); }
.field-error[hidden] { display: none; }
.form-input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error-ink) !important; }
.form-status { margin: 1rem 0 0; font-size: 0.9375rem; line-height: 1.6; min-height: 1.5em; }
.form-status.is-error { color: var(--error-ink); }
.form-status.is-success { color: var(--success-ink); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ─── Legal pages ─── */
.legal-hero { background: #0d1a2e; padding: 7.5rem 2rem 3rem; color: #ffffff; }
.legal-hero-inner { max-width: 48rem; margin: 0 auto; }
.legal-hero h1 {
  font-family: 'Merriweather', Georgia, serif; font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.25; margin: 0 0 0.75rem;
}
.legal-hero p { margin: 0; color: #c3c6cb; font-size: 0.9375rem; line-height: 1.7; }
.legal-main { background: #f5f8fc; padding: 3.5rem 2rem 5rem; }
.legal-doc {
  max-width: 48rem; margin: 0 auto; padding: 2.5rem 2.25rem;
  background: #ffffff; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(13, 26, 46, 0.06), 0 12px 32px -12px rgba(10, 104, 160, 0.18);
  color: #2d3748; font-family: 'Inter', system-ui, sans-serif; font-size: 1rem; line-height: 1.75;
}
.legal-doc h2 {
  font-family: 'Merriweather', Georgia, serif; font-weight: 700; letter-spacing: -0.02em;
  font-size: 1.375rem; line-height: 1.3; color: #0d1a2e; margin: 2.5rem 0 0.75rem;
}
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc h3 { font-size: 1.0625rem; color: #0d1a2e; margin: 1.5rem 0 0.5rem; }
.legal-doc p, .legal-doc ul, .legal-doc ol { margin: 0 0 1rem; }
.legal-doc ul, .legal-doc ol { padding-left: 1.5rem; }
.legal-doc li { margin-bottom: 0.4rem; }
.legal-doc a { color: var(--brand-blue-on-light); text-decoration: underline; text-underline-offset: 3px; }
.legal-doc a:hover { text-decoration-thickness: 2px; }
.legal-doc a:active { opacity: 0.7; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: 0.9375rem; }
.legal-doc th, .legal-doc td { text-align: left; vertical-align: top; padding: 0.625rem 0.75rem; border-bottom: 1px solid #dbe3ee; }
.legal-doc th { color: #0d1a2e; font-weight: 600; background: #f5f8fc; }
.legal-doc .table-wrap { overflow-x: auto; }
.legal-doc .note {
  padding: 1rem 1.25rem; border-left: 4px solid var(--brand-blue-on-light); background: #f5f8fc;
  border-radius: 0 8px 8px 0; margin: 0 0 1.25rem;
}
.legal-doc .updated { color: #4a5568; font-size: 0.9375rem; }
.legal-doc .form-box { border: 1px dashed #8fa3bb; border-radius: 8px; padding: 1rem 1.25rem; background: #fbfcfe; }

/* ─── Combined legal page (/legal): contents list + one card per policy ─── */
.legal-page .legal-toc-wrap { max-width: 48rem; margin: 0 auto 2rem; }
.legal-toc {
  padding: 1.5rem 2.25rem; background: #ffffff; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(13, 26, 46, 0.06), 0 12px 32px -12px rgba(10, 104, 160, 0.18);
  font-family: 'Inter', system-ui, sans-serif;
}
.legal-toc-title {
  margin: 0 0 0.75rem; color: #4a5568; font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.legal-toc ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 1.5rem;
}
.legal-toc a {
  display: block; padding: 0.5rem 0; color: var(--brand-blue-on-light);
  font-size: 1rem; font-weight: 600; line-height: 1.4;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.legal-toc a:hover { text-decoration-thickness: 2px; }
.legal-toc a:active { opacity: 0.7; }
.legal-toc a:focus-visible { outline-color: var(--focus-ring-on-light); }
/* The fixed header must not cover a section heading after a jump. */
.legal-page .legal-section { scroll-margin-top: 6.5rem; }
.legal-page .legal-section + .legal-section { margin-top: 2rem; }
.legal-page .legal-section-head { margin: 0 0 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #dbe3ee; }
.legal-page .legal-doc h2.legal-section-title {
  font-weight: 700; letter-spacing: -0.01em; font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.3; margin: 0 0 0.5rem;
}
.legal-page .legal-section-lede { margin: 0; color: #4a5568; }
/* Policy headings sit one level below the section title, so they stay a step smaller. */
.legal-page .legal-doc h3 {
  font-family: 'Merriweather', Georgia, serif; font-weight: 700; letter-spacing: -0.01em;
  font-size: 1.125rem; line-height: 1.4; color: #0d1a2e; margin: 2.25rem 0 0.625rem;
}
.legal-page .legal-doc h4 { font-size: 1rem; color: #0d1a2e; margin: 1.5rem 0 0.5rem; }

/* Bilingual legal text: show only the active language (English if JS is off). */
html[lang="es"] [data-lang="en"], html:not([lang="es"]) [data-lang="es"] { display: none; }

@media (max-width: 640px) {
  .legal-hero { padding: 6.5rem 1.25rem 2.25rem; }
  .legal-main { padding: 2rem 1rem 3.5rem; }
  .legal-doc { padding: 1.5rem 1.25rem; }
  .legal-toc { padding: 1.25rem; }
  .legal-toc ul { grid-template-columns: 1fr; }
  .legal-page .legal-toc-wrap { margin-bottom: 1.5rem; }
  .legal-page .legal-section { scroll-margin-top: 5.5rem; }
  .legal-page .legal-section + .legal-section { margin-top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* ── Contrast fixes on light surfaces (brand #31b0f2 is only 2.4:1 on white) ── */
.mission-block h2.teal,
.mission-block h2.dark,
h2[data-i18n="process.title"],
.process-number,
.post-item-date { color: var(--brand-blue-on-light); }
p[data-i18n="process.subtitle"],
.process-highlight { color: #576171; }
.header-cta { background: var(--brand-blue-on-light); }
.header-cta:hover { background: #075282; }
.footer-copy { color: var(--footer-text); }

/* ── Slide dots: 24px hit area around the small visual dot ── */
.preview-dot { position: relative; }
.preview-dot::after { content: ""; position: absolute; inset: -9px; }
.preview-dots { gap: 1rem; }
.preview-dot:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.cards-section-header p[data-i18n="process.subtitle"],
.process-card .process-highlight { color: #576171; }
.preview-dot { width: 24px; height: 24px; padding: 8px; background-clip: content-box; box-sizing: border-box; }
.preview-dot::after { display: none; }
.preview-dots { gap: 0; }
.preview-dot.active { transform: none; }
.cards-section-header p[data-i18n="process.subtitle"],
.process-card .process-highlight { opacity: 1; }
