/* ==========================================================================
   KALMS · Centro Psicológico Integral — hoja de estilos principal
   Mobile-first. Colores derivados del logo en versión mate.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Marca (versiones mate de los colores del logo) */
  --green: #6f9a52;          /* logo #87bf58 apagado */
  --green-strong: #446a30;   /* para texto sobre claro (AA) */
  --blue: #3e6f9e;           /* logo #3a78bc apagado */
  --blue-strong: #2d5680;    /* botones / enlaces (AA con blanco) */
  --gold: #b8995e;           /* versión "dorado" del logo */
  --accent-red: #b5524a;
  --accent-yellow: #d9b64a;

  /* Superficies y texto (modo claro) */
  --bg: #f6f3ed;
  --bg-alt: #ece7de;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(31, 42, 55, 0.12);
  --text: #1f2a37;
  --text-muted: #4f5b67;
  --link: var(--blue-strong);
  --header-bg: rgba(246, 243, 237, 0.82);
  --menu-bg: rgba(246, 243, 237, 0.97);
  --shadow: 0 1px 2px rgba(31, 42, 55, 0.06), 0 8px 24px rgba(31, 42, 55, 0.08);

  /* Hero: capa al 30 % sobre el video */
  --hero-overlay: rgba(20, 30, 40, 0.30);

  /* Tipografía (sin fuentes externas, con fallback) */
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Bell MT", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1160px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --green: #8fb574;
    --green-strong: #a3c78a;
    --blue: #7ea7d1;
    --blue-strong: #8db4dc;
    --gold: #cdb27c;
    --bg: #12171d;
    --bg-alt: #171e26;
    --surface: rgba(30, 38, 48, 0.72);
    --surface-solid: #1c242e;
    --border: rgba(230, 233, 236, 0.12);
    --text: #e6e9ec;
    --text-muted: #aab4be;
    --link: #9cc0e4;
    --header-bg: rgba(18, 23, 29, 0.82);
    --menu-bg: rgba(18, 23, 29, 0.97);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.2; margin: 0 0 .6em; letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--blue-strong); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm);
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.section { padding: clamp(64px, 10vw, 112px) 0; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section__head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green-strong); margin-bottom: .8rem;
}
.lead { font-size: 1.12rem; color: var(--text-muted); }

/* ---------- 3. Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s, border-color .2s, transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn--primary { background: #2d5680; color: #fff; }
.btn--primary:hover { background: #24476b; }
.btn--ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn--ghost:hover { background: rgba(255, 255, 255, .24); }
.btn--outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn--outline:hover { border-color: var(--blue); color: var(--link); }
.btn--whatsapp { background: #1f7a4d; color: #fff; }
.btn--whatsapp:hover { background: #18633e; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- 4. Cabecera y navegación ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: transparent; transition: background-color .3s, box-shadow .3s, backdrop-filter .3s;
}
.site-header.is-solid,
.site-header.nav-open {
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 1px 0 var(--border);
}
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: #fff; }
.brand img { width: 52px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-serif); font-size: 1.55rem; letter-spacing: .08em; }
.brand__tag { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; opacity: .85; margin-top: .25rem; }
.site-header.is-solid .brand,
.site-header.nav-open .brand { color: var(--text); }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .12);
  color: #fff; cursor: pointer;
}
.site-header.is-solid .nav-toggle,
.site-header.nav-open .nav-toggle { color: var(--text); border-color: var(--border); background: var(--surface); }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
  transition: transform .25s var(--ease), opacity .2s;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Menú móvil */
