/* ==========================================================================
   Dra. Jesica Aquino — Sistema visual compartido
   Mobile-first. Sin dependencias externas ni fuentes de terceros.
   Cada página aplica un tema mediante la clase del <body>:
   .theme-defensa · .theme-victimas · .theme-institucional
   ========================================================================== */

:root {
  /* Base común */
  --ink: #16202e;
  --ink-soft: #3b4656;
  --muted: #5d6877;
  --paper: #faf8f4;
  --surface: #ffffff;
  --line: #e2ddd3;
  --gold: #9a7a4a;
  --gold-soft: #efe6d6;
  --danger: #a3302a;
  --danger-bg: #fbeeec;
  --ok: #1f6b4f;
  --ok-bg: #e9f4ee;
  --notice-bg: #f2efe8;

  /* Tema (se sobrescribe por página) */
  --brand: #1d2b44;
  --brand-ink: #ffffff;
  --brand-deep: #121c2e;
  --accent: var(--gold);
  --accent-soft: var(--gold-soft);
  --hero-bg: linear-gradient(160deg, #1d2b44 0%, #121c2e 100%);
  --hero-ink: #f4f1ea;
  --hero-muted: #c9cfd9;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(22, 32, 46, .06), 0 8px 24px rgba(22, 32, 46, .06);
  --wrap: 1120px;
  --gutter: 16px;
}

.theme-defensa {
  --brand: #1b2a3f;
  --brand-deep: #0f1928;
  --accent: #765d36;
  --accent-soft: #ece4d4;
  --hero-bg: linear-gradient(165deg, #1b2a3f 0%, #0f1928 70%);
  --hero-muted: #c3cad6;
}

.theme-victimas {
  --brand: #2f5d5a;
  --brand-deep: #234846;
  --accent: #8a5637;
  --accent-soft: #f3e7dc;
  --paper: #fbf8f3;
  --notice-bg: #eef3f1;
  --hero-bg: linear-gradient(165deg, #f4ede3 0%, #e7efec 100%);
  --hero-ink: #1e2f2e;
  --hero-muted: #45605d;
}

.theme-institucional {
  --brand: #22304a;
  --brand-deep: #161f33;
  --accent: #7d3a3f;
  --accent-soft: #f1e4e2;
  --hero-bg: linear-gradient(165deg, #22304a 0%, #161f33 75%);
  --hero-muted: #c7cdd8;
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; color: var(--ink); margin: 0 0 .6em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.85rem, 5.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.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: 8px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 28px; } }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(6px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font-family: var(--font-serif); font-size: .95rem; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; }
.brand-role { font-size: .78rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.btn.header-cta { display: none; }
@media (min-width: 640px) { .btn.header-cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }
.site-nav { display: none; }
.site-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.site-nav ul { list-style: none; margin: 0; padding: 8px var(--gutter) 16px; }
.site-nav a { display: block; padding: 12px 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.site-nav li:last-child a { border-bottom: 0; }
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; position: static; box-shadow: none; border: 0; background: none; }
  .site-nav ul { display: flex; gap: 22px; padding: 0; }
  .site-nav a { padding: 6px 0; border: 0; font-size: .95rem; color: var(--ink-soft); }
  .site-nav a:hover { color: var(--accent); }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 22px;
  font: 600 .95rem/1.25 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; text-align: center;
  border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.theme-victimas .btn-primary:hover { background: var(--brand); }
.btn-outline { background: transparent; color: inherit; border-color: currentColor; }
.btn-outline:hover { color: var(--accent); }
.btn-small { min-height: 42px; padding: 8px 14px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 48px 0 56px; }
.hero h1 { color: var(--hero-ink); max-width: 20ch; }
.hero .lead { font-size: 1.15rem; color: var(--hero-muted); max-width: 60ch; }
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.hero .eyebrow { color: #d8c39d; }
.theme-victimas .hero .eyebrow { color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-actions .btn { width: 100%; }
@media (min-width: 560px) { .hero-actions .btn { width: auto; } }
.hero-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 10px; }
.hero-points li { display: flex; gap: 10px; align-items: flex-start; color: var(--hero-muted); font-size: .98rem; }
.hero-points svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: #d8c39d; }
.theme-victimas .hero-points svg { color: var(--brand); }
@media (min-width: 720px) {
  .hero { padding: 80px 0 88px; }
  .hero-points { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.4fr 1fr; gap: 56px; } }

/* ---------- Secciones ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head p { color: var(--muted); }
@media (min-width: 720px) { .section { padding: 84px 0; } }

.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { gap: 22px; } }
@media (min-width: 640px) and (max-width: 899px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 1px 0 rgba(22, 32, 46, .03);
}
.section-alt .card { background: var(--paper); }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.card-icon svg { width: 22px; height: 22px; }
.card-link { display: inline-block; margin-top: 10px; font-weight: 600; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li {
  counter-increment: step; position: relative; padding: 18px 18px 18px 66px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.section-alt .steps li { background: var(--paper); }
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-family: var(--font-serif); font-weight: 600;
}
.steps h3 { font-size: 1.05rem; margin-bottom: .25em; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
@media (min-width: 900px) { .steps.steps-row { grid-template-columns: repeat(2, 1fr); } }

.split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.25fr; gap: 56px; } }

/* Marcadores de contenido pendiente: visibles a propósito. */
.pending {
  border: 2px dashed #c2a466; background: repeating-linear-gradient(-45deg, #fbf6ea, #fbf6ea 12px, #f6efdc 12px, #f6efdc 24px);
  color: #6b5426; border-radius: var(--radius); padding: 18px; font-size: .95rem;
}
.pending strong { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: 4px; }
.photo-pending {
  aspect-ratio: 4 / 5; display: grid; place-items: center; text-align: center;
  max-width: 380px; width: 100%;
}
.pending-inline {
  display: inline-block; padding: 1px 8px; border: 1px dashed #c2a466; border-radius: 4px;
  background: #fbf6ea; color: #6b5426; font-size: .9em;
}

/* ---------- Ámbito / jurisdicción ---------- */
.jurisdiction-note {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--notice-bg); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 0 0 22px;
  font-size: 1rem; line-height: 1.55; color: var(--ink);
}
.jurisdiction-note svg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 2px; }
.jurisdiction-note p { margin: 0; }

.scope-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.scope-list li { display: flex; gap: 10px; align-items: flex-start; }
.scope-list svg { width: 20px; height: 20px; flex: none; margin-top: 4px; }
.scope-yes svg { color: var(--ok); }
.scope-no svg { color: var(--danger); }

/* ---------- Formulario ---------- */
.contact-section { background: var(--brand-deep); color: #eef1f5; }
.theme-victimas .contact-section { background: #24403e; }
.contact-section h2 { color: #fff; }
.contact-section .section-head p { color: #c9d0da; }
.contact-grid { display: grid; gap: 28px; grid-template-areas: "head" "form" "points"; }
.contact-head { grid-area: head; margin-bottom: 0; }
.contact-form { grid-area: form; }
.contact-points { grid-area: points; padding-left: 0; list-style: none; display: grid; gap: 12px; margin: 0; align-content: start; }
.contact-points li { display: flex; gap: 10px; color: #d6dce4; }
.contact-points li svg { width: 20px; height: 20px; flex: none; margin-top: 4px; color: #d8c39d; }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1fr 1.1fr; grid-template-rows: auto 1fr; grid-template-areas: "head form" "points form"; column-gap: 56px; row-gap: 24px; align-items: start; }
}
.lead-form {
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius); padding: 22px; box-shadow: 0 20px 40px rgba(0, 0, 0, .18);
}
@media (min-width: 720px) { .lead-form { padding: 32px; } }
.lead-form h3 { font-size: 1.3rem; }
.field { margin-bottom: 18px; }
.field label, .field legend { display: block; font-weight: 600; font-size: .98rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { display: block; font-size: .86rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.req { color: var(--danger); }
.field input[type="text"], .field select {
  width: 100%; min-height: 50px; padding: 10px 14px;
  font: 400 1rem/1.4 var(--font-sans); color: var(--ink);
  background: #fff; border: 1.5px solid #c9c3b7; border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
}
.field select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b4656' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
.field input:focus, .field select:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--danger); background: #fffafa; }
.field-error { display: block; color: var(--danger); font-size: .88rem; margin-top: 6px; font-weight: 600; }
.field-error:empty { display: none; }

.privacy-hint {
  display: flex; gap: 10px; font-size: .88rem; color: var(--muted);
  background: var(--paper); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px;
}
.privacy-hint svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--brand); }
.form-legal { font-size: .82rem; color: var(--muted); margin: 14px 0 0; }

.form-alert { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; font-size: .97rem; }
.form-alert[hidden] { display: none; }
.form-alert p:last-child { margin-bottom: 0; }
.form-alert-block { background: var(--danger-bg); border: 1px solid #e8c3bf; color: #5f1d19; }
.form-alert-info { background: #eef2f8; border: 1px solid #cfd8e6; color: #1e2c44; }
.form-alert-ok { background: var(--ok-bg); border: 1px solid #bfdccc; color: #164a37; }
.form-alert strong { display: block; margin-bottom: 4px; }

.btn-whatsapp { background: #1f7a52; color: #fff; }
.btn-whatsapp:hover { background: #17603f; color: #fff; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.section-alt .faq details { background: var(--paper); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; position: relative;
  font-weight: 600; font-family: var(--font-serif); font-size: 1.06rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq .faq-body { padding: 0 18px 16px; color: var(--ink-soft); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Avisos ---------- */
.help-box {
  border: 1px solid #cfdcd8; background: #f2f7f5; border-radius: var(--radius); padding: 18px 20px; font-size: .97rem;
}
.help-box h2, .help-box h3 { font-size: 1.1rem; margin-bottom: .4em; }
.help-box p:last-child { margin-bottom: 0; }

.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.article-list .card { display: flex; flex-direction: column; gap: 6px; }
.tag {
  display: inline-block; align-self: flex-start; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent); padding: 3px 9px; border-radius: 999px; font-weight: 600;
}

/* ---------- Documentos legales ---------- */
.doc { max-width: 780px; }
.doc h2 { font-size: 1.35rem; margin-top: 1.6em; }
.doc h3 { margin-top: 1.2em; }
.doc-meta { color: var(--muted); font-size: .92rem; }
.breadcrumbs { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #b3ab9c; }
.page-head { padding: 40px 0 8px; }

/* ---------- Pie ---------- */
.site-footer { background: #0e1520; color: #b7c0cc; font-size: .92rem; padding: 44px 0 110px; }
@media (min-width: 900px) { .site-footer { padding-bottom: 44px; } }
.site-footer a { color: #e4e8ee; }
.site-footer a:hover { color: #d8c39d; }
.footer-grid { display: grid; gap: 26px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; color: #fff; font-family: var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-legal { border-top: 1px solid #263244; margin-top: 30px; padding-top: 20px; font-size: .84rem; color: #8f9aa8; }
.site-footer .pending-inline { background: #2a2a20; color: #e6d29f; border-color: #8a7440; }

/* ---------- CTA fija en móvil ---------- */
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(22, 32, 46, .08);
  transform: translateY(0); transition: transform .2s ease;
}
.mobile-cta.is-hidden { transform: translateY(110%); }
.mobile-cta .btn { width: 100%; }
@media (min-width: 900px) { .mobile-cta { display: none; } }

/* ---------- Banner de consentimiento (solo si hay medición configurada) ---------- */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 60; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18); padding: 18px; font-size: .92rem;
}
@media (min-width: 900px) { .consent { left: 24px; bottom: 24px; } }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

noscript .form-alert { display: block; }

/* ---------- Tarjeta dentro del hero ---------- */
.h3-like { font-size: 1.2rem; }
.hero .hero-card { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: var(--hero-ink); box-shadow: none; }
.hero .hero-card h2 { color: var(--hero-ink); }
.hero .hero-card li span { color: var(--hero-muted); }
.hero .hero-card .scope-yes svg { color: #d8c39d; }
.theme-victimas .hero .hero-card { background: rgba(255, 255, 255, .75); border-color: #d7e2de; }
.theme-victimas .hero .hero-card .scope-yes svg { color: var(--brand); }
.theme-victimas .hero .btn-outline { color: var(--brand); }

/* ---------- Fotografía profesional ---------- */
.portrait { display: block; width: 100%; max-width: 380px; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: #2a2f38; }
.hero .portrait img { box-shadow: 0 24px 48px rgba(0, 0, 0, .28); }
@media (min-width: 900px) { .hero .portrait { justify-self: end; } }

/* ---------- Biografía y formación ---------- */
@media (min-width: 900px) { .split.split-bio { grid-template-columns: 1.35fr 1fr; } }
.bio p { color: var(--ink-soft); }
.edu-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.edu-list li { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; border-left: 3px solid var(--accent-soft); }
.edu-list strong { font-family: var(--font-serif); font-size: 1.04rem; color: var(--ink); }
.edu-list span { color: var(--ink-soft); font-size: .95rem; }
.edu-list .tag { margin-top: 4px; font-size: .7rem; }
.lead-text p { font-size: 1.1rem; color: var(--ink-soft); }
@media (min-width: 720px) { .areas-list { grid-template-columns: repeat(2, 1fr); column-gap: 28px; } }
