/* Mr. Shopper Digital · Registro de hallazgos
   Mismos colores del informe de auditoría: morado #57218a, dorado #f4b323.
   Montserrat (la letra del logo) para títulos, Inter para el texto. */
:root {
  --purple: #57218a;
  --purple-2: #7b3db0;
  --purple-deep: #2d1147;
  --purple-soft: #efe7f7;
  --gold: #f4b323;
  --gold-2: #ffd36b;
  --gold-soft: #fff4d9;
  --ink: #25212b;
  --muted: #6c6573;
  --line: #e3dde9;
  --line-2: #d9d4df;
  --bg: #f4f1f7;
  --card: #ffffff;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ok: #2e7d4f;
  --ok-soft: #e7f5ec;
  --warn: #b26a00;
  --warn-soft: #fff1dc;
  --shadow: 0 1px 2px rgba(45, 17, 71, .06), 0 10px 24px -14px rgba(45, 17, 71, .28);
  --shadow-lg: 0 24px 50px -24px rgba(45, 17, 71, .45);
  --r: 16px;
  --f-display: 'Montserrat', 'Avenir Next', 'Segoe UI', sans-serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--purple-2); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 800; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { font: 700 .7rem/1.2 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--purple-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Barra superior con el logo ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 4px solid var(--gold); }
