:root {
  --bg: #0c0d12;
  --surface: #15171f;
  --surface-2: #1c1f2a;
  --border: #2a2e3b;
  --text: #eef0f6;
  --muted: #9097a8;
  --accent: #ff3d6e;
  --accent-2: #2fe0d8;
  --ok: #33d17a;
  --warn: #f5b83d;
  --bad: #ff5c5c;
  --radius: 16px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #ff3d6e14, transparent 60%),
    radial-gradient(900px 500px at -10% 10%, #2fe0d812, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }

.top { max-width: 1040px; margin: 0 auto; padding: 40px 16px 8px; }
.brand { display: flex; gap: 16px; align-items: center; }
.logo {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #0c0d12; font-size: 22px;
  box-shadow: -3px -3px 0 var(--accent-2) inset, 3px 3px 0 var(--accent) inset;
}
h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.brand p { margin: 2px 0 0; color: var(--muted); }

main { max-width: 1040px; margin: 0 auto; padding: 16px; display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.step-head h2 { margin: 0; font-size: 18px; }
.num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.num.done { background: var(--ok); color: #0c0d12; border-color: transparent; }
h3 { margin: 26px 0 12px; font-size: 15px; }

/* Zona de subida */
.drop {
  display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: 48px 16px;
  text-align: center; cursor: pointer; transition: .2s; background: var(--surface-2);
}
.drop:hover, .drop.over { border-color: var(--accent-2); background: #2fe0d80d; }
.drop-inner { display: grid; gap: 6px; justify-items: center; }
.drop-icon { font-size: 28px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #ffffff0a; margin-bottom: 6px; }
.drop span { color: var(--muted); font-size: 14px; }

/* Progreso */
.progress { margin-top: 16px; display: grid; gap: 8px; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; }
.progress-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress small { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar.big { height: 12px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .3s; }
.error { color: var(--bad); background: #ff5c5c14; border: 1px solid #ff5c5c40; padding: 10px 14px; border-radius: 10px; margin: 14px 0 0; }

/* Tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.spec { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.spec th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; background: var(--surface-2); }
.spec td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.spec td.val { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.spec td .note { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; font-family: Inter, sans-serif; white-space: normal; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: #33d17a18; }
.pill.warn { color: var(--warn); background: #f5b83d18; }
.pill.bad { color: var(--bad); background: #ff5c5c18; }
.compare td.after { color: var(--ok); }

.score { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.score b { font-size: 22px; color: var(--text); font-family: var(--mono); }

/* Opciones */
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin: 0; display: grid; gap: 8px; align-content: start; }
legend { padding: 0 6px; color: var(--muted); font-size: 12.5px; }
.opt { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: .15s; }
.opt:hover { background: var(--surface-2); }
.opt:has(input:checked) { background: var(--surface-2); border-color: var(--accent-2); }
.opt input { accent-color: var(--accent-2); margin-top: 3px; }
.opt span { display: grid; font-size: 12.5px; color: var(--muted); }
.opt b { color: var(--text); font-size: 14px; font-weight: 600; }

/* Botones */
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: 600 15px Inter, sans-serif; padding: 12px 20px; border-radius: 12px; cursor: pointer; text-decoration: none; text-align: center; transition: .15s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 24px #ff3d6e40; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.wide { display: block; width: 100%; }

/* Resultado */
.result { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.phone { aspect-ratio: 9 / 16; background: #000; border-radius: 28px; border: 6px solid #22252f; overflow: hidden; box-shadow: 0 20px 60px #0008; }
.phone video { width: 100%; height: 100%; object-fit: contain; display: block; }
.result-side { display: grid; gap: 14px; }
.tips { background: var(--surface-2); border-radius: 12px; padding: 14px 18px; font-size: 13.5px; }
.tips h4 { margin: 0 0 6px; }
.tips ul { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }
.tips b { color: var(--text); font-weight: 600; }

footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px 16px 40px; }

@media (max-width: 820px) {
  .options { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .phone { max-width: 280px; margin: 0 auto; width: 100%; }
  .score { margin-left: 0; width: 100%; }
}

/* ===== Botones de guía bajo la zona de subida ===== */
.guides { margin-top: 18px; }
.guides > p { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.guides-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.guide-card {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 14px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; transition: .15s;
}
.guide-card:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.guide-card b { display: block; font-size: 14px; }
.guide-card small { color: var(--muted); font-size: 12.5px; }
.gc-ic { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 12px; color: #0c0d12; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.gc-ic svg { width: 100%; height: 100%; display: block; }
.link { background: none; border: 0; color: var(--accent-2); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.tips-links { margin: 0 0 8px; color: var(--muted); }

/* ===== Ventana emergente ===== */
dialog#guide {
  width: min(1000px, calc(100vw - 24px)); height: min(760px, calc(100dvh - 24px)); padding: 0;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 30px 80px #000a; overflow: hidden;
}
dialog#guide[open] { display: flex; flex-direction: column; animation: g-in .22s ease-out; }
dialog#guide::backdrop { background: #05060acc; backdrop-filter: blur(4px); }
@keyframes g-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.g-head { display: flex; gap: 14px; align-items: center; padding: 16px 22px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.g-head-ic { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 12px; color: #0c0d12; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.g-head-ic svg { width: 100%; height: 100%; display: block; }
.g-head h2 { margin: 0; font-size: 18px; }
.g-head p { margin: 0; color: var(--muted); font-size: 13px; }
.g-close { margin-left: auto; flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }

.g-stepper { display: flex; gap: 4px; padding: 12px 22px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.g-stepper button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 500 12.5px Inter, sans-serif; cursor: pointer; text-align: left; }
.g-stepper button span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.g-stepper small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-stepper button.cur { color: var(--text); background: var(--surface-2); }
.g-stepper button.cur span { background: var(--accent); border-color: var(--accent); color: #fff; }
.g-stepper button.past span { background: var(--ok); border-color: var(--ok); color: #0c0d12; }

.g-scroll { flex: 1; overflow-y: auto; padding: 22px; overscroll-behavior: contain; }
.g-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.g-foot .btn { padding: 10px 18px; font-size: 14px; }
.g-foot .btn:disabled { cursor: default; opacity: .35; }

.g-step { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.g-step.solo { grid-template-columns: 1fr; }
.g-kicker { margin: 0 0 4px; color: var(--accent-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.g-copy h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.01em; }
.g-copy > p { margin: 0 0 12px; color: #c9cdd8; }
.g-copy b, .g-wide b { color: var(--text); }
.g-bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.g-bullets li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; color: #c9cdd8; }
.g-tip, .g-warn, .g-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.g-tip { background: #2fe0d80f; border: 1px solid #2fe0d830; }
.g-warn { background: #f5b83d12; border: 1px solid #f5b83d40; }
.g-note { color: var(--muted); padding: 0; }
.g-note a { color: var(--accent-2); }
.g-visual { position: sticky; top: 0; display: grid; gap: 8px; justify-items: center; }
.g-visual > small { color: var(--muted); font-size: 11.5px; text-align: center; }
.g-wide { grid-column: 1 / -1; }

.g-avoid { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: #ff5c5c0d; border: 1px solid #ff5c5c33; font-size: 12.5px; }
.g-avoid b { color: var(--bad); margin-right: 4px; }
.g-avoid span { display: inline-flex; align-items: center; gap: 5px; color: #e4c4c4; }
.g-avoid svg { width: 13px; height: 13px; color: var(--bad); }

.g-lan { display: flex; gap: 16px; align-items: center; margin-top: 12px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.g-qr { width: 150px; flex: none; background: #fff; border-radius: 12px; padding: 6px; }
.g-qr svg { display: block; width: 100%; height: auto; }
.g-lan code { display: block; font-family: var(--mono); font-size: 16px; color: var(--accent-2); margin: 4px 0 8px; word-break: break-all; }
.g-lan small { color: var(--muted); font-size: 12px; display: block; }

.g-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-choice-card { position: relative; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.g-choice-card.rec { border-color: var(--accent-2); }
.g-choice-card h5 { margin: 0 0 4px; font-size: 15px; }
.g-choice-card > p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.g-tag { position: absolute; top: -10px; right: 14px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #0c0d12; background: var(--accent-2); }
.g-ol { margin: 6px 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: #c9cdd8; }
.g-mini { display: grid; justify-items: center; transform-origin: top center; }
.g-mini .m-phone { width: 230px; }
.g-gb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.g-gb li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.g-gb li > span:last-child { display: grid; }
.g-gb small { color: var(--muted); font-size: 12px; }
.g-gb .ok { background: #33d17a0f; border: 1px solid #33d17a33; }
.g-gb .bad { background: #ff5c5c0d; border: 1px solid #ff5c5c33; }
.g-mark { width: 20px; height: 20px; padding: 3px; border-radius: 50%; flex: none; display: grid; }
.g-mark svg { width: 100%; height: 100%; }
.ok .g-mark { background: var(--ok); color: #0c0d12; }
.bad .g-mark { background: var(--bad); color: #fff; }
.g-next { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.g-next .btn { display: inline-flex; align-items: center; gap: 8px; }
.g-next svg { width: 18px; height: 18px; }

/* ===== Maquetas de interfaz ===== */
.m-n { position: absolute; left: -11px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 11px Inter, sans-serif; color: #fff; background: var(--accent); box-shadow: 0 0 0 3px #ff3d6e40; z-index: 1; }
.m-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 12px; }
.m-row.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.m-row.hl { background: #ff3d6e14; box-shadow: 0 0 0 1.5px var(--accent) inset; }
.m-label { color: #d5d8e0; }
.m-text { color: var(--muted); }
.m-opts { display: flex; gap: 3px; background: #ffffff0d; border-radius: 8px; padding: 3px; }
.m-opts span { flex: 1; text-align: center; padding: 4px 2px; border-radius: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.m-opts span.on { background: #fff; color: #0c0d12; font-weight: 700; }
.m-toggle { width: 34px; height: 20px; border-radius: 99px; background: #ffffff26; position: relative; flex: none; }
.m-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.m-toggle.on { background: var(--ok); }
.m-toggle.on::after { left: 16px; }
.m-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #ffffff55; display: grid; padding: 1px; flex: none; }
.m-check.on { background: #2b7fff; border-color: #2b7fff; color: #fff; }
.m-select, .m-input { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 120px; max-width: 60%; padding: 4px 8px; border-radius: 6px; background: #0b0c10; border: 1px solid #ffffff1f; color: #e8eaf0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-select i { font-style: normal; color: var(--muted); }

.m-phone { width: 250px; aspect-ratio: 9 / 18.5; border-radius: 38px; padding: 9px; background: #1d1f27; box-shadow: 0 0 0 1px #3a3e4c inset, 0 20px 50px #0009; position: relative; }
.m-island { position: absolute; top: 17px; left: 50%; transform: translateX(-50%); width: 78px; height: 22px; border-radius: 99px; background: #000; z-index: 2; }
.m-screen { height: 100%; border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(160deg, #3b2f5c, #1a3a4a 55%, #10131a); }
.m-appbar { position: absolute; top: 50px; left: 22px; color: #fff; font-size: 12px; font-weight: 600; }
.m-sheet { background: #1b1d24; border-radius: 22px 22px 0 0; padding: 14px 14px 18px 18px; display: grid; gap: 4px; }
.m-sheet-title { text-align: center; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.m-cta { position: relative; margin-top: 6px; text-align: center; padding: 10px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.m-cta.hl { box-shadow: 0 0 0 2px #fff inset; }
.m-cta .m-n { background: #fff; color: var(--accent); box-shadow: 0 0 0 3px #ffffff40; }

.m-window { width: 360px; border-radius: 12px; overflow: hidden; background: #1e2028; box-shadow: 0 0 0 1px #3a3e4c, 0 20px 50px #0009; }
.m-titlebar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #2a2d38; font-size: 11.5px; color: var(--muted); }
.m-titlebar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.m-titlebar i:nth-child(2) { background: #febc2e; }
.m-titlebar i:nth-child(3) { background: #28c840; }
.m-titlebar span { margin-left: 8px; font-weight: 600; color: #d5d8e0; }
.m-win-body { padding: 10px 12px 12px 20px; display: grid; gap: 8px; }
.m-section { display: grid; gap: 1px; }
.m-section + .m-section { border-top: 1px solid #ffffff12; padding-top: 6px; }
.m-section-name { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 2px 10px; }
.m-win-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.m-btn { position: relative; padding: 6px 14px; border-radius: 7px; background: #2b7fff; color: #fff; font-size: 11.5px; font-weight: 600; }
.m-btn.ghost { background: #ffffff14; color: #d5d8e0; }
.m-btn.hl { box-shadow: 0 0 0 2px var(--accent); }

@media (max-width: 820px) {
  .guides-row { grid-template-columns: 1fr; }
  dialog#guide { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .g-head, .g-scroll, .g-foot, .g-stepper { padding-left: 16px; padding-right: 16px; }
  .g-stepper small { display: none; }
  .g-stepper button { flex: none; }
  .g-stepper button.cur small { display: inline; }
  .g-step { grid-template-columns: 1fr; }
  .g-visual { position: static; }
  .g-choice { grid-template-columns: 1fr; }
  .g-lan { flex-direction: column; align-items: flex-start; }
  .g-copy h3 { font-size: 19px; }
  .m-window { width: 100%; max-width: 340px; }
}
.m-window.wide .m-label { flex: 1; }
.m-window .m-select, .m-window .m-input { flex: none; }

/* Variante Android: cámara perforada y bordes más rectos */
.m-phone.android { border-radius: 30px; }
.m-phone.android .m-screen { border-radius: 22px; }
.m-phone.android .m-island { width: 14px; height: 14px; top: 20px; }
