/* =====================================================================
   Estilos del sitio
   ===================================================================== */
:root {
  --navy: #1b3a5c;
  --navy-deep: #122a44;
  --green: #2c5b4f;
  --green-deep: #1d4138;
  --gold: #b8924a;
  --gold-dark: #8a6a2f;
  --cream: #faf7f0;
  --paper: #ffffff;
  --ink: #23262b;
  --muted: #5f6670;
  --line: #e6e0d2;
  --ok: #1f7a4a;
  --ok-bg: #e7f5ec;
  --bad: #b3261e;
  --bad-bg: #fbeaea;
  --warn: #9a6400;
  --warn-bg: #fff4dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .07);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: "Cinzel", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--cream);
  font-size: 16px; line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; color: var(--navy-deep); margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.1rem; color: var(--muted); }
.eyebrow { font-family: var(--sans); font-weight: 700; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: .6rem; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.section { padding: 4.5rem 0; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.center { text-align: center; }
.small { font-size: .88rem; color: var(--muted); }

/* idioma */
html[lang="es"] [data-l="en"], html[lang="en"] [data-l="es"] { display: none !important; }

/* aviso de demostración */
.demo-bar { background: #fff4dc; color: #6b4a00; font-size: .85rem; text-align: center; padding: .5rem 1rem; border-bottom: 1px solid #f0dba8; }
.demo-bar[hidden] { display: none; }

/* encabezado */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 247, 240, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--navy-deep); }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; box-shadow: inset 0 0 0 3px var(--navy), inset 0 0 0 5px var(--gold); flex: none; }
.brand-mark svg { width: 22px; height: 22px; fill: #f7efe0; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.02rem; letter-spacing: .06em; line-height: 1.1; }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; padding: .5rem .75rem; border-radius: 999px; }
.nav-links a:hover, .nav-links a.active { background: #efe8d8; color: var(--navy-deep); }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.lang-toggle button { border: 0; background: transparent; font: 700 .8rem var(--sans); padding: .45rem .7rem; cursor: pointer; color: var(--muted); }
.lang-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.menu-btn { display: none; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; }
.nav-right { display: flex; align-items: center; gap: .6rem; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav-links { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--cream); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem 1rem; }
}

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; cursor: pointer; text-decoration: none; font: 700 .95rem var(--sans); padding: .85rem 1.35rem; border-radius: 999px; transition: transform .1s, box-shadow .2s, background .2s; min-height: 48px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgba(27, 58, 92, .25); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--navy-deep); box-shadow: inset 0 0 0 2px var(--navy); }
.btn-ghost:hover { background: rgba(27, 58, 92, .06); }
.btn-sm { padding: .5rem .9rem; font-size: .84rem; min-height: 38px; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-light { background: #efe8d8; color: var(--navy-deep); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* hero */
.hero { padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero p.lead { max-width: 36rem; }
.hero-card { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: 1.1rem; border: 1px solid var(--line); transform: rotate(-1.5deg); }
.hero-card img { border-radius: 10px; width: 100%; height: auto; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.6rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
.hero-badges span::before { content: "✓"; color: var(--gold-dark); margin-right: .4rem; font-weight: 800; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-card { transform: none; } }

/* tarjetas */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.card h3 { margin-top: .2rem; }
.icon-dot { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1rem; }
.icon-dot svg { width: 28px; height: 28px; }
.i-navy { background: #e3eaf3; } .i-navy svg { fill: var(--navy); }
.i-green { background: #dfece7; } .i-green svg { fill: var(--green); }
.i-gold { background: #f4ead6; } .i-gold svg { fill: var(--gold-dark); }
.card.service { border-top: 5px solid var(--navy); }
.card.esa { border-top: 5px solid var(--green); }
ul.check { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.check li { padding-left: 1.6rem; position: relative; margin: .45rem 0; }
ul.check li::before { content: ""; position: absolute; left: 0; top: .5em; width: .8rem; height: .45rem; border-left: 2.5px solid var(--gold-dark); border-bottom: 2.5px solid var(--gold-dark); transform: rotate(-45deg); }

/* pasos */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; padding: 0; list-style: none; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.4rem 4.2rem; position: relative; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 1.2rem; top: 1.3rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .95rem; }
.steps strong { display: block; color: var(--navy-deep); margin-bottom: .2rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* tabla comparativa */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
table.compare { width: 100%; border-collapse: collapse; min-width: 560px; }
table.compare th, table.compare td { padding: .9rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .95rem; }
table.compare thead th { background: #f4efe3; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-deep); }
table.compare tr:last-child td { border-bottom: 0; }
table.compare td:first-child { font-weight: 700; color: var(--navy-deep); width: 28%; }

/* faq */
details.faq { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0 1.2rem; margin-bottom: .75rem; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 1.05rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; color: var(--navy-deep); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--gold-dark); }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding-bottom: 1.1rem; color: var(--muted); }

.notice { border-left: 4px solid var(--gold); background: #fbf6ea; padding: 1rem 1.2rem; border-radius: 0 12px 12px 0; color: #4b4436; }

/* formularios */
form .field { margin-bottom: 1.1rem; }
label, .label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; color: var(--navy-deep); }
.req::after { content: " *"; color: var(--bad); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; font: 500 1rem var(--sans); color: var(--ink); background: #fff; border: 1.5px solid #d9d2c2; border-radius: 10px; padding: .75rem .85rem; min-height: 48px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27, 58, 92, .15); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--navy-deep); margin-bottom: .8rem; padding: 0; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .choice-cards { grid-template-columns: 1fr; } }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: block; border: 2px solid #d9d2c2; border-radius: 12px; padding: .9rem 1rem; background: #fff; cursor: pointer; font-weight: 700; }
.choice span small { display: block; font-weight: 500; color: var(--muted); margin-top: .2rem; }
.choice input:checked + span { border-color: var(--navy); background: #eef3f8; box-shadow: 0 0 0 3px rgba(27, 58, 92, .12); }
.choice input:focus-visible + span { outline: 3px solid var(--gold); }
.checkbox { display: flex; gap: .7rem; align-items: flex-start; font-weight: 500; font-size: .92rem; color: var(--ink); }
.checkbox input { width: 20px; height: 20px; margin-top: .15rem; flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.photo-pick { display: flex; gap: 1rem; align-items: center; }
.photo-preview { width: 92px; height: 92px; border-radius: 50%; background: #efe8d8; border: 3px solid var(--gold); object-fit: cover; flex: none; }
.form-msg { padding: .9rem 1rem; border-radius: 10px; margin-top: 1rem; font-weight: 600; }
.form-msg.ok { background: var(--ok-bg); color: var(--ok); }
.form-msg.err { background: var(--bad-bg); color: var(--bad); }

/* verificación */
.verify-box { max-width: 640px; margin-inline: auto; }
.verify-form { display: flex; gap: .6rem; }
.verify-form input { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
@media (max-width: 520px) { .verify-form { flex-direction: column; } }
.result { margin-top: 1.5rem; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.result-head { padding: 1.2rem 1.4rem; display: flex; align-items: center; gap: .9rem; color: #fff; }
.result-head .big { font-family: var(--sans); font-weight: 800; font-size: 1.35rem; letter-spacing: .02em; line-height: 1.2; }
.result-head .sub { font-size: .9rem; opacity: .92; }
.result-head svg { width: 42px; height: 42px; flex: none; fill: #fff; }
.result.ok .result-head { background: var(--ok); }
.result.bad .result-head { background: var(--bad); }
.result.warn .result-head { background: var(--warn); }
.result-body { padding: 1.4rem; display: grid; grid-template-columns: 150px 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 520px) { .result-body { grid-template-columns: 1fr; } }
.result-photo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold); background: #efe8d8; display: grid; place-items: center; }
.result-photo svg { width: 70px; height: 70px; fill: var(--navy); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .95rem; }
dl.facts dt { font-weight: 700; color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }
.result-foot { padding: 0 1.4rem 1.3rem; font-size: .86rem; color: var(--muted); }

/* pie */
.site-footer { background: var(--navy-deep); color: #d9e1ea; padding: 3rem 0 1.5rem; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--sans); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2rem; padding-top: 1.2rem; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* vistas */
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { padding: 3.2rem 0 1.5rem; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }

/* panel administrativo */
.admin-shell { padding: 2rem 0 4rem; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tabs button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: .55rem 1rem; font: 700 .88rem var(--sans); cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs .count { background: var(--gold); color: #fff; border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; font-size: .75rem; }
.list { display: grid; gap: .8rem; }
.item { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center; }
@media (max-width: 640px) { .item { grid-template-columns: 52px 1fr; } .item .actions { grid-column: 1 / -1; } }
.item img, .item .ph { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #efe8d8; display: grid; place-items: center; }
@media (max-width: 640px) { .item img, .item .ph { width: 52px; height: 52px; } }
.item .ph svg { width: 28px; height: 28px; fill: var(--navy); }
.item h4 { margin: 0; font-size: 1rem; }
.item .meta { font-size: .84rem; color: var(--muted); }
.item .actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .15rem .55rem; border-radius: 999px; vertical-align: middle; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-new { background: #e3eaf3; color: var(--navy); }
.b-svc { background: #e3eaf3; color: var(--navy); }
.b-esa { background: #dfece7; color: var(--green); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); background: var(--paper); border: 1px dashed var(--line); border-radius: 12px; }
.login-card { max-width: 420px; margin: 3rem auto; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(10, 18, 30, .6); display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 100; }
.modal.open { display: flex; }
.modal-box { background: var(--paper); border-radius: 16px; max-width: 980px; width: 100%; max-height: 92vh; overflow: auto; padding: 1.2rem; }
.modal-box .cert-img { width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.modal-head h3 { margin: 0; }
.x-btn { border: 0; background: #efe8d8; width: 40px; height: 40px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; flex: none; }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(0, 0, 0, .15); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--navy-deep); color: #fff; padding: .8rem 1.2rem; border-radius: 999px; font-weight: 600; font-size: .9rem; z-index: 200; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 2rem); text-align: center; }
.toast.show { opacity: 1; }
