/* ==========================================================================
   Patricia Fernández Cabeza · Psicología y neuropsicología
   ========================================================================== */

:root {
  /* Colour */
  --paper: #f7f5f0;
  --surface: #ffffff;
  --sage: #edf1ec;
  --sage-strong: #dfe7dd;
  --ink: #1d3231;
  --muted: #56655f;
  --line: #e2e4dd;
  --line-strong: #c9d0c6;
  --green: #244d4b;
  --green-dark: #193a38;
  --green-soft: #cfe0d6;
  --accent: #8f6146;
  --accent-light: #e2c3a9;
  --error: #8e3428;
  --focus: #a26439;
  --white: #fff;

  /* Type */
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --text-body: 1.0625rem;
  --text-ui: 1rem;
  --text-small: .875rem;

  /* Layout */
  --shell: 1180px;
  --gutter: 48px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(29, 50, 49, .04), 0 2px 8px rgba(29, 50, 49, .04);
  --shadow-md: 0 2px 4px rgba(29, 50, 49, .04), 0 12px 32px rgba(29, 50, 49, .08);
  --section: 112px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height, 80px) + 16px);
  scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, p, figure, ul { margin-top: 0; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 4.6vw, 4rem); line-height: 1.06; letter-spacing: -.02em; margin-bottom: 24px; }
h2 { font-size: clamp(2rem, 3.2vw, 2.75rem); line-height: 1.12; letter-spacing: -.015em; margin-bottom: 20px; }
h3 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.005em; margin-bottom: 12px; }
h1 em, h2 em { font-style: italic; color: var(--green); }
p { text-wrap: pretty; }
code { font-size: .9em; background: var(--sage); padding: 1px 6px; border-radius: 4px; }
[hidden] { display: none !important; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}

