/* =========================================================
   Beatriz Gómez Bastida · Psicóloga — Hoja de estilos
   ========================================================= */
:root {
  --ink: #1f2a2b;
  --ink-soft: #4a5657;
  --muted: #6e7a7b;
  --sage: #5f7f72;
  --sage-dark: #3f5c50;
  --sage-light: #e6eee9;
  --sand: #f7f3ee;
  --sand-dark: #ece4d9;
  --terra: #c0835f;
  --white: #ffffff;
  --line: #e3ddd4;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(31, 42, 43, .08);
  --shadow-lg: 0 24px 60px rgba(31, 42, 43, .12);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sage-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terra); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; color: var(--ink); margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }
.container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sage); margin-bottom: 1rem;
}
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 40em; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .9rem 1.6rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--sage-dark); color: #fff; }
.btn-primary:hover { background: var(--ink); color: #fff; }
.btn-ghost { border-color: var(--sage-dark); color: var(--sage-dark); background: transparent; }
.btn-ghost:hover { background: var(--sage-dark); color: #fff; }
.btn-light { background: #fff; color: var(--sage-dark); }
.btn-light:hover { background: var(--sand); color: var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Cabecera ---------- */
.topbar { background: var(--sage-dark); color: #e8efeb; font-size: .875rem; }
.topbar .container { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.topbar span + span { margin-left: 1.2rem; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(0,0,0,.04); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  color: var(--sage-dark);
}
.brand-mark svg { width: 44px; height: 44px; transition: transform .6s ease; }
.brand:hover .brand-mark svg { transform: rotate(90deg); }
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.2rem; }
.brand-text small { color: var(--muted); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: .3rem; }
.nav > ul { display: flex; list-style: none; margin: 0; padding: 0; gap: .2rem; align-items: center; }
.nav a, .nav button.sub-toggle {
  display: block; padding: .55rem .9rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem;
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.nav a:hover, .nav button.sub-toggle:hover, .nav a[aria-current="page"] { background: var(--sand); color: var(--sage-dark); }
.nav .has-sub { position: relative; }
.nav .sub-toggle::after { content: ""; display: inline-block; margin-left: .4rem; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-3px); }
.nav .submenu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  list-style: none; margin: 0; padding: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.nav .has-sub:hover .submenu, .nav .has-sub:focus-within .submenu, .nav .has-sub.open .submenu { opacity: 1; visibility: visible; transform: none; }
.nav .submenu a { border-radius: 8px; }
.nav .nav-cta { margin-left: .6rem; }
.nav .nav-cta a { background: var(--sage-dark); color: #fff; padding: .6rem 1.2rem; }
.nav .nav-cta a:hover { background: var(--ink); color: #fff; }
.nav .nav-private a { color: var(--muted); font-size: .9rem; }

.menu-toggle { display: none; background: none; border: 0; width: 46px; height: 46px; cursor: pointer; border-radius: 10px; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  display: block; width: 24px; height: 2px; background: var(--ink); position: relative; margin: auto; transition: .2s; content: "";
}
.menu-toggle span::before { position: absolute; top: -7px; }
.menu-toggle span::after { position: absolute; top: 7px; }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-toggle span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 960px) {
  /* Sin desenfoque: si no, el menú fijo queda encerrado dentro de la cabecera */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .menu-toggle { display: block; }
  .nav {
    position: fixed; top: var(--nav-top, 78px); right: 0; bottom: 0; left: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 1.2rem 1.25rem 2rem; overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s;
  }
  .menu-open .nav { transform: none; visibility: visible; }
  .menu-open { overflow: hidden; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: .2rem; }
  .nav a, .nav button.sub-toggle { font-size: 1.1rem; padding: .8rem 1rem; width: 100%; text-align: left; }
  .nav .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 1rem; display: none; }
  .nav .has-sub.open .submenu { display: block; }
  .nav .nav-cta { margin: 1rem 0 0; }
  .nav .nav-cta a { text-align: center; }
  .topbar .hide-sm { display: none; }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--sand) 0%, #fff 100%); padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 em { font-style: italic; color: var(--sage-dark); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 2rem 0 2.2rem; }
.trust { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; list-style: none; padding: 0; margin: 0; color: var(--ink-soft); font-size: .95rem; }
.trust li { display: flex; align-items: center; gap: .5rem; }
.trust li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.portrait { position: relative; width: 100%; }
.portrait-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 200px 200px var(--radius) var(--radius);
  overflow: hidden; background: linear-gradient(160deg, var(--sage-light), var(--sand-dark)); box-shadow: var(--shadow-lg);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.hero .portrait { max-width: 380px; justify-self: center; }
.portrait-badge {
  position: absolute; left: -1.5rem; bottom: 2rem; background: #fff; border-radius: 14px; padding: .9rem 1.1rem;
  box-shadow: var(--shadow); display: flex; gap: .8rem; align-items: center; max-width: 250px;
}
.portrait-badge .ico { width: 42px; height: 42px; border-radius: 50%; background: var(--sage-light); display: grid; place-items: center; color: var(--sage-dark); flex: none; }
.portrait-badge strong { display: block; font-size: .95rem; line-height: 1.3; }
.portrait-badge small { color: var(--muted); font-size: .82rem; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { width: 100%; max-width: 380px; margin-inline: auto; }
  .portrait-badge { left: 0; }
}

/* ---------- Cabecera de página interior ---------- */
.page-hero { background: var(--sand); padding: clamp(3rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.page-hero .lead { margin-bottom: 0; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--muted); }

/* ---------- Secciones ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--sand); }
.section-head { max-width: 720px; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split.top { align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.highlight {
  border-left: 3px solid var(--terra); padding: .4rem 0 .4rem 1.4rem; margin: 1.8rem 0;
  font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; color: var(--ink);
}

/* Tarjetas de servicio */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
@media (max-width: 1020px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.6rem 1.7rem;
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; color: var(--ink); }
.card .ico { width: 54px; height: 54px; border-radius: 14px; background: var(--sage-light); color: var(--sage-dark); display: grid; place-items: center; margin-bottom: 1.4rem; }
.card .ico svg { width: 26px; height: 26px; }
.card p { color: var(--ink-soft); font-size: .98rem; flex: 1; }
.card .more { font-weight: 600; color: var(--sage-dark); font-size: .95rem; }
.card:hover .more { color: var(--terra); }

/* Pasos */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: step; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { background: #fff; border-radius: var(--radius); padding: 2rem 1.8rem; position: relative; box-shadow: 0 2px 0 var(--line); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--serif); font-size: 2.6rem; color: var(--terra); line-height: 1; display: block; margin-bottom: 1rem;
}
.step p { color: var(--ink-soft); margin: 0; }

/* Valores */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 860px) { .values { grid-template-columns: 1fr; } }
.value { padding: 1.8rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.value .ico { width: 48px; height: 48px; border-radius: 50%; background: var(--sage-light); color: var(--sage-dark); display: grid; place-items: center; margin-bottom: 1.1rem; }
.value .ico svg { width: 22px; height: 22px; }
.value p { color: var(--ink-soft); margin: 0; font-size: .98rem; }

/* Lista de problemas tratados */
.tags { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.tags li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; font-size: .95rem; color: var(--ink-soft); }
.section-alt .tags li { background: #fff; }

.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.checklist li { padding-left: 2rem; position: relative; margin-bottom: .8rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--sage-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f5c50' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.media-frame { border-radius: var(--radius); overflow: hidden; background: linear-gradient(160deg, var(--sage-light), var(--sand-dark)); aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame.contain img { object-fit: contain; padding: 1.5rem; background: #fff; }

.note { background: var(--sage-light); border-radius: var(--radius-sm); padding: 1.2rem 1.4rem; color: var(--sage-dark); font-size: .98rem; }

/* Banda CTA */
.cta-band { background: var(--sage-dark); color: #e8efeb; border-radius: calc(var(--radius) + 6px); padding: clamp(2.2rem, 5vw, 3.6rem); display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .3em; }
.cta-band p { margin: 0; max-width: 34em; }
.cta-band .actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.cta-band .btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: var(--sage-dark); }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.info-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.info-list li { display: flex; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.info-list li:first-child { padding-top: 0; }
.info-list .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--sage-light); color: var(--sage-dark); display: grid; place-items: center; flex: none; }
.info-list .ico svg { width: 20px; height: 20px; }
.info-list strong { display: block; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.info-list a { color: var(--ink); text-decoration: none; }
.info-list a:hover { color: var(--sage-dark); text-decoration: underline; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.6rem, 4vw, 2.6rem); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.2rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
label .req { color: var(--terra); }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=password], input[type=datetime-local], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px var(--sage-light); }
textarea { min-height: 140px; resize: vertical; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; font-size: .92rem; color: var(--ink-soft); }
.check input { margin-top: .3rem; width: 18px; height: 18px; accent-color: var(--sage-dark); flex: none; }
.hp { position: absolute; left: -9999px; }
.form-msg { border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 1.4rem; display: none; }
.form-msg.ok { display: block; background: var(--sage-light); color: var(--sage-dark); }
.form-msg.err { display: block; background: #fbeae3; color: #8a3f1f; }
.small { font-size: .85rem; color: var(--muted); }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: #b9c3c2; padding: 4rem 0 0; font-size: .95rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: 1.05rem; font-family: var(--sans); font-weight: 600; letter-spacing: .02em; margin-bottom: 1rem; }
.site-footer a { color: #dfe6e5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer .brand { color: #fff; margin-bottom: 1rem; }
.site-footer .brand-mark { color: #dfe6e5; }
.site-footer .brand-text small { color: #9aa6a5; }
.hours dt { color: #fff; font-weight: 600; }
.hours dd { margin: 0 0 .6rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.4rem 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .85rem; }
.footer-bottom ul { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-bottom li { margin: 0; }

/* Botón flotante de llamada (móvil) */
.float-call {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40; display: none;
  width: 58px; height: 58px; border-radius: 50%; background: var(--sage-dark); color: #fff;
  box-shadow: var(--shadow-lg); place-items: center;
}
.float-call svg { width: 24px; height: 24px; }
@media (max-width: 700px) { .float-call { display: grid; } }

/* Animación suave de aparición */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Páginas legales ---------- */
.legal { max-width: 800px; }
.legal h2 { font-size: 1.5rem; margin-top: 2.4rem; }
.legal h3 { font-size: 1.15rem; margin-top: 1.6rem; font-family: var(--sans); font-weight: 600; }
.legal ul { padding-left: 1.2rem; margin: 0 0 1.1em; }
.legal li { margin-bottom: .4rem; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; background: var(--sand); padding: 1.2rem 1.4rem; border-radius: var(--radius-sm); }
.legal dt { font-weight: 600; }
.legal dd { margin: 0; }
.legal .pendiente { background: #fde9c8; padding: 0 .3em; border-radius: 4px; }
@media (max-width: 560px) { .legal dl { grid-template-columns: 1fr; } .legal dd { margin-bottom: .6rem; } }

/* Marca un 20 % más grande (en móvil se mantiene el tamaño base) */
@media (min-width: 561px) {
  .brand { gap: .95rem; }
  .brand-mark { width: 55px; height: 55px; }
  .brand-mark svg { width: 53px; height: 53px; }
  .brand-text strong { font-size: 1.44rem; }
  .brand-text small { font-size: .94rem; }
  .nav-wrap { height: 88px; }
}

/* Validación del formulario */
.field-error { color: #a4421c; font-size: .86rem; margin: .35rem 0 0; }
input.invalid, select.invalid, textarea.invalid { border-color: #c96a44; }
input.invalid:focus, select.invalid:focus, textarea.invalid:focus { box-shadow: 0 0 0 4px #fbe3d8; }
.check input.invalid { outline: 2px solid #c96a44; outline-offset: 2px; }
button[disabled] { opacity: .7; cursor: wait; }