.topbar .in { max-width: var(--maxw, 1080px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, env(safe-area-inset-left, 0px)); min-height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.brand img { height: 38px; width: auto; }
.brand .app { font: 700 .72rem/1.15 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line-2); }
@media (max-width: 420px) { .brand .app { display: none; } }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--purple); color: #fff; font: 800 .8rem/1 var(--f-display); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who .nm { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
@media (max-width: 560px) { .who .nm { display: none; } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--purple); color: #fff; font: 700 .95rem/1 var(--f-display); letter-spacing: .01em; text-decoration: none; box-shadow: 0 10px 20px -12px rgba(87, 33, 138, .9); transition: background .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: #4a1c76; }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #b8a9c9; box-shadow: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.block { width: 100%; }
.btn.gold { background: var(--gold); color: var(--purple-deep); box-shadow: 0 10px 20px -12px rgba(178, 106, 0, .8); }
.btn.gold:hover { background: #e9a710; }
.btn.ghost { background: #fff; color: var(--purple); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost:hover { background: var(--purple-soft); }
.btn.danger { background: #fff; color: var(--danger); box-shadow: inset 0 0 0 1.5px #f1c4bf; }
.btn.danger.confirm, .btn.danger:hover { background: var(--danger); color: #fff; box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .84rem; border-radius: 10px; }
.iconbtn { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 0; border-radius: 12px; background: #fff; color: var(--purple); box-shadow: inset 0 0 0 1.5px var(--line); }
.iconbtn svg { width: 20px; height: 20px; }
.textlink { border: 0; background: none; padding: 4px 2px; color: var(--purple-2); font-weight: 600; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Campos ---------- */
.field { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; font: 400 1rem/1.4 var(--f-body); color: var(--ink); letter-spacing: 0; transition: border-color .15s, box-shadow .15s; }
.field::placeholder { color: #9a93a3; }
.field:focus { outline: none; border-color: var(--purple-2); box-shadow: 0 0 0 4px rgba(123, 61, 176, .14); }
textarea.field { min-height: 120px; resize: vertical; line-height: 1.5; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2357218a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.lbl { display: grid; gap: 7px; font: 700 .8rem/1.2 var(--f-display); color: var(--purple-deep); letter-spacing: .01em; }
.lbl .opt { font: 500 .78rem var(--f-body); color: var(--muted); }
.help { font: 400 .82rem/1.4 var(--f-body); color: var(--muted); }
.err { color: var(--danger); font-size: .88rem; min-height: 1.2em; }

/* Control segmentado (Sí / No, severidad) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: #ebe5f1; }
.seg button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; font: 700 .9rem/1 var(--f-display); color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--purple); box-shadow: 0 2px 6px rgba(45, 17, 71, .14); }
.seg.dev button[data-v="si"][aria-pressed="true"] { background: var(--danger); color: #fff; }
.seg.dev button[data-v="no"][aria-pressed="true"] { background: var(--ok); color: #fff; }
.seg.sev button[data-v="baja"][aria-pressed="true"] { background: var(--gold-soft); color: var(--warn); }
.seg.sev button[data-v="media"][aria-pressed="true"] { background: var(--warn); color: #fff; }
.seg.sev button[data-v="alta"][aria-pressed="true"] { background: var(--danger); color: #fff; }

/* Chips de filtro */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--purple-deep); font: 600 .84rem/1 var(--f-body); }
.chip small { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--purple); color: #fff; box-shadow: none; }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .75); }

/* ---------- Tarjetas y etiquetas ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font: 700 .7rem/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.dev { background: var(--danger-soft); color: var(--danger); }
.badge.dev.media { background: var(--warn-soft); color: var(--warn); }
.badge.dev.baja { background: var(--gold-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.st-nuevo { background: var(--purple-soft); color: var(--purple); }
.badge.st-revisado { background: #e6f0fb; color: #1f5f9e; }
.badge.st-informe { background: var(--gold-soft); color: #8a5a00; }
.badge.st-descartado { background: #eeeeee; color: #6b6b6b; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 .78rem/1.2 var(--f-body); color: var(--purple); }
.tag svg { width: 15px; height: 15px; flex: none; }

/* Miniaturas */
.play { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px 3px 5px; border-radius: 99px; background: rgba(20, 8, 32, .78); color: #fff; font: 700 .68rem/1 var(--f-body); font-variant-numeric: tabular-nums; }
.play::before { content: ""; border-left: 7px solid #fff; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; margin-left: 2px; }

/* ---------- Visor ---------- */
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(20, 8, 32, .94); display: grid; grid-template-rows: auto 1fr auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.lb .lbtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; }
.lb .lbtop span { font-size: .88rem; opacity: .85; font-variant-numeric: tabular-nums; }
.lb .lbstage { display: grid; place-items: center; min-height: 0; padding: 0 12px; position: relative; }
.lb .lbstage > img, .lb .lbstage > video { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 8px; background: #000; }
.lb .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.lb .nav svg { width: 22px; height: 22px; }
.lb .nav.prev { left: 12px; } .lb .nav.next { right: 12px; }
.lb .lbcap { padding: 12px 16px 18px; color: #fff; text-align: center; font-size: .9rem; opacity: .9; }
.lb .x { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }

/* ---------- Avisos ---------- */
.demo-banner { position: relative; z-index: 40; background: var(--gold); color: var(--purple-deep); text-align: center; font: 600 .82rem/1.35 var(--f-body); padding: 8px 16px; }
.demo-banner button { margin-left: 8px; border: 0; border-radius: 99px; padding: 5px 12px; background: var(--purple); color: #fff; font: 700 .76rem/1 var(--f-display); vertical-align: 1px; }
.demo-banner button:disabled { opacity: .6; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 90; max-width: min(92vw, 460px); padding: 13px 18px; border-radius: 12px; background: var(--purple-deep); color: #fff; font-weight: 500; font-size: .92rem; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

/* ---------- Acceso ---------- */
.gate { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 30px 16px 60px; }
.gate .box { width: 100%; max-width: 420px; padding: 34px 28px 28px; display: grid; gap: 16px; text-align: center; justify-items: center; }
.gate .box img.logo { width: 210px; }
.gate h1 { font-size: 1.5rem; color: var(--purple-deep); }
.gate .box p { color: var(--muted); }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; font: 700 .98rem/1 var(--f-display); color: var(--ink); transition: background .15s, border-color .15s; }
.gbtn:hover { background: #faf8fc; border-color: var(--purple-2); }
.gbtn svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