.shell { width: min(var(--shell), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link {
  position: fixed; left: 20px; top: 10px; z-index: 100;
  padding: 12px 20px; background: var(--green); color: var(--white); border-radius: var(--radius-sm);
  max-width: calc(100vw - 40px);
  transform: translateY(calc(-100% - 20px));
}
.skip-link:focus { transform: translateY(0); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; opacity: .6; }

/* ---------- Buttons & links ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; max-width: 100%; min-width: 0;
  padding: 12px 26px;
  border: 1px solid var(--green); border-radius: 999px;
  background: var(--green); color: var(--white);
  font-size: var(--text-ui); font-weight: 500; line-height: 1.3; text-align: center;
  overflow-wrap: anywhere; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.button:hover { background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(36, 77, 75, .22); }
.button > span[aria-hidden="true"] { transition: transform .2s; }
.button:hover > span[aria-hidden="true"] { transform: translateX(3px); }
.button-small { min-height: 42px; padding: 8px 20px; }
.button-ghost { background: transparent; color: var(--green); border-color: var(--line-strong); }
.button-ghost:hover { background: var(--surface); color: var(--green-dark); border-color: var(--green); box-shadow: none; }
.button-light { background: var(--paper); color: var(--green); border-color: var(--paper); }
.button-light:hover { background: var(--white); color: var(--green-dark); border-color: var(--white); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.button:disabled { background: #53635b; border-color: #53635b; color: var(--white); cursor: wait; transform: none; box-shadow: none; }

.text-link {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; max-width: 100%;
  font-size: var(--text-ui); font-weight: 500; color: var(--green);
  overflow-wrap: anywhere;
}
.text-link > span[aria-hidden="true"] { color: var(--accent); transition: transform .2s; }
.text-link:hover { color: var(--green-dark); }
.text-link:hover > span[aria-hidden="true"] { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 245, 240, .88);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 80px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; max-width: 100%; }
.brand-mark {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--green); color: var(--paper);
  font: 25px/1 var(--serif); letter-spacing: -.06em; padding-bottom: 3px;
}
.brand-mark span { color: var(--accent-light); }
.brand-name { min-width: 0; font-size: 1rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.brand-name small { display: block; margin-top: 3px; font-size: .75rem; font-weight: 400; letter-spacing: .08em; color: var(--muted); }

.desktop-nav { display: flex; gap: 6px; margin-left: auto; font-size: var(--text-ui); }
.desktop-nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); transition: color .2s, background-color .2s; }
.desktop-nav a:hover { color: var(--ink); background: var(--sage); }
.desktop-nav a[aria-current] { color: var(--green); font-weight: 500; background: var(--sage); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.mobile-menu { display: none; position: relative; }
.mobile-menu summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-strong);
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 18px; height: 1.5px; background: var(--ink); border-radius: 2px;
  transition: transform .2s, background-color .2s;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.mobile-menu[open] .menu-icon { background: transparent; }
.mobile-menu[open] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.mobile-menu[open] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
.mobile-menu nav {
  position: absolute; top: calc(100% + 12px); right: 0;
  width: 240px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column;
  padding: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.mobile-menu nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
.mobile-menu nav a:hover, .mobile-menu nav a[aria-current] { background: var(--sage); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section-heading { max-width: 720px; margin-bottom: 56px; }
.section-heading h2 { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 70% at 85% 30%, rgba(207, 224, 214, .55), transparent 70%),
    var(--paper);
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 80px; align-items: center;
  padding-block: 88px 104px;
}
.hero h1 em { display: block; }
.hero-intro { max-width: 470px; font-size: 1.25rem; line-height: 1.65; color: var(--muted); margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0;
  list-style: none; padding: 0; margin: 56px 0 0;
  border-top: 1px solid var(--line);
}
.hero-facts li { padding: 22px 28px 0 0; margin-right: 28px; border-right: 1px solid var(--line); min-width: 0; }
.hero-facts li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-facts strong { display: block; font: 1.375rem/1.2 var(--serif); color: var(--green); }
.hero-facts span { display: block; margin-top: 4px; font-size: var(--text-small); line-height: 1.45; color: var(--muted); }

.hero-portrait { position: relative; margin: 0; justify-self: end; width: 100%; max-width: 460px; }
.hero-portrait::before {
  content: ''; position: absolute; inset: 28px -28px -28px 28px;
  border: 1px solid var(--line-strong); border-radius: 220px 220px 22px 22px; z-index: 0;
}
.hero-portrait img {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 4 / 5; height: auto;
  object-fit: cover; object-position: center 30%;
  border-radius: 220px 220px 22px 22px;
  box-shadow: var(--shadow-md);
}
.hero-portrait figcaption {
  position: absolute; z-index: 2; left: -40px; bottom: 36px;
  padding: 14px 20px; max-width: calc(100% + 20px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: var(--text-small); line-height: 1.4;
}
.hero-portrait figcaption strong { display: block; font-size: var(--text-ui); font-weight: 500; }
.hero-portrait figcaption span { color: var(--muted); }

/* ---------- About ---------- */
.about { background: var(--surface); border-block: 1px solid var(--line); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 96px; align-items: start; }
.about-copy p:not(.eyebrow) { color: var(--muted); max-width: 540px; }
.credential-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  min-height: 44px; font-size: var(--text-ui); font-weight: 500; color: var(--green);
  border-bottom: 1px solid var(--accent-light);
}
.credential-link:hover { border-color: var(--accent); }
.credential-link > span[aria-hidden="true"] { color: var(--accent); }
.qualifications { padding: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.qualifications h3 { font-size: 1.375rem; margin-bottom: 24px; }
.qualifications ul { list-style: none; margin: 0; padding: 0; }
.qualifications li { position: relative; padding: 0 0 22px 28px; }
.qualifications li:last-child { padding-bottom: 0; }
.qualifications li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--green);
}
.qualifications li:not(:last-child)::after {
  content: ''; position: absolute; left: 4.5px; top: 22px; bottom: 2px; width: 1px; background: var(--line-strong);
}
.qualifications strong { display: block; font-size: var(--text-ui); font-weight: 500; line-height: 1.45; }
.qualifications li span { display: block; margin-top: 4px; font-size: var(--text-small); line-height: 1.55; color: var(--muted); }

