:root {
  color-scheme: light;
  --bg: #f8f7f4;
  --surface: #ffffff;
  --text: #4a4a4a;
  --muted: #696969;
  --accent: #4a7b74; /* era #9caea9; oscurecido para cumplir contraste WCAG AA (~5:1 sobre blanco) */
  --accent-soft: rgba(74, 123, 116, 0.12);
  --border: rgba(74, 74, 74, 0.08);
  font-family: 'Inter', system-ui, sans-serif;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus {
  top: 0;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #faf8f5 0%, #f1eefb 100%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

header {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 0 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text);
  font-size: 1rem;
}

.brand img {
  width: 52px;
  height: auto;
  border-radius: 12px;
  background: var(--surface);
  padding: 0.35rem;
  box-shadow: 0 12px 28px rgba(23, 20, 59, 0.08);
  display: block;
}

.brand span {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

/* Botón hamburguesa: oculto en escritorio, visible en móvil (ver media query) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--accent);
}

section {
  margin-top: 2rem;
  padding: 1rem 0;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.section-heading {
  margin: 0;
  font-size: clamp(1.75rem, 2vw, 2.5rem);
  max-width: 640px;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 30px 60px rgba(23, 20, 59, 0.06);
}

.card strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text);
}

.card p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.card p:last-child {
  margin-bottom: 0;
}

.hero {
  display: grid;
  gap: 2rem;
  padding: 2rem 0;
}

.hero-title {
  font-size: clamp(2.4rem, 3.6vw, 4rem);
  margin: 0;
  line-height: 1.18; /* más interlineado: 1.05 quedaba apretado en títulos de varias líneas */
  letter-spacing: -0.03em;
}

.hero-text {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-media {
  position: relative;
  min-height: 420px;
  border-radius: 36px;
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: 0 30px 70px rgba(23, 20, 59, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: 1px solid transparent;
}

.button {
  background: var(--accent);
  color: white;
  box-shadow: 0 20px 50px rgba(74, 123, 116, 0.2);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-color: var(--border);
}

.button:hover,
.button-secondary:hover {
  transform: translateY(-1px);
}

.legal-notice {
  padding: 2rem 0;
}

.legal-notice .card {
  border-radius: 24px;
  padding: 1.75rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
}

.legal-notice p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.legal-notice p:last-child {
  margin-bottom: 0;
}

.legal-notice a {
  color: var(--accent);
  text-decoration: none;
}

.legal-article h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 0.5rem;
}

.legal-article h2:first-child {
  margin-top: 0;
}

.legal-article p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.legal-article p:last-child {
  margin-bottom: 0;
}

.legal-article a {
  color: var(--accent);
  text-decoration: none;
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start; /* texto alineado arriba, no centrado contra la foto */
    gap: 3.5rem;
    padding: 3.5rem 0 6rem;
  }

  .hero-text {
    margin-top: 0.5rem;
  }
}

@media (max-width: 860px) {
  main {
    padding: 2rem 0 3rem;
  }

  header {
    padding: 2rem 0 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .nav-toggle {
    display: block;
  }

  /* En móvil el nav se oculta tras el botón hamburguesa y ocupa todo el ancho al abrirse */
  nav {
    display: none;
    gap: 0.25rem;
    width: 100%;
    flex-direction: column;
  }

  nav.open {
    display: flex;
  }

  nav a {
    font-size: 0.95rem;
    padding: 0.75rem 1rem; /* ~44px de alto: cumple área de toque mínima (WCAG 2.5.5) */
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem 0;
  }

  .hero-title {
    font-size: clamp(2.2rem, 8vw, 3rem);
    line-height: 1.1;
  }

  .hero-media {
    min-height: 280px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(23, 20, 59, 0.1);
  }

  .section-heading {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .button,
  .button-secondary {
    width: 100%;
    text-align: center;
    padding: 1.2rem 1.6rem;
  }

  .legal-notice .card {
    padding: 1.5rem;
  }

  .legal-notice p {
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   Clases que sustituyen a los antiguos estilos inline (style="...").
   Movidos aquí para poder eliminar 'unsafe-inline' de style-src en la CSP.
   ========================================================================== */

.hero-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-cta {
  margin-top: 1.5rem;
}

.section-cta {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.cta-block {
  margin-top: 2rem;
}

.card-bright {
  background: rgba(255, 255, 255, 0.95);
}

/* ==========================================================================
   Página de inicio (antes en el <style> de index.html).
   Reglas con ámbito .page-home para no afectar al resto de páginas.
   ========================================================================== */

.page-home section {
  margin-top: 3.5rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(30, 29, 35, 0.06);
}

/* El hero es la primera sección: pegado a la cabecera, sin línea ni margen superior.
   Mayor especificidad que `.page-home section` para anular margin/border/padding. */
.page-home .hero {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.page-home .hero-identity {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  box-shadow: 0 18px 40px rgba(23, 20, 59, 0.05);
  width: fit-content;
}

.page-home .hero-identity img {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  object-fit: contain;
  background: var(--surface);
  padding: 0.65rem;
  display: block;
}

.page-home .hero-identity-content {
  display: grid;
  gap: 0.2rem;
}

.page-home .hero-identity-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.page-home .hero-identity-role {
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-home .hero-identity-badge {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.page-home .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem; /* antes inline en el div */
}

/* Más aire entre la etiqueta "Psicóloga..." y el título, y antes de la descripción */
.page-home .hero > div > .section-title {
  margin-bottom: 1.5rem;
}

.page-home .hero .hero-text {
  margin-top: 1.75rem;
}

.page-home .workplace-title {
  margin-top: 1.8rem !important;
  margin-bottom: 0.75rem !important;
}

.page-home .about {
  display: grid;
  gap: 1.5rem;
}

.page-home .services {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.page-home .service-card {
  padding: 1.75rem;
  border-radius: 24px;
  border: 1px solid rgba(156, 174, 169, 0.14);
  background: linear-gradient(180deg, rgba(156, 174, 169, 0.08), rgba(255, 255, 255, 0.95));
}

.page-home .service-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.page-home .service-card p {
  margin: 0;
  color: var(--muted);
}

.page-home .contact-grid {
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.page-home .contact-card {
  display: grid;
  gap: 1rem;
}

.page-home .contact-item {
  display: grid;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
}

.page-home .contact-item span {
  color: var(--muted);
  font-size: 0.95rem;
}

.page-home .contact-item strong {
  font-size: 1.05rem;
  color: var(--text);
}

.page-home .contact-item a {
  color: var(--text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.page-home .contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 30px 60px rgba(23, 20, 59, 0.05);
}

.page-home .contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.page-home .contact-form input,
.page-home .contact-form textarea {
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  color: var(--text);
}

.page-home .contact-form input:focus:not(:focus-visible),
.page-home .contact-form textarea:focus:not(:focus-visible) {
  outline: none;
}

.page-home .contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

.page-home .contact-form button {
  margin-top: 1rem;
  width: 100%;
  border: none;
  cursor: pointer;
}

.page-home #form-status {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.page-home .consent-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.65;
  margin-top: 1rem;
}

.page-home .consent-label input[type="checkbox"] {
  width: auto;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
  margin-top: 0.3rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.page-home .consent-label a {
  color: var(--accent);
  text-decoration: none;
}

.page-home .highlight {
  color: var(--accent);
}

@media (min-width: 860px) {
  .page-home .hero-media {
    background-image: url('hero-decorative.svg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }

  .page-home .hero-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.28));
    pointer-events: none;
  }

  .page-home .about {
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
  }

  .page-home .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 860px) {
  .page-home .about {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .page-home .services {
    grid-template-columns: 1fr;
  }

  .page-home .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .page-home .contact-form {
    padding: 1.5rem;
  }

  .page-home .hero-actions {
    justify-content: center;
  }
}

/* ==========================================================================
   Página del cuestionario (antes en el <style> de necesito-psicoterapia.html).
   Reglas con ámbito .page-quiz.
   ========================================================================== */

.page-quiz .intro {
  margin: 1.5rem 0 2rem;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
}

.page-quiz .question-card,
.page-quiz .result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 1.75rem;
  box-shadow: 0 30px 60px rgba(23, 20, 59, 0.06);
}

.page-quiz .question-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0;
}

.page-quiz .question-card {
  display: block;
}

.page-quiz fieldset.question-card {
  border: none;
  min-width: 0;
}

/* float + width:100% fuerza a la <legend> a renderizarse DENTRO del fieldset.
   Sin esto, el navegador la ancla al borde y se sale de la tarjeta. */
.page-quiz .question-card legend {
  padding: 0;
  margin: 0 0 1rem;
  float: left;
  width: 100%;
  color: var(--text);
  font-weight: 500;
  font-size: inherit;
  font-family: inherit;
}

.page-quiz .options {
  clear: both;
  display: grid;
  gap: 0.75rem;
}

.page-quiz .option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #faf9f7;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.page-quiz .option input {
  accent-color: var(--accent);
}

.page-quiz .option:hover {
  border-color: var(--accent);
  background: rgba(156, 174, 169, 0.08);
}

.page-quiz .section-cta {
  margin-top: 1.75rem; /* antes inline: ligeramente menor que el resto del sitio */
}

.page-quiz .result-card {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.96);
}

/* Oculto hasta responder; quiz.js lo muestra con style.display = 'block' (permitido por la CSP) */
.page-quiz #result-section {
  display: none;
}

.page-quiz .result-card p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.page-quiz .result-card strong {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.page-quiz .question-grid {
  max-width: 720px;
}

@media (max-width: 860px) {
  .page-quiz .question-card {
    padding: 1.5rem;
  }

  .page-quiz .question-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .page-quiz .result-card {
    padding: 1.5rem;
  }
}

.page-quiz fieldset.question-card.unanswered {
  border: 1px solid #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.10), 0 30px 60px rgba(23, 20, 59, 0.06);
}

.page-quiz .question-card.unanswered::after {
  content: 'Selecciona una opción';
  color: #c0392b;
  font-size: 0.85rem;
  font-weight: 400;
}
