@font-face { font-family: "Agenor"; src: url("/static/fonts/Agenor-Bold.ttf") format("truetype"); font-weight: 700; }
@font-face { font-family: "Isidora Sans"; src: url("/static/fonts/IsidoraSans-Regular.ttf") format("truetype"); font-weight: 400; }
@font-face { font-family: "Isidora Sans"; src: url("/static/fonts/IsidoraSans-Medium.ttf") format("truetype"); font-weight: 500; }
@font-face { font-family: "Isidora Sans"; src: url("/static/fonts/IsidoraSans-SemiBold.ttf") format("truetype"); font-weight: 600; }
@font-face { font-family: "Isidora Sans"; src: url("/static/fonts/IsidoraSans-Bold.ttf") format("truetype"); font-weight: 700; }

:root {
  --bg: #fff; --wash: #f3f6fa; --ink: #0e1a2b; --ink-2: #3d4a5c; --muted: #6f7b8b; --line: #dfe5ee; --line-2: #e9edf3;
  --blue: #0074c5; --blue-ink: #005a9a; --indigo: #4763ea; --green: #1f8a4c; --red: #d0342c;
  --head: "Agenor", sans-serif; --body: "Isidora Sans", -apple-system, "Segoe UI", sans-serif; --mono: "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(14,26,43,.06), 0 8px 24px rgba(14,26,43,.06);
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { font-family: var(--body); font-weight: 700; letter-spacing: -.03em; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; } .mono { font-family: var(--mono); font-size: .92em; }

/* ---------- escenografía: planos de la M ---------- */
.scene { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.scene i { position: absolute; display: block; animation: drift 14s ease-in-out infinite alternate; }
.scene .p1 { left: 58%; top: -10%; width: 34vw; height: 120vh; background: var(--blue); clip-path: polygon(0 0,100% 0,62% 100%,0 100%); opacity: .16; }
.scene .p2 { left: 70%; top: -10%; width: 30vw; height: 120vh; background: var(--ink); clip-path: polygon(0 0,100% 0,100% 100%,38% 100%); opacity: .10; animation-delay: -5s; }
.scene .p3 { left: 84%; top: 30%; width: 22vw; height: 80vh; background: var(--blue); clip-path: polygon(0 0,100% 0,60% 100%,0 100%); opacity: .26; animation-delay: -9s; }
@keyframes drift { from { transform: translateY(-14px) skewX(0); } to { transform: translateY(18px) skewX(-1.5deg); } }
body.wide .scene { opacity: .35; }
@media (prefers-reduced-motion: reduce) { .scene i { animation: none; } }

/* ---------- carril de pasos ---------- */
.rail { position: fixed; left: 40px; top: 0; bottom: 0; width: 2px; background: var(--line-2); z-index: 3; }
.rail b { position: absolute; left: 0; top: 0; width: 2px; height: 0; background: var(--blue); transition: height .7s var(--ease); }
.rail span { position: absolute; left: -7px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #cfd8e3; transition: background .3s, border-color .3s; transform: translateY(-50%); cursor: pointer; }
.rail span.on { border-color: var(--blue); background: var(--blue); }
.rail span.cur { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--blue); }

/* ---------- barra superior ---------- */
.top { position: fixed; top: 20px; left: 72px; right: 40px; display: flex; justify-content: space-between; align-items: center; z-index: 4; }
.top img { height: 30px; display: block; }
.top nav { display: flex; gap: 22px; align-items: center; color: var(--ink-2); font-size: 15px; }
.top nav a { color: inherit; } .top nav a:hover { color: var(--blue); }
.top nav button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }

/* ---------- wizard ---------- */
.wizard { position: relative; }
.q { position: absolute; inset: 0; opacity: 0; pointer-events: none; transform: translateY(30px); transition: opacity .5s ease, transform .5s var(--ease); }
.q.active { position: relative; opacity: 1; pointer-events: auto; transform: none; }
.q-in { position: relative; max-width: 640px; margin: 0 0 0 clamp(96px, 14vw, 220px); padding: clamp(96px, 14vh, 150px) 24px 90px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.q.wide .q-in { max-width: none; margin-right: clamp(40px, 6vw, 120px); justify-content: flex-start; padding-top: 110px; }
.k { font: 700 13px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--blue); display: flex; align-items: center; gap: 10px; }
.k:after { content: ""; width: 40px; height: 2px; background: var(--blue); }
.q-title { font: 700 clamp(30px, 4.6vw, 54px)/1.06 var(--body); letter-spacing: -.03em; margin: 16px 0 0; max-width: 16ch; }
.q.wide .q-title { max-width: none; }
.q-title em { font-style: normal; color: var(--blue); }
.q-title .w { display: inline-block; }
.q.active .q-title .w > span { display: inline-block; opacity: 0; transform: translateY(22px); animation: up .7s var(--ease) forwards; }
@keyframes up { to { opacity: 1; transform: none; } }
.q-desc { color: var(--ink-2); font-size: 19px; margin: 16px 0 0; max-width: 48ch; }
.q-body { margin-top: 32px; }
.q-actions { display: flex; align-items: center; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 14px; } .hint kbd { font-family: inherit; font-weight: 600; color: var(--ink-2); }

/* botones */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 17px/1 var(--body); padding: 15px 24px; border-radius: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--blue-ink); border-color: var(--blue-ink); } .btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { background: var(--wash); border-color: #b9c6d6; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.sm { padding: 10px 16px; font-size: 15px; }

/* opciones A/B/C */
.choices { display: grid; gap: 10px; max-width: 480px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font: inherit; text-align: left; color: var(--ink); transition: border-color .15s, transform .15s; }
.choice:hover { border-color: #b9c6d6; transform: translateX(4px); }
.choice.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .key { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; font: 700 12px var(--head); color: var(--muted); }
.choice.on .key { background: var(--ink); color: #fff; border-color: var(--ink); }
.choice .label { flex: 1; font-weight: 500; }
.choice .logo { height: 26px; max-width: 110px; object-fit: contain; opacity: .9; }
.choice.on .logo { opacity: 1; }

/* campos */
input[type=text], input[type=email], input[type=password], input[type=number] { font: inherit; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); outline: none; transition: border-color .15s; }
input:focus { border-bottom-color: var(--blue); } input::placeholder { color: #a7b1be; }
.field { margin-bottom: 18px; } .field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 2px; }
.field input[type=number] { max-width: 160px; }

.pw-wrap { position: relative; } .pw-wrap input { padding-right: 36px; }
.eye { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); }
.eye:hover, .eye.on { color: var(--blue); } .eye svg { width: 20px; height: 20px; display: block; }

/* zona de archivo */
.drop { display: block; border: 1px dashed #b9c6d6; border-radius: 8px; padding: 34px 24px; text-align: center; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--wash); }
.drop input { display: none; }
.drop svg { width: 28px; height: 28px; color: var(--blue); display: block; margin: 0 auto 10px; }
.drop b { display: block; font-weight: 600; } .drop span { color: var(--muted); font-size: 14px; }
.drop.has { border-style: solid; border-color: var(--ink); }

/* cifras */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.fig { background: var(--wash); border-radius: 8px; padding: 18px 18px 16px; position: relative; overflow: hidden; }
.fig.focus { background: var(--ink); color: #fff; } .fig.focus small { color: #b7c3d3; }
.fig b { display: block; font: 700 36px/1 var(--body); letter-spacing: -.03em; }
.fig small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.3; }
dl.kv { margin: 0; display: grid; grid-template-columns: auto auto; gap: 8px 26px; font-size: 17px; color: var(--ink-2); width: max-content; max-width: 100%; }
dl.kv.four { grid-template-columns: auto auto auto auto; }
dl.kv dt { font-weight: 600; color: var(--ink); } dl.kv dd { margin: 0; }
.bar { height: 8px; background: var(--line-2); margin-top: 28px; display: flex; overflow: hidden; border-radius: 2px; max-width: 560px; }
.bar i { display: block; height: 100%; transform-origin: left; }
.q.active .bar i { animation: grow 1.1s .3s var(--ease) both; } .q.active .bar i + i { animation-delay: .7s; }
.bar .co { background: var(--blue); } .bar .fo { background: var(--indigo); } .bar .mem { background: var(--ink-2); }
@keyframes grow { from { transform: scaleX(0); } }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* medallón con anillo */
.anchor { position: fixed; right: 11vw; top: 50%; transform: translateY(-50%); z-index: 1; background: #fff; border-radius: 50%; padding: 26px; box-shadow: 0 30px 60px -20px rgba(14,26,43,.25); --rs: min(22vw, 300px); --rf: clamp(52px, 5.4vw, 78px); opacity: 0; }
.q.active .anchor { animation: pop .8s .1s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(.8); } to { opacity: 1; transform: translateY(-50%); } }
.ring { position: relative; width: var(--rs); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 14; }
.ring .t { stroke: var(--line-2); }
.ring .co, .ring .fo, .ring .mem { stroke-dasharray: 1131; stroke-dashoffset: 1131; }
.ring .co { stroke: var(--blue); } .ring .fo { stroke: var(--indigo); } .ring .mem { stroke: var(--ink-2); }
.q.active .ring .co { animation: dash 1.4s .2s var(--ease) forwards; }
.q.active .ring .fo { animation: dash 1.4s .8s var(--ease) forwards; }
.q.active .ring .mem { animation: dash 1.4s 1.2s var(--ease) forwards; }
@keyframes dash { to { stroke-dashoffset: var(--to); } }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .c b { font: 700 var(--rf)/1 var(--body); letter-spacing: -.05em; }
.ring .c span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }

/* instrucciones */
.howto { counter-reset: h; margin: 22px 0 0; padding: 0; list-style: none; }
.howto li { position: relative; padding: 10px 0 10px 40px; color: var(--ink-2); }
.howto li::before { counter-increment: h; content: counter(h); position: absolute; left: 0; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px var(--head); display: grid; place-items: center; }
.howto b { color: var(--ink); font-weight: 600; }

/* etiquetas sólidas */
.tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 3px 9px; border-radius: 4px; background: #e8edf4; color: #475467; }
.tag.blue { background: var(--blue); color: #fff; } .tag.indigo { background: var(--indigo); color: #fff; }
.tag.green { background: var(--green); color: #fff; } .tag.red { background: var(--red); color: #fff; } .tag.ink { background: var(--ink); color: #fff; }

/* tabla */
table { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
th { text-align: left; font: 700 11px var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: var(--wash); }
.who { display: flex; align-items: center; gap: 12px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff; flex: none; }
.who .t { font-size: 13px; color: var(--muted); }

/* avisos */
.note { padding: 14px 16px; border-radius: 6px; background: var(--wash); color: var(--ink-2); border-left: 3px solid var(--blue); }
.note.red { border-left-color: var(--red); }
.flash { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 10px 16px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: var(--shadow); }
.flash.error { background: var(--red); }

/* navegación */
.navi { position: fixed; right: 28px; bottom: 28px; display: flex; gap: 2px; z-index: 4; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
.navi button { width: 42px; height: 40px; border: 0; background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; }
.navi button:disabled { background: #c5cdd8; cursor: default; }
.navi svg { width: 18px; height: 18px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .brand { background: var(--blue); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .brand i { position: absolute; display: block; }
.login .brand .b1 { left: 55%; top: -10%; width: 40%; height: 120%; background: #fff; opacity: .08; clip-path: polygon(0 0,100% 0,62% 100%,0 100%); }
.login .brand .b2 { left: 72%; top: -10%; width: 40%; height: 120%; background: var(--ink); opacity: .18; clip-path: polygon(0 0,100% 0,100% 100%,38% 100%); }
.login .brand > * { position: relative; }
.login .brand img { height: 44px; width: auto; align-self: flex-start; }
.login .brand h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.06; max-width: 12ch; }
.login .brand p { color: #cfe4f6; font-size: 18px; max-width: 40ch; }
.login .form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login .form > div { width: 100%; max-width: 380px; }
.login .form h2 { font-size: 30px; margin-bottom: 26px; }

/* historial */
.runs { display: grid; }
.run { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); color: inherit; }
.run:hover .name { color: var(--blue); }
.run .name { font-weight: 600; font-size: 17px; } .run .meta { color: var(--muted); font-size: 14px; }
.run .pct { font: 700 22px/1 var(--body); text-align: right; letter-spacing: -.02em; }
.run .pct small { display: block; font: 500 13px var(--body); color: var(--muted); margin-top: 3px; }
.side { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.preview { margin-top: 22px; } .preview table td, .preview table th { padding: 7px 10px; }

@media (max-width: 900px) {
  .rail, .top nav .hide-sm { display: none; }
  .top { left: 20px; right: 20px; }
  .q-in, .q.wide .q-in { margin: 0; padding: 90px 20px 100px; max-width: none; }
  .q-title { max-width: none; }
  .anchor { position: static; transform: none; margin: 28px auto 0; padding: 0; box-shadow: none; background: none; width: max-content; }
  .q.active .anchor { animation: fade .6s var(--ease) both; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  .anchor .ring { --rs: 200px; --rf: 48px; }
  .login { grid-template-columns: 1fr; } .login .brand { min-height: 38vh; }
  .navi { right: 16px; bottom: 16px; }
  .btn { padding: 13px 18px; font-size: 16px; }
  .run { grid-template-columns: 1fr auto; } .run .pct { grid-column: 1 / -1; text-align: left; }
}

/* operación */
.badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; text-align: center; vertical-align: 2px; }
.badge.red { background: var(--red); } .badge.indigo { background: var(--indigo); }
.alert { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 8px; background: var(--wash); margin-bottom: 10px; border-left: 3px solid var(--ink-2); }
.alert.crit { border-left-color: var(--red); } .alert.warn { border-left-color: var(--indigo); }
.meter { margin-bottom: 18px; } .meter .mh { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; } .meter .mh span { color: var(--muted); }
.bar i.over { background: var(--red); }
.spark { display: flex; gap: 10px; align-items: flex-end; height: 140px; padding-top: 10px; }
.spark .col { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.spark .col i { display: block; width: 40%; border-radius: 3px 3px 0 0; min-height: 2px; }
.spark .col .c { background: var(--line); } .spark .col .p { background: var(--blue); }
.spark .col span { position: absolute; bottom: -22px; font-size: 11px; color: var(--muted); }
.spark + .legend { margin-top: 32px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 24px; max-width: 820px; }
select { font: inherit; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); width: 100%; }
tr.off td { opacity: .55; }
.inline-form { display: flex; gap: 8px; align-items: center; }
details.menu summary { cursor: pointer; color: var(--blue); list-style: none; } details.menu summary::-webkit-details-marker { display: none; }
.menu-body { display: grid; gap: 8px; margin-top: 8px; min-width: 220px; }
