/* ==========================================================================
   Recovery Centros Terapéuticos — landing de captación
   Mobile first (base) + breakpoint desktop en 900px
   ========================================================================== */

/* --- 1. Tokens ---------------------------------------------------------- */
:root {
  --brand: #2A90A0;
  --brand-dark: #227885;
  --brand-deep: #17505A;
  --brand-soft: #F2F7F7;
  --brand-softer: #EAF4F5;
  --brand-hero-bg: #E4F1F3;
  --cta: #FFC93C;
  --cta-hover: #F2B92A;
  --cta-ink: #1F2426;
  --ink: #22292B;
  --ink-2: #2E3B3E;
  --ink-3: #455356;
  --ink-4: #5D6B6E;
  --ink-5: #778487;
  --bg: #FCFBF8;
  --media-bg: #E6EFEF;
  --hairline: rgba(23, 80, 90, 0.14);
  --focus: #2A90A0;
  --radius: 6px;
  --radius-media: 8px;
  --wrap: 1240px;
  --gutter: 20px;
  --font: 'Manrope', Helvetica, Arial, sans-serif;
}

/* --- 2. Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  padding-bottom: 92px; /* espacio para la barra fija móvil */
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: #1F6E7B; }
a:hover { color: var(--brand); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: #fff;
  border-radius: var(--radius);
}

.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- 3. Tipografía ------------------------------------------------------ */
.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
}

.section__title {
  margin: 0;
  font-size: clamp(26px, 6.6vw, 38px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}
.section__title--sm { font-size: clamp(24px, 6vw, 34px); line-height: 1.18; }
.section__title--invert { color: #fff; }

.section__closing {
  margin: 0;
  font-size: clamp(19px, 5vw, 22px);
  line-height: 1.4;
  color: #fff;
}

.prose { display: flex; flex-direction: column; gap: 20px; }
.prose p { margin: 0; font-size: clamp(17px, 4.4vw, 19px); line-height: 1.65; color: var(--ink-3); }
.note { margin: 0; font-size: 17px; color: var(--ink-4); }
.measure { max-width: 620px; }
.measure-half { width: 100%; }

/* --- 4. Botones y enlaces de acción ------------------------------------ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 160ms ease;
}
.btn--call { background: var(--cta); color: var(--cta-ink); }
.btn--call:hover,
.btn--call:focus-visible { background: var(--cta-hover); color: var(--cta-ink); }
.btn--submit { min-height: 56px; padding: 14px 20px; font-weight: 600; color: #fff; background: var(--brand); }
.btn--submit:hover { background: var(--brand-dark); }
.btn--limited { max-width: 460px; }

.link-alt {
  align-self: flex-start;
  padding: 6px 2px;
  font-size: 16px;
  color: #1F6E7B;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.icon-phone { font-size: 16px; line-height: 1; }

.phone-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-deep);
  text-decoration: none;
}
.phone-link .icon-phone { color: var(--brand); font-size: 15px; }

/* --- 5. Header --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(252, 251, 248, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(23, 80, 90, 0.12);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.site-header__logo { display: flex; align-items: center; }
.site-header__logo img { height: clamp(30px, 8vw, 40px); width: auto; }

/* --- 6. Hero (móvil: foto de fondo a sangre) --------------------------- */
.hero {
  position: relative;
  background: #12383F;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media picture { display: block; }
.hero__media picture,
.hero__media img { width: 100%; height: 100%; }
.hero__media img { object-fit: cover; object-position: 50% 50%; }
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(8, 34, 38, 0.80) 0%,
    rgba(8, 34, 38, 0.70) 42%,
    rgba(8, 34, 38, 0.34) 58%,
    rgba(8, 34, 38, 0.24) 74%,
    rgba(8, 34, 38, 0.62) 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: calc(100svh - 68px);
  padding-top: 26px;
  padding-bottom: 26px;
}
.hero__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}
.hero__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  text-shadow: 0 1px 24px rgba(8, 32, 36, 0.45);
}
.hero__lead {
  margin: 0;
  max-width: 30ch;
  font-size: 22px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 18px rgba(8, 32, 36, 0.5);
}
.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  max-width: 420px;
  margin-top: auto; /* CTA anclado al final del primer pantallazo */
}
.eyebrow--onphoto { color: #A9E1E9; }
.link-alt--onphoto {
  color: #fff;
  font-weight: 600;
  text-decoration-color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 14px rgba(8, 34, 38, 0.85);
}

/* --- 7. Secciones ------------------------------------------------------ */
.section { padding: 60px 0 64px; }
.section--tight { padding: 48px 0; }
.section--soft { background: var(--brand-soft); }
.section--brand { background: var(--brand); color: #fff; }
.section > .container > * + * { margin-top: 28px; }

.split { display: grid; gap: 32px; }
.split--centered { align-items: center; }

/* --- 8. Media ---------------------------------------------------------- */
.media {
  position: relative;
  width: 100%;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--media-bg);
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--square { aspect-ratio: 1 / 1; }
.media--4x5 { aspect-ratio: 4 / 5; }
.media--3x4 { aspect-ratio: 3 / 4; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--16x9 { aspect-ratio: 16 / 9; }

.pos-low { object-position: 50% 62% !important; }
.pos-lower { object-position: 50% 72% !important; }
.pos-high { object-position: 50% 34% !important; }

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(23, 80, 90, 0.35);
  background: #EDF3F3;
}
.placeholder__label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-4);
  text-align: center;
  padding: 8px;
}