/* ---------- Services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  display: flex; flex-direction: column; min-width: 0;
  padding: 36px 32px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.service-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.service-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 28px;
  border-radius: 14px; background: var(--sage); color: var(--green);
}
.service-card p { font-size: var(--text-ui); color: var(--muted); margin-bottom: 24px; }
.service-card .text-link { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); width: 100%; justify-content: space-between; }

/* ---------- Training band ---------- */
.training { background: var(--green); color: var(--paper); position: relative; overflow: hidden; }
.training::before {
  content: ''; position: absolute; width: 640px; height: 640px; right: -220px; top: -260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .07), transparent 65%);
  pointer-events: none;
}
.training-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 96px; align-items: center; }
.training h2 { color: var(--paper); }
.training .eyebrow { color: var(--accent-light); }
.training-intro p:not(.eyebrow) { color: #d6e2da; margin-bottom: 36px; }
.training-options { display: flex; flex-direction: column; gap: 14px; }
.training-options > a:not(.training-all) {
  display: block; padding: 28px 30px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius);
  transition: background-color .25s, border-color .25s;
}
.training-options > a:not(.training-all):hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .28); }
.training-options h3 { display: flex; justify-content: space-between; gap: 20px; color: var(--paper); font-size: 1.375rem; margin-bottom: 10px; }
.training-options h3 span { font-family: var(--sans); color: var(--accent-light); transition: transform .2s; }
.training-options a:hover h3 span { transform: translateX(4px); }
.training-options p { font-size: var(--text-ui); color: #c9d8cf; margin: 0; }
.training-all {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 48px; padding: 8px 4px; font-size: var(--text-ui); font-weight: 500;
}
.training-all span { color: var(--accent-light); }
.training-all:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--accent-light); }
.training :focus-visible { outline-color: #f4d1a1; }

/* ---------- Contact ---------- */
.contact-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 96px; align-items: start; }
.contact-copy { position: sticky; top: calc(var(--header-height, 80px) + 32px); }
.contact-lead { color: var(--muted); max-width: 440px; }
.faq-list { margin-top: 36px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  position: relative; list-style: none; cursor: pointer;
  padding: 20px 40px 20px 0; font-weight: 500; line-height: 1.5;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--sage); color: var(--green); font-size: 18px; font-weight: 400; line-height: 1;
}
.faq-list details[open] > summary::after { content: '−'; }
.faq-list details > p { color: var(--muted); margin: 0 0 22px; font-size: var(--text-ui); }
.faq-list details > p a, .training-contact-link a, .privacy-note a {
  color: var(--green); text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 4px;
}
.contact-alternatives { margin: 28px 0 0; }
.contact-alternatives a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--text-ui); font-weight: 500; color: var(--green);
  text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 5px;
}

.contact-card {
  min-width: 0; padding: 44px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md);
  scroll-margin-top: 16px;
}
.contact-card h3 { font-size: 1.75rem; margin-bottom: 8px; }
#contact-form .contact-explainer { font-size: var(--text-ui); color: var(--muted); margin: 0 0 28px; }
.contact-choice { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 12px; }
.contact-choice legend { font-size: var(--text-small); font-weight: 500; margin-bottom: 10px; color: var(--ink); }
.contact-choice label {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: var(--text-ui);
  transition: border-color .2s, background-color .2s;
}
.contact-choice label:hover { border-color: var(--green); }
.contact-choice label:has(input:checked) { background: var(--sage); border-color: var(--green); color: var(--green); font-weight: 500; }
.contact-choice input { accent-color: var(--green); margin: 0; width: 16px; height: 16px; }
.contact-choice > .field-error { flex-basis: 100%; }
.training-contact-link { font-size: var(--text-small); margin: 0 0 24px; }

