/* Cámara Web — estilos de la página de presentación y de las páginas legales */
:root {
  color-scheme: light;
  --bg: #f6f5ff; --bg2: #ffffff; --card: #ffffff; --card2: #efebff;
  --line: rgba(30,27,58,.10); --line2: rgba(30,27,58,.18);
  --ink: #1e1b3a; --muted: #5f5c82;
  --acc: #7c3aed; --acc2: #4f8cff; --acc-soft: rgba(124,58,237,.12);
  --top-bg: rgba(255,255,255,.86); --doc-ink: #2c2950; --link: #6d28d9;
  --grad-a: #7c3aed; --grad-b: #2563eb; --shadow: 0 10px 30px rgba(76,29,149,.10);
  --radius: 18px; --max: 1120px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b12; --bg2: #12121c; --card: #171724; --card2: #1e1e2e;
  --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.16);
  --ink: #f2f2f8; --muted: #a2a2bb;
  --acc-soft: rgba(124,58,237,.18);
  --top-bg: rgba(11,11,18,.82); --doc-ink: #d3d3e4; --link: #b794ff;
  --grad-a: #b794ff; --grad-b: #6fa3ff; --shadow: 0 10px 30px rgba(0,0,0,.4);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body.cam-open { overflow: hidden; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--acc2); outline-offset: 3px; border-radius: 8px; }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 20px;
  border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--ink);
  font: 700 15px/1 inherit; cursor: pointer; text-decoration: none; transition: transform .15s, filter .15s, background .15s, border-color .15s; }
body { transition: background-color .25s, color .25s; }
.btn:hover { background: var(--card2); }
.btn.pri { border: 0; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc2)); box-shadow: 0 10px 30px rgba(124,58,237,.35); }
.btn.pri:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn.big { padding: 17px 30px; font-size: 18px; }

/* ── Cabecera ── */
.top { position: sticky; top: 0; z-index: 50; background: var(--top-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: .2px; }
.logo i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-size: 18px;
  background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.top nav { display: flex; gap: 4px; margin-inline-start: auto; }
.top nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.top nav a:hover { color: var(--ink); background: var(--acc-soft); }
.top .btn { padding: 10px 16px; font-size: 14px; }
@media (max-width: 860px) { .top nav { display: none; } .top .btn { margin-inline-start: auto; } }

/* ── Portada ── */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; height: 120%; z-index: 0;
  background: radial-gradient(closest-side, rgba(124,58,237,.28), transparent 70%); }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--acc-soft);
  border: 1px solid rgba(124,58,237,.4); font-size: 13px; font-weight: 700; margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); letter-spacing: -1px; font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); margin: 20px 0 28px; max-width: 540px; }
.hero .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero .note { margin-top: 16px; font-size: 14px; color: var(--muted); max-width: 520px; }
.hero .note b { color: var(--ink); }