/* --- 9. Mosaicos de fotos --------------------------------------------- */
.mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.mosaic__item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--media-bg);
}
.mosaic__item img { width: 100%; height: 100%; object-fit: cover; }
.mosaic__item--span2 { grid-column: span 2; aspect-ratio: 16 / 9; }

/* --- 10. Listas -------------------------------------------------------- */
.checklist { display: flex; flex-direction: column; gap: 14px; }
.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink-2);
}
.checklist__mark { color: var(--brand); font-weight: 700; }

.checklist--ruled {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.checklist--ruled li {
  color: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 14px 0;
  margin-top: -1px;
}
.checklist--ruled .checklist__mark { color: #FFE9A8; }

/* --- 11. Formulario --------------------------------------------------- */
.form-block { display: flex; flex-direction: column; gap: 22px; }
.form { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.form__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field__input {
  height: 56px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(23, 80, 90, 0.25);
  border-radius: var(--radius);
}
.field__input:focus { border-color: var(--brand); }
.field__input[aria-invalid="true"] { border-color: #C0492F; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-4);
  cursor: pointer;
}
.checkbox__input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.legal { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-5); }
.form__error { margin: 0; font-size: 14px; color: #B23A22; }
.form__success {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--brand-softer);
  border: 1px solid rgba(42, 144, 160, 0.35);
  border-radius: var(--radius-media);
}
.form__success strong { font-size: 18px; color: var(--brand-deep); }

.callout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 460px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.callout__title { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink-2); }

/* --- 12. CTA intermedio ----------------------------------------------- */
.cta-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 560px;
  text-align: center;
}
.cta-block__claim {
  margin: 0;
  font-size: clamp(20px, 5.2vw, 26px);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--brand-deep);
}
.cta-block .link-alt { align-self: center; }

/* --- 13. Equipo ------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* --- 14. Paginas legales --------------------------------------------- */
.legal-page {
  padding-bottom: 0;
}

.legal-section {
  background: var(--brand-soft);
}

.legal-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 34px 0;
}

.legal-content > * + * {
  margin-top: 24px;
}

.legal-content section {
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

.legal-content h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 5vw, 25px);
  line-height: 1.25;
  color: var(--brand-deep);
}

.legal-content p {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-3);
}

.legal-content p + p {
  margin-top: 12px;
}

.legal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
  padding-left: 22px;
  list-style: disc;
}

.legal-list li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-3);
}

.legal-owner {
  margin: 18px 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-media);
}

.legal-owner img {
  width: 100%;
  max-width: 974px;
  height: auto;
}

/* --- 14. Footer ------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--hairline); background: var(--bg); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 36px;
  padding-bottom: 44px;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 8px; }
.site-footer__brand img { height: 36px; width: auto; }
.site-footer__phone { font-size: 17px; font-weight: 700; color: var(--brand-deep); text-decoration: none; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14px; }
.site-footer__links a { color: var(--ink-4); text-decoration: underline; text-underline-offset: 3px; }

/* --- 15. Barra fija móvil -------------------------------------------- */
.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  gap: 8px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(252, 251, 248, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(23, 80, 90, 0.16);
  transform: translateY(115%);
  opacity: 0;
  visibility: hidden;
  transition: transform 240ms ease, opacity 200ms ease;
}
.callbar[data-visible="true"] {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
.callbar__primary,
.callbar__secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  text-decoration: none;
  border-radius: var(--radius);
}
.callbar__primary {
  flex: 0 0 66%;
  gap: 8px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--cta-ink);
  background: var(--cta);
}
.callbar__primary:hover { background: var(--cta-hover); color: var(--cta-ink); }
.callbar__secondary {
  flex: 1 1 auto;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--brand-deep);
  background: var(--brand-softer);
  border: 1px solid rgba(42, 144, 160, 0.4);
}
.callbar__secondary:hover { background: #DCEDEF; }

/* --- 16. Cookies ------------------------------------------------------ */
.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(23, 80, 90, 0.18);
  border-radius: var(--radius-media);
  box-shadow: 0 18px 50px rgba(23, 80, 90, 0.18);
}