.main-nav {
  position: fixed; inset: var(--header-h) 0 auto 0; max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  background: var(--menu-bg);
  border-top: 1px solid var(--border); padding: .5rem 16px 1.5rem;
  display: none;
}
.site-header.nav-open .main-nav { display: block; }
.main-nav__list { list-style: none; margin: 0; padding: 0; }
.main-nav__list > li { border-bottom: 1px solid var(--border); }
.main-nav__link,
.main-nav__trigger {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .9rem .25rem; background: none; border: 0; color: var(--text);
  font: 500 1.02rem/1.3 var(--font-sans); text-decoration: none; cursor: pointer; text-align: left;
}
.main-nav__trigger .chev { width: 14px; height: 14px; transition: transform .2s; }
.main-nav__trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.dropdown { list-style: none; margin: 0 0 .6rem; padding: 0 0 0 .75rem; display: none; }
.dropdown.is-open { display: block; }
.dropdown a { display: block; padding: .55rem .25rem; color: var(--text-muted); text-decoration: none; }
.dropdown a:hover { color: var(--link); }
.main-nav__cta { margin-top: 1rem; width: 100%; }

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .main-nav {
    position: static; display: block; max-height: none; overflow: visible; padding: 0;
    background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .main-nav__list { display: flex; align-items: center; gap: .25rem; }
  .main-nav__list > li { border: 0; position: relative; }
  .main-nav__link, .main-nav__trigger {
    padding: .5rem .8rem; border-radius: 999px; color: #fff; font-size: .96rem; width: auto;
  }
  .site-header.is-solid .main-nav__link, .site-header.is-solid .main-nav__trigger { color: var(--text); }
  .main-nav__link:hover, .main-nav__trigger:hover,
  .main-nav__trigger[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
  .site-header.is-solid .main-nav__link:hover, .site-header.is-solid .main-nav__trigger:hover,
  .site-header.is-solid .main-nav__trigger[aria-expanded="true"] { background: rgba(62, 111, 158, .1); }

  .dropdown {
    position: absolute; top: calc(100% + 10px); left: 50%; translate: -50% 0; min-width: 270px;
    padding: .5rem; margin: 0; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--menu-bg);
    box-shadow: var(--shadow);
    display: block; opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s, transform .18s var(--ease), visibility .18s;
  }
  .dropdown::before { content: ""; position: absolute; inset: -12px 0 auto 0; height: 12px; }
  .dropdown.is-open { opacity: 1; visibility: visible; transform: none; }
  .dropdown a { padding: .55rem .8rem; border-radius: var(--radius-sm); color: var(--text); font-size: .95rem; }
  .dropdown a:hover, .dropdown a:focus-visible { background: rgba(62, 111, 158, .1); color: var(--link); }
  .main-nav__cta { margin: 0 0 0 .6rem; width: auto; min-height: 42px; padding: .5rem 1.1rem; }
}

/* ---------- 5. Hero con video ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: center; isolation: isolate;
  color: #fff; overflow: hidden; padding: calc(var(--header-h) + 40px) 0 72px;
  background: #2a3a4a url("../img/hero-poster.jpg") center / cover no-repeat;
}
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero__overlay { position: absolute; inset: 0; z-index: -1; background: var(--hero-overlay); }
.hero__content { max-width: 760px; }
.hero__content h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero__content .eyebrow { color: #fff; opacity: .9; }
.hero__lead { font-size: clamp(1.05rem, 2.4vw, 1.25rem); max-width: 620px; text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.hero__chips { list-style: none; padding: 0; margin: 2.2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.hero__chips li {
  font-size: .85rem; padding: .35rem .85rem; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.video-toggle {
  position: absolute; right: 16px; top: calc(var(--header-h) + 16px); width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .25); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.video-toggle svg { width: 18px; height: 18px; }
.video-toggle .icon-play { display: none; }
.video-toggle[aria-pressed="true"] .icon-play { display: block; }
.video-toggle[aria-pressed="true"] .icon-pause { display: none; }

/* ---------- 6. Tarjetas y rejillas ---------- */
.grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s var(--ease), border-color .25s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(62, 111, 158, .35); }
.card h3 { margin-bottom: .45em; }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1.1rem;
  background: rgba(62, 111, 158, .12); color: var(--blue);
}
.card__icon svg { width: 28px; height: 28px; }
.card--green .card__icon { background: rgba(111, 154, 82, .14); color: var(--green); }
.card--gold .card__icon { background: rgba(184, 153, 94, .16); color: var(--gold); }
.card ul { margin: .4rem 0 0; color: var(--text-muted); font-size: .95rem; }
.card ul li { margin-bottom: .25rem; }

