:root {
  --navy: #1d2c38; --navy2: #2b4a73; --cyan: #02afdd; --cyan-d: #0289ad; --cyan-l: #e6f7fc;
  --bg: #f3f6f9; --card: #ffffff; --ink: #1d2c38; --mut: #5b6b7a; --line: #d5dde6; --err: #c0392b; --ok: #1e9e5a; --warn: #fff4e0;
  --font: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); padding-bottom: 96px; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.hero { background: linear-gradient(120deg, var(--navy) 0%, var(--navy2) 100%); color: #fff; padding: 22px 0 34px; }
.hero-in { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.hero .logo { height: 55px; width: auto; }
.hero h1 { margin: 0; font-size: clamp(22px, 3.2vw, 34px); font-weight: 800; letter-spacing: .01em; }
.hero p { margin: 4px 0 0; opacity: .9; }
main { margin-top: -18px; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 14px; flex-wrap: wrap; }
.steps li { flex: 1 1 140px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-weight: 600; font-size: 13px; color: var(--mut); display: flex; align-items: center; gap: 8px; }
.steps li span { width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: #fff; display: inline-grid; place-items: center; font-size: 12px; }
.steps li.on { color: var(--ink); border-color: var(--cyan); }
.steps li.on span { background: var(--cyan); }
.steps li.done span { background: var(--ok); }
.card { background: var(--card); border-radius: 6px; box-shadow: 0 2px 14px rgba(29, 44, 56, .10); padding: 26px; margin-bottom: 16px; }
.card.center { text-align: center; padding: 44px 26px; }
h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; color: var(--cyan-d); }
h3 { margin: 0 0 6px; font-size: 18px; }
.muted { color: var(--mut); }
.banner { background: #fdecea; border-left: 4px solid var(--err); color: #7a1f16; padding: 12px 14px; border-radius: 4px; margin-bottom: 14px; font-weight: 500; }
.banner.info { background: var(--cyan-l); border-color: var(--cyan); color: var(--navy); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-top: 14px; }
.f { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.f.wide { grid-column: 1 / -1; }
.f > span { font-size: 14px; }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c3cfdb; border-radius: 4px; padding: 11px 12px; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .matrix-wrap:focus-visible { outline: 3px solid rgba(2, 175, 221, .35); border-color: var(--cyan); }
input.bad, select.bad, textarea.bad { border-color: var(--err); background: #fff7f6; }
.err-msg { color: var(--err); font-size: 12.5px; font-weight: 500; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.qty { display: flex; align-items: stretch; max-width: 190px; }
.qty button { width: 44px; border: 1px solid #c3cfdb; background: var(--cyan-l); color: var(--cyan-d); font-size: 22px; font-weight: 700; cursor: pointer; }
.qty button:first-child { border-radius: 4px 0 0 4px; } .qty button:last-child { border-radius: 0 4px 4px 0; }
.qty input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 4px; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--cyan); flex: none; }
.actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.btn { font: inherit; font-weight: 700; background: var(--cyan); color: #fff; border: 0; border-radius: 4px; padding: 12px 22px; cursor: pointer; min-height: 44px; transition: background .15s; }
.btn:hover { background: var(--cyan-d); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--cyan-d); border: 1px solid var(--cyan); }
.btn.ghost:hover { background: var(--cyan-l); }
.btn.sm { padding: 6px 10px; min-height: 32px; font-size: 12.5px; }
.tools { display: flex; gap: 10px; margin: 12px 0; }
/* Matriz */
.matrix-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 6px; max-height: 66vh; }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 820px; font-size: 13px; }
.matrix th, .matrix td { padding: 10px 4px; border-bottom: 1px solid var(--line); text-align: center; background: #fff; }
.matrix thead th { position: sticky; top: 0; z-index: 3; background: #f0f5f9; vertical-align: top; min-width: 76px; }
.matrix .cam { position: sticky; left: 0; z-index: 2; text-align: left; font-weight: 700; min-width: 84px; padding-left: 10px; border-right: 1px solid var(--line); }
.matrix thead .cam { z-index: 4; }
.matrix th .fn { display: block; font-weight: 700; line-height: 1.25; }
.matrix th .pr { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--cyan-d); background: var(--cyan-l); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.matrix th .all { display: block; margin: 6px auto 0; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--cyan-d); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.matrix td input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--cyan); cursor: pointer; }
.matrix tr:hover td { background: #fafcfe; }
.matrix tr:hover td.cam { background: #fafcfe; }
.matrix .sub { font-weight: 700; white-space: nowrap; text-align: right; min-width: 92px; padding-right: 10px; }
.matrix .sub small { display: block; font-weight: 500; color: var(--mut); }
.matrix .act { min-width: 70px; padding-right: 8px; }
.site { margin-top: 16px; padding: 14px; border: 1px dashed var(--cyan); border-radius: 6px; background: var(--cyan-l); }
.site label { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.site input { width: 20px; height: 20px; accent-color: var(--cyan); }
/* Resumen */
.sum { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.sum th, .sum td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sum th { background: #f0f5f9; font-size: 12.5px; }
.sum .n { text-align: right; white-space: nowrap; }
.sum tfoot td { font-weight: 700; }
.sum tfoot tr.t td { border-top: 2px solid var(--ink); font-size: 16px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 12px 0; }
.kv div { font-size: 14px; } .kv b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.aviso { background: var(--warn); border-left: 4px solid #f59f00; padding: 12px 14px; border-radius: 4px; font-size: 13.5px; }
.ok-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 34px; display: grid; place-items: center; margin: 0 auto 12px; }
.code { font-size: 30px; font-weight: 800; color: var(--cyan-d); margin: 4px 0 12px; letter-spacing: .04em; }
/* Barra inferior */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--navy); color: #fff; z-index: 20; box-shadow: 0 -4px 18px rgba(0, 0, 0, .18); }
.bar-in { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.tot small { opacity: .75; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.tot-lines { display: flex; gap: 24px; flex-wrap: wrap; }
.tot-lines b { font-size: 20px; font-weight: 800; }
.tot-lines span { font-size: 12.5px; opacity: .85; }
.bar-btns { display: flex; gap: 10px; }
.bar .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .6); }
.bar .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
dialog { border: 0; border-radius: 8px; padding: 22px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); font: inherit; color: var(--ink); }
dialog::backdrop { background: rgba(29, 44, 56, .55); }
.copy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px 10px; margin: 12px 0; max-height: 260px; overflow: auto; }
.copy-list label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.copy-list input { width: 18px; height: 18px; accent-color: var(--cyan); }
.copy-list .all { grid-column: 1 / -1; font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.foot { margin-top: 24px; padding: 14px 0; color: var(--mut); font-size: 12.5px; }
[hidden] { display: none !important; }
@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .card { padding: 18px 14px; }
  .steps li { flex-basis: 100%; }
  .bar-in { gap: 8px; }
  .tot-lines b { font-size: 17px; }
  .bar-btns { width: 100%; } .bar-btns .btn { flex: 1; }
  body { padding-bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.embed-auto .bar { position: static; box-shadow: none; }
.embed-auto body, html.embed-auto body { padding-bottom: 0; }
.embed-auto .hero { display: none; }
.embed-auto main { margin-top: 12px; }
@media (max-width: 720px) {
  .hero { padding: 14px 0 26px; } .hero .logo { height: 42px; } .hero p { display: none; }
  .tot small { display: none; } .bar-in { padding-top: 8px; padding-bottom: 8px; }
  body { padding-bottom: 128px; }
}

/* Pasos 1 y 3: tarjeta centrada y legible; paso 2 (matriz) usa todo el ancho disponible */
#step1.card, #step3 .card { max-width: 1000px; margin-left: auto; margin-right: auto; }
#step2 .card { padding: 20px 14px; }
#step2 .card > h2, #step2 .card > p, #step2 .tools { padding: 0 8px; }
.matrix-wrap { max-height: 72vh; }
@media (max-width: 720px) { .wrap { padding: 0 12px; } #step2 .card { padding: 16px 8px; } }