.form-fields { display: grid; gap: 6px; }
.form-fields label { font-size: var(--text-small); font-weight: 500; margin-top: 14px; }
.form-fields label span { color: var(--muted); font-weight: 400; }
.form-fields input, .form-fields textarea {
  width: 100%; min-width: 0; min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: var(--text-ui);
  transition: border-color .2s, background-color .2s, box-shadow .2s;
  resize: vertical; scroll-margin-top: 16px;
}
.form-fields input:hover, .form-fields textarea:hover { border-color: #9fae9f; }
.form-fields input:focus, .form-fields textarea:focus { background: var(--surface); border-color: var(--green); box-shadow: 0 0 0 4px rgba(36, 77, 75, .1); }
.form-fields input:focus-visible, .form-fields textarea:focus-visible { outline: none; }
.message-help { margin-top: 14px; font-size: var(--text-small); color: var(--muted); }
.message-help p { margin: 0 0 2px; }
.privacy-note { font-size: var(--text-small); line-height: 1.6; color: var(--muted); margin: 24px 0 20px; }
#contact-form > .button { width: 100%; }
.contact-status { font-size: var(--text-ui); margin: 14px 0 0; overflow-wrap: anywhere; scroll-margin-top: 16px; }
.contact-status:empty { display: none; }
.contact-status[data-state="error"], .contact-status[data-state="uncertain"] { color: var(--error); }

.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-fields input[aria-invalid="true"], .form-fields textarea[aria-invalid="true"] { border: 2px solid var(--error); }
.contact-choice label:has(input[aria-invalid="true"]) { border: 2px solid var(--error); }
.field-error { margin: 0; font-size: var(--text-small); color: var(--error); overflow-wrap: anywhere; }
.error-summary {
  margin-bottom: 24px; padding: 16px 18px;
  border: 1px solid var(--error); border-left-width: 4px; border-radius: var(--radius-sm);
  background: #fbf1ee; color: var(--error); font-size: var(--text-ui); overflow-wrap: anywhere; scroll-margin-top: 16px;
}
.error-summary h4 { margin: 0 0 6px; font-size: var(--text-ui); }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { text-decoration: underline; text-underline-offset: 3px; }
.error-summary:focus, .contact-status:focus { outline: 3px solid var(--focus); outline-offset: 4px; }
.form-privacy { margin: 20px 0 12px; border-block: 1px solid var(--line); font-size: var(--text-ui); }
.form-privacy summary { cursor: pointer; padding: 14px 0; font-weight: 500; }
.form-privacy-content { padding-bottom: 4px; overflow-wrap: anywhere; }
.form-privacy-content h4 { font-size: var(--text-ui); line-height: 1.5; margin: 10px 0 5px; }
.form-privacy-content p { font-size: var(--text-ui); color: var(--muted); margin: 0 0 16px; }

/* ---------- Subpages ---------- */
.subpage-hero { max-width: var(--shell); padding-block: 72px 56px; }
.subpage-hero h1 { font-size: clamp(2.25rem, 4vw, 3.25rem); max-width: 780px; }
.subpage-hero > p:not(.eyebrow) { font-size: 1.1875rem; color: var(--muted); max-width: 640px; margin-bottom: 32px; }
.subpage-hero > p:last-child { margin-bottom: 0; }
main > .subpage-hero:first-child { border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 32px; font-size: var(--text-small); color: var(--muted); }
.breadcrumb a { color: var(--green); text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 4px; }
.breadcrumb a:hover { text-decoration-color: var(--accent); }
.breadcrumb [aria-hidden="true"] { color: var(--line-strong); }
.subpage-body { padding-block: 56px 104px; }
.subpage-body > h2 { font-size: 2rem; margin: 64px 0 16px; }
.subpage-body > p { color: var(--muted); max-width: 720px; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.topic-grid article {
  display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere;
  padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .25s, box-shadow .25s;
}
.topic-grid article:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.topic-grid article h2 { font-size: 1.5rem; margin: 0 0 10px; }
.topic-grid article p { font-size: var(--text-ui); color: var(--muted); margin-bottom: 0; }
.topic-grid article .text-link { margin-top: auto; padding-top: 20px; }
.topic-grid article p + .text-link { margin-top: 20px; border-top: 1px solid var(--line); width: 100%; justify-content: space-between; }
.page-cta {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 48px; align-items: center;
  margin-top: 64px; padding: 44px 48px;
  background: var(--green); color: var(--paper); border-radius: 20px;
}
.page-cta h2 { color: var(--paper); font-size: 1.875rem; margin: 0; grid-column: 1; }
.page-cta p { color: #d6e2da; margin: 0; grid-column: 1; max-width: 560px; }
.page-cta .button { grid-column: 2; grid-row: 1 / span 2; background: var(--paper); color: var(--green); border-color: var(--paper); }
.page-cta .button:hover { background: var(--white); border-color: var(--white); }
.page-cta :focus-visible { outline-color: #f4d1a1; }
.page-crosslinks { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 32px; }
.page-crosslinks a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 20px;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: var(--text-ui); color: var(--green);
  transition: border-color .2s, background-color .2s;
}
.page-crosslinks a:hover { border-color: var(--green); background: var(--surface); }
.legal { max-width: 800px; margin-inline: auto; margin-left: max(calc((100% - var(--shell)) / 2), var(--gutter)); }
.legal h2 { font-size: 1.5rem; margin: 48px 0 12px; }
.legal h2:first-child { margin-top: 0; }
.legal p { overflow-wrap: anywhere; }
.legal a { color: var(--green); text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 4px; }
#formatos { scroll-margin-top: 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c5d0cb; padding: 64px 0 calc(32px + env(safe-area-inset-bottom)); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.footer-brand .brand-mark { background: rgba(255, 255, 255, .08); }
.footer-brand p { margin: 0; color: var(--paper); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.footer-brand small { display: block; margin-top: 4px; font-size: var(--text-small); font-weight: 400; color: #9fb0a9; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: var(--text-ui); }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; transition: color .2s; }
.footer-nav a:hover { color: var(--white); }
.footer-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 24px; padding-right: 160px; font-size: var(--text-small); color: #9fb0a9; }
.footer-note > span:first-child { margin-right: auto; }
.footer-note a, .footer-note .analytics-preferences { color: #c5d0cb; font-size: var(--text-small); }
.footer-note a:hover, .footer-note .analytics-preferences:hover { color: var(--white); }
.site-footer :focus-visible { outline-color: #f4d1a1; }

/* ---------- Floating WhatsApp ---------- */
.whatsapp-button {
  position: fixed; z-index: 15;
  right: max(24px, env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; max-width: calc(100vw - 40px); padding: 12px 20px 12px 16px;
  border-radius: 999px; background: var(--green); color: var(--white);
  font-size: var(--text-ui); font-weight: 500; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(25, 58, 56, .28);
  transition: background-color .2s, transform .2s;
}
.whatsapp-button svg { flex: 0 0 auto; width: 22px; height: 22px; }
.whatsapp-button:hover { background: var(--green-dark); transform: translateY(-2px); }
.whatsapp-button[data-obscured],
body:has(#contact-form:focus-within) .whatsapp-button,
body:has(.mobile-menu[open]) .whatsapp-button { visibility: hidden; pointer-events: none; }
/* Without scripting, keep the home contact link in the page flow. */
body:has(#contact-form) .whatsapp-button { position: static; width: max-content; margin: 0 20px 24px auto; }
html[data-floating-contact] body:has(#contact-form) .whatsapp-button { position: fixed; margin: 0; }

/* Section-jump focus: visible for keyboard users, no outline for pointer clicks. */
.section-focus-target:focus { outline: none; }
.section-focus-target:focus-visible,
.section-focus-target[data-section-focus="keyboard"]:focus { outline: 3px solid var(--focus); outline-offset: 5px; }
.section-focus-target[data-section-focus="pointer"]:focus { outline: none; }

/* ---------- Page transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 160ms ease-out both page-leave; }
  ::view-transition-new(root) { animation: 220ms ease-out both page-enter; }
}
@keyframes page-leave { from { opacity: 1; } to { opacity: 0; } }
@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 32px; --section: 96px; }
  .hero-inner { gap: 56px; }
  .about-inner, .training-grid, .contact-inner { gap: 56px; }
  .service-card { padding: 30px 26px 24px; }
  .hero-portrait figcaption { left: -20px; }
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .mobile-menu { display: block; }
  .header-actions { margin-left: auto; }
  .hero-inner { grid-template-columns: 1fr; padding-block: 56px 72px; gap: 56px; }
  .hero-portrait { justify-self: center; max-width: 420px; }
  .hero-portrait::before { inset: 20px -20px -20px 20px; }
  .about-inner, .training-grid, .contact-inner { grid-template-columns: 1fr; }
  .contact-copy { position: static; }
  .service-grid { grid-template-columns: 1fr; gap: 16px; }
  .service-card { display: grid; grid-template-columns: 52px 1fr; column-gap: 24px; }
  .service-card > :not(.service-icon) { grid-column: 2; }
  .service-icon { grid-row: 1 / span 3; margin-bottom: 0; }
  .page-cta { grid-template-columns: 1fr; padding: 36px; }
  .page-cta .button { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 16px; }
  .footer-inner { flex-direction: column; }
  .legal { margin-left: auto; }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; --section: 72px; }
  body { font-size: 1rem; }
  .header-inner { min-height: 68px; gap: 10px; }
  .brand { gap: 10px; flex: 1 1 auto; }
  .brand-mark { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
  .brand-name { font-size: .9375rem; }
  .brand-name small { display: none; }
  .header-contact { padding-inline: 16px; }
  .header-contact:hover { transform: none; }
  .hero-inner { padding-block: 40px 56px; gap: 44px; }
  .hero-intro { font-size: 1.125rem; margin-bottom: 28px; }
  .hero-actions .button { width: 100%; }
  .hero-facts { grid-template-columns: 1fr; margin-top: 40px; }
  .hero-facts li { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 0; margin: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-facts li:last-child { border-bottom: 0; }
  .hero-facts strong { font-size: 1.1875rem; }
  .hero-facts span { margin: 0; }
  .hero-portrait { max-width: 340px; margin-right: 16px; }
  .hero-portrait::before { inset: 16px -16px -16px 16px; }
  .hero-portrait figcaption { left: -12px; bottom: 20px; padding: 12px 16px; }
  .section-heading { margin-bottom: 36px; }
  .qualifications { padding: 28px 24px; }
  .service-card { display: flex; padding: 28px 24px 22px; }
  .service-icon { margin-bottom: 22px; }
  .training-options > a:not(.training-all) { padding: 24px; }
  .contact-card { padding: 28px 22px; border-radius: var(--radius); }
  .contact-choice label { flex: 1 1 auto; justify-content: center; }
  .subpage-hero { padding-block: 44px 40px; }
  .subpage-hero .button { width: 100%; }
  .subpage-body { padding-block: 40px 72px; }
  .topic-grid { grid-template-columns: 1fr; gap: 14px; }
  .topic-grid article { padding: 26px 22px; }
  .page-cta { padding: 30px 24px; margin-top: 48px; }
  .page-cta .button { width: 100%; }
  .site-footer { padding-top: 48px; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .footer-note { flex-direction: column; align-items: flex-start; gap: 4px; padding-right: 0; }
  .whatsapp-button { right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 440px) {
  .header-contact { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  @view-transition { navigation: none; }
}