/* ---------- 7. Quiénes somos ---------- */
.about { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .about { grid-template-columns: 1.1fr .9fr; gap: 64px; } }
.about__visual {
  position: relative; border-radius: 24px; padding: 40px; aspect-ratio: 1 / 1; display: grid; place-items: center;
  background:
    radial-gradient(60% 60% at 25% 30%, rgba(111, 154, 82, .22), transparent 70%),
    radial-gradient(60% 60% at 75% 70%, rgba(62, 111, 158, .22), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.about__visual img { width: 80%; }
.pillars { display: grid; gap: 14px; margin-top: 1.8rem; }
@media (min-width: 640px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
.pillar { padding: 18px 20px; border-left: 3px solid var(--green); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pillar:nth-child(2n) { border-left-color: var(--blue); }
.pillar h3 { font-size: 1.08rem; font-family: var(--font-sans); font-weight: 600; margin-bottom: .3em; }
.pillar p { margin: 0; font-size: .95rem; color: var(--text-muted); }

/* ---------- 8. Público / proceso ---------- */
.audience { text-align: center; }
.audience .card__icon { margin-inline: auto; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { position: relative; padding: 24px 22px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-serif); font-size: 2rem; color: var(--gold); display: block; margin-bottom: .4rem;
}
.steps h3 { font-family: var(--font-sans); font-weight: 600; font-size: 1.05rem; }
.steps p { font-size: .95rem; color: var(--text-muted); margin: 0; }

/* ---------- 9. Profesionales ---------- */
.pro { text-align: center; }
.pro__avatar {
  width: 112px; height: 112px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 2rem; color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 0 0 6px rgba(184, 153, 94, .18);
  overflow: hidden;
}
.pro__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pro__role { color: var(--green-strong); font-weight: 600; font-size: .92rem; margin-bottom: .6rem; }
.pro p { font-size: .95rem; color: var(--text-muted); }

/* ---------- 10. Contacto ---------- */
.contact { display: grid; gap: 32px; }
@media (min-width: 960px) { .contact { grid-template-columns: .9fr 1.1fr; gap: 48px; } }
.contact__list { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: 14px; }
.contact__list li { display: flex; gap: 14px; align-items: flex-start; }
.contact__list .card__icon { width: 44px; height: 44px; margin: 0; flex: none; border-radius: 12px; }
.contact__list .card__icon svg { width: 22px; height: 22px; }
.contact__list strong { display: block; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.form { display: grid; gap: 16px; }
@media (min-width: 640px) { .form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-solid); color: var(--text);
  font: 1rem/1.4 var(--font-sans);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--blue); }
.form__note { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* ---------- 11. Footer ---------- */
.site-footer { background: #17202a; color: #c9d1d9; padding: 56px 0 28px; font-size: .95rem; }
.site-footer a { color: #e6e9ec; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer__grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer__brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; color: #fff; }
.footer__brand img { width: 56px; }
.footer__brand span { font-family: var(--font-serif); font-size: 1.5rem; letter-spacing: .08em; }
.site-footer h2 { font-family: var(--font-sans); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: #9fb0c0; font-weight: 600; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer__bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .85rem; color: #9fb0c0; }

/* ---------- 12. Botón flotante de WhatsApp ----------
   Va a la IZQUIERDA para no tapar la burbuja de Chatwoot (derecha). */
.wa-float {
  position: fixed; left: 16px; bottom: 20px; z-index: 90;
  display: inline-flex; align-items: center; gap: .55rem; height: 56px; padding: 0 18px 0 16px;
  border-radius: 999px; background: #1f7a4d; color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22); transition: transform .2s var(--ease), background-color .2s;
}
.wa-float:hover { background: #18633e; transform: translateY(-2px); }
.wa-float svg { width: 26px; height: 26px; }
.wa-float__label { display: none; }
@media (min-width: 640px) { .wa-float__label { display: inline; } }

/* ---------- 13. Animaciones de entrada ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 14. Página 404 ---------- */
.notfound { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 32px 16px; }
.notfound img { width: 140px; margin: 0 auto 1.2rem; }
.notfound__code { font-family: var(--font-serif); font-size: clamp(4rem, 14vw, 7rem); color: var(--gold); line-height: 1; margin: 0; }