/* Maqueta de la cámara (solo CSS, sin imágenes) */
.mock { direction: ltr; position: relative; aspect-ratio: 4 / 3; border-radius: 22px; border: 1px solid var(--line2); overflow: hidden;
  background: linear-gradient(160deg, #2a1a55, #0e1a3a 60%, #1b0f33); box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 60px rgba(124,58,237,.25); }
.mock .face { position: absolute; left: 50%; top: 52%; width: 34%; aspect-ratio: .8; transform: translate(-50%, -50%);
  border-radius: 50% 50% 46% 46%; background: linear-gradient(#e7b894, #cf9772); box-shadow: 0 0 0 8px rgba(255,255,255,.05); }
.mock .face::before, .mock .face::after { content: ""; position: absolute; top: 38%; width: 14%; aspect-ratio: 1; border-radius: 50%;
  background: #4cf0ff; box-shadow: 0 0 16px 4px #4cf0ff; }
.mock .face::before { left: 24%; } .mock .face::after { right: 24%; }
.mock .shoulders { position: absolute; left: 50%; bottom: -14%; width: 70%; aspect-ratio: 2.2; transform: translateX(-50%);
  border-radius: 50% 50% 0 0; background: linear-gradient(#3b3b66, #23233f); }
.mock .rail { position: absolute; right: 0; top: 0; bottom: 0; width: 17%; background: #14141c; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px; padding: 12px 8px; align-items: center; justify-content: flex-start; }
.mock .rail span { width: 70%; aspect-ratio: 1; border-radius: 12px; background: #23233a; display: grid; place-items: center; font-size: 15px; }
.mock .rail span:nth-child(3) { background: var(--acc); }
.mock .bar { position: absolute; left: 0; right: 17%; bottom: 0; padding: 16px 0 14px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent); }
.mock .pill { padding: 5px 16px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: 12px; font-weight: 700; }
.mock .shutter { width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.35); }
.mock .tag { position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: 12px; font-weight: 700; }
@media (max-width: 880px) { .hero .wrap { grid-template-columns: 1fr; gap: 36px; } .hero { padding-top: 44px; } }

/* ── Cifras ── */
.stats { border-block: 1px solid var(--line); background: var(--bg2); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-block: 26px; text-align: center; }
.stats b { display: block; font-size: clamp(26px, 4vw, 38px); font-weight: 800; background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .stats .wrap { grid-template-columns: repeat(2, 1fr); gap: 22px 10px; } }

/* ── Secciones ── */
section.s { padding: 80px 0; }
section.s.alt { background: var(--bg2); border-block: 1px solid var(--line); }
.s h2 { font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.5px; font-weight: 800; text-align: center; }
.s .sub { text-align: center; color: var(--muted); max-width: 640px; margin: 14px auto 44px; font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: st; }
.step { position: relative; padding: 28px 24px 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.step::before { counter-increment: st; content: counter(st); position: absolute; top: -16px; inset-inline-start: 22px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.card:hover { border-color: rgba(124,58,237,.6); transform: translateY(-2px); }
.card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 23px; background: var(--acc-soft); margin-bottom: 14px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 900px; margin: 0 auto; }
.chips span { padding: 7px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.chips span.more { background: var(--acc-soft); color: var(--ink); border-color: rgba(124,58,237,.4); font-weight: 700; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cols2 h3 { text-align: center; margin-bottom: 14px; font-size: 20px; }
@media (max-width: 820px) { .steps, .cols2 { grid-template-columns: 1fr; } .steps { gap: 30px; } }

.help { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.help .card h3 { font-size: 17px; }
.help ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 15px; }
.help li { margin: 5px 0; }

details { max-width: 780px; margin: 0 auto 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
details[open] { border-color: var(--line2); }
summary { cursor: pointer; padding: 16px 20px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
details[open] summary::after { content: "–"; }
details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

.final { text-align: center; padding: 84px 0; background: radial-gradient(closest-side, rgba(124,58,237,.25), transparent 75%); }
.final h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -.5px; }
.final p { color: var(--muted); margin: 14px auto 28px; max-width: 520px; font-size: 17px; }

/* ── Pie ── */
.foot { border-top: 1px solid var(--line); background: var(--bg2); padding: 36px 0 calc(34px + env(safe-area-inset-bottom, 0px)); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.foot p { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 380px; }
.foot h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.foot nav { display: flex; flex-direction: column; gap: 6px; }
.foot nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.foot nav a:hover { color: var(--link); text-decoration: underline; }
.foot .copy { width: 100%; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: 13px; }

/* ── Cámara a pantalla completa (solo cuando se pulsa «Abrir cámara») ── */
#cam-host { position: fixed; inset: 0; z-index: 1000; background: #000; overflow: hidden; }
#cam-host[hidden] { display: none; }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column;
  align-items: center; gap: 8px; z-index: 2147483600; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; background: rgba(20,20,28,.94); border: 1px solid var(--line2); color: #fff; font-size: 14px;
  max-width: min(92vw, 520px); box-shadow: 0 8px 30px rgba(0,0,0,.5); }

/* ── Páginas legales ── */
.doc { max-width: 780px; margin: 0 auto; padding: 48px 20px 72px; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 6px; font-weight: 800; }
.doc .meta { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.doc h2 { font-size: 20px; margin: 30px 0 8px; }
.doc p, .doc li { color: var(--doc-ink); }
.doc ul { padding-inline-start: 20px; }
.doc a { color: var(--link); }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--muted); font-weight: 700; }
.doc code { background: var(--card2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.doc .note { margin-top: 34px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line2); color: var(--muted); font-size: 14px; }
.pending { background: rgba(245,165,36,.2); outline: 1px dashed #f5a524; border-radius: 4px; padding: 0 4px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ── Selector de país / idioma y tema (claro · oscuro) ── */
.cw-controls { display: flex; align-items: center; gap: 8px; }
.top nav + .cw-controls { margin-inline-start: 0; }
.cw-loc { position: relative; }
.cw-loc-btn, .cw-theme-btn { height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 600 14px/1 inherit; transition: background .2s, border-color .2s; }
.cw-loc-btn { padding: 0 12px; }
.cw-theme-btn { width: 42px; justify-content: center; position: relative; overflow: hidden; }
.cw-loc-btn:hover, .cw-theme-btn:hover { background: var(--card2); border-color: var(--acc); }
.cw-loc-btn .sep { opacity: .35; }
.cw-loc-btn .lg { font-size: 11px; font-weight: 800; letter-spacing: .6px; padding: 3px 6px; border-radius: 6px; background: var(--acc-soft); color: var(--link); }
.cw-tr-status { font-size: 11px; margin-left: 4px; opacity: .75; min-width: 1em; }
.cw-loc-btn .chev { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
.cw-loc-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.cw-flag { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.14); flex-shrink: 0; background: var(--card2); }

.cw-theme-btn svg { position: absolute; width: 20px; height: 20px; transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s; }
:root[data-theme="light"] .cw-theme-btn .sun, :root:not([data-theme]) .cw-theme-btn .sun { opacity: 1; transform: none; color: #f59e0b; }
:root[data-theme="light"] .cw-theme-btn .moon, :root:not([data-theme]) .cw-theme-btn .moon { opacity: 0; transform: rotate(90deg) scale(.4); }
:root[data-theme="dark"] .cw-theme-btn .sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
:root[data-theme="dark"] .cw-theme-btn .moon { opacity: 1; transform: none; color: #8fb4ff; }

.cw-dd { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 360px; max-width: calc(100vw - 24px); padding: 12px; z-index: 60;
  background: var(--card); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow), 0 20px 50px rgba(0,0,0,.18);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transition: all .2s cubic-bezier(.16,1,.3,1); }
.cw-dd.open { opacity: 1; visibility: visible; transform: none; }
.cw-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg); margin-bottom: 10px; }
.cw-tabs button { padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 700 12px/1.2 inherit; cursor: pointer; }
.cw-tabs button[aria-selected="true"] { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; }
.cw-search { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); font: 14px inherit; margin-bottom: 8px; }
.cw-search:focus { outline: 2px solid var(--acc2); outline-offset: 1px; }
.cw-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cw-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); cursor: pointer; text-align: start; font: inherit; }
.cw-item:hover { background: var(--card2); }
.cw-item[aria-current="true"] { background: var(--acc-soft); }
.cw-item .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cw-item .nm { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-item .sb { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-item .cd { font: 600 12px ui-monospace, monospace; color: var(--muted); flex-shrink: 0; }
.cw-empty { padding: 22px 0; text-align: center; font-size: 13px; color: var(--muted); }
.cw-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.cw-foot label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

@media (max-width: 560px) {
  .cw-loc-btn .cc, .cw-loc-btn .sep { display: none; }
  .logo span { display: none; }
  .top .wrap { gap: 10px; }
  .cw-dd { position: fixed; top: 72px; inset-inline: 12px; width: auto; max-width: none; }
}