.legal-page .cookie-banner,
.thanks-page .cookie-banner {
  bottom: calc(12px + env(safe-area-inset-bottom));
}

.cookie-banner__copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookie-banner h2,
.cookie-modal h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--brand-deep);
}

.cookie-banner p,
.cookie-modal p,
.cookie-required small,
.cookie-toggle small {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
}

.cookie-banner a {
  font-size: 14px;
  font-weight: 600;
  text-underline-offset: 3px;
}

.cookie-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.cookie-btn {
  min-height: 46px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-deep);
  background: #fff;
  border: 1px solid rgba(42, 144, 160, 0.45);
  border-radius: var(--radius);
  cursor: pointer;
}

.cookie-btn--primary {
  color: var(--cta-ink);
  background: var(--cta);
  border-color: var(--cta);
}

.cookie-btn--equal {
  color: var(--brand-deep);
  background: #fff;
  border-color: rgba(42, 144, 160, 0.6);
}

.cookie-btn--secondary {
  background: var(--brand-softer);
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 34, 38, 0.42);
}

.cookie-modal__panel {
  width: 100%;
  max-width: 620px;
  max-height: min(86vh, 720px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: #fff;
  border-radius: var(--radius-media);
  box-shadow: 0 22px 70px rgba(8, 34, 38, 0.22);
}

.cookie-modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cookie-required,
.cookie-toggle {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: var(--brand-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.cookie-toggle {
  grid-template-columns: 22px 1fr;
  align-items: start;
  cursor: pointer;
}

.cookie-toggle input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.cookie-toggle span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ======================================================================
   17. Desktop
   ====================================================================== */
@media (min-width: 900px) {
  body { padding-bottom: 0; }

  .callbar { display: none; }

  /* Hero: foto izquierda + texto derecha, sobre fondo azul claro */
  .hero { background: var(--brand-hero-bg); }
  .hero__inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    align-items: center;
    min-height: 0;
    padding-top: 28px;
    padding-bottom: 40px;
  }
  .hero__media {
    position: relative;
    inset: auto;
    order: 1;
    aspect-ratio: 1 / 1;
    max-height: 62vh;
    border-radius: var(--radius-media);
    overflow: hidden;
    background: var(--media-bg);
  }
  .hero__media img { object-position: 50% 40%; }
  .hero__scrim { display: none; }
  .hero__copy { order: 2; padding-left: 40px; gap: 20px; }
  .hero__title { color: var(--brand-deep); text-shadow: none; white-space: nowrap; }
  .hero__lead { color: #4A585B; text-shadow: none; }
  .eyebrow--onphoto { color: var(--brand); }
  .link-alt--onphoto { color: #1F6E7B; font-weight: 400; text-shadow: none; }
  .hero__actions { margin-top: 0; }

  .section { padding: 64px 0 68px; }
  .measure-half { max-width: calc(50% - 18px); }

  .split { grid-template-columns: repeat(2, 1fr); gap: 40px; }

  /* La foto de acompañamiento sube sobre la sección anterior */
  .section > .container > .media--pull-up,
  .media--pull-up { margin-top: -350px; }

  .form__grid { grid-template-columns: repeat(2, 1fr); }

  .checklist--ruled { grid-template-columns: repeat(4, 1fr); gap: 16px 24px; }
  .checklist--ruled li { margin-top: 0; }

  /* Mosaicos editoriales */
  .mosaic { grid-template-columns: repeat(12, 1fr); gap: 16px; }
  .mosaic__item { aspect-ratio: auto; }
  .mosaic--entorno { grid-template-rows: 280px 240px; }
  .mosaic--vida { grid-template-rows: 260px 220px; }
  .mosaic__item--tall { grid-column: span 5; grid-row: span 2; }
  .mosaic__item--wide { grid-column: span 7; }
  .mosaic__item--md { grid-column: span 4; }
  .mosaic__item--sm { grid-column: span 3; }
  .mosaic__item--span2 { grid-column: span 7; aspect-ratio: auto; }

  .team-grid { grid-template-columns: repeat(4, 1fr); }

  .legal-owner {
    max-width: 640px;
  }

  .cookie-banner {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(920px, calc(100vw - 48px));
    grid-template-columns: 1fr auto;
    align-items: end;
    transform: translateX(-50%);
  }

  .cookie-actions {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .cookie-modal {
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
