/* Jhus-Sign — "pase de firma": la página es un pase/certificado que se va sellando.
   Un único tema oscuro (lo pide la especificación); acento ámbar de lacre/sello. */
:root {
  --ink: #0d1117;          /* fondo */
  --paper: #151a22;        /* superficie del pase */
  --paper-2: #1b212b;      /* campos dentro del pase */
  --rule: #2a313c;         /* líneas y bordes */
  --fg: #ece8df;           /* texto, blanco cálido */
  --dim: #8a919d;          /* texto secundario */
  --seal: #e9a83b;         /* acento: sello/lacre */
  --seal-ink: #1c1405;     /* texto sobre el sello */
  --ok: #52c48c;
  --err: #ef6b6b;
  --warn: #e9c46a;

  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Instrument Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 10px;
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font: 400 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { font-family: var(--f-display); font-stretch: 118%; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.mono { font-family: var(--f-mono); font-size: 0.86em; letter-spacing: 0; }
.label {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dim);
}
.dim { color: var(--dim); }

/* --- botones ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 16px/1 var(--f-body); color: var(--fg); text-decoration: none;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px;
  padding: 13px 18px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: #3a4351; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.seal { background: var(--seal); border-color: var(--seal); color: var(--seal-ink); }
.btn.seal:hover { background: #f2b44c; }
.btn.block { width: 100%; padding: 17px 18px; font-size: 17px; }
.btn .arrow { font-family: var(--f-mono); font-weight: 500; }

input {
  font: 500 16px/1.2 var(--f-body); color: var(--fg); background: var(--ink);
  border: 1px solid var(--rule); border-radius: 8px; padding: 13px 14px; width: 100%; min-width: 0;
}
input::placeholder { color: #5d6470; }
input:focus { outline: none; border-color: var(--seal); }

.alert {
  border: 1px solid; border-radius: 8px; padding: 12px 14px; font-size: 14px;
  border-color: color-mix(in srgb, var(--err) 45%, transparent);
  background: color-mix(in srgb, var(--err) 12%, var(--ink)); color: #ffd0d0;
}
.alert.warn {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, var(--ink)); color: #f6e3b4;
}
.alert.ok {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, var(--ink)); color: #c8f0db;
}

/* ===================================================================== */
/* Página del invitado                                                    */
/* ===================================================================== */
.page {
  max-width: 460px; margin: 0 auto;
  padding-block: 20px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 16px;
}
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { font-family: var(--f-display); font-stretch: 125%; font-weight: 800; font-size: 19px; letter-spacing: 0.02em; }
.wordmark i { font-style: normal; color: var(--seal); }
.quota-chip {
  font-family: var(--f-mono); font-size: 12px; color: var(--dim);
  border: 1px solid var(--rule); border-radius: 99px; padding: 5px 10px; white-space: nowrap;
}
.quota-chip b { color: var(--fg); font-weight: 500; }

/* El pase */
.pass { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; position: relative; }
.pass-head { padding: 20px 20px 18px; display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: center; }
.pass-head .icon {
  width: 60px; height: 60px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--rule);
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--f-display); font-stretch: 125%; font-weight: 800; font-size: 22px; color: var(--seal);
}
.pass-head .icon img { width: 100%; height: 100%; object-fit: cover; }
.pass-head h1 { font-size: 21px; line-height: 1.15; font-weight: 750; }
.pass-head .meta { font-family: var(--f-mono); font-size: 12px; color: var(--dim); margin-top: 4px; }

/* perforación tipo talón */
.perf { position: relative; height: 0; border-top: 1px dashed var(--rule); margin: 0 18px; }
.perf::before, .perf::after {
  content: ""; position: absolute; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--rule);
}
.perf::before { left: -30px; clip-path: inset(0 0 0 50%); }
.perf::after { right: -30px; clip-path: inset(0 50% 0 0); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); margin: 18px 20px 0; border-radius: 8px; overflow: hidden; }
.field { background: var(--paper-2); padding: 10px 12px; min-width: 0; }
.field .v { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.field .v.mono { font-weight: 500; font-size: 13px; }
.field .v.empty { color: #59606c; font-weight: 400; }

/* Secuencia real de 3 pasos */
.steps { list-style: none; margin: 0; padding: 20px; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 0 14px; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { /* línea vertical entre pasos */
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 2px; background: var(--rule);
}
.step:last-child::before { display: none; }
.step .num {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--rule);
  display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; color: var(--dim);
  background: var(--paper);
}
.step h2 { font-size: 16px; font-weight: 700; line-height: 28px; color: var(--dim); }
.step .body { grid-column: 2; min-width: 0; }
.step.now .num { border-color: var(--seal); color: var(--seal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--seal) 18%, transparent); }
.step.now h2 { color: var(--fg); font-size: 19px; }
.step.done .num { background: var(--ok); border-color: var(--ok); color: var(--ink); font-weight: 700; }
.step.done .num span { display: none; }
.step.done .num::after { content: "✓"; font-family: var(--f-body); font-size: 14px; }
.step.done h2 { color: var(--fg); }
.step.done::before { background: var(--ok); }

.panel { display: grid; gap: 14px; padding-top: 10px; }
.panel p { margin: 0; font-size: 15px; color: var(--dim); max-width: 60ch; }
.howto { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--dim); counter-reset: h; }
.howto li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; counter-increment: h; }
.howto li::before { content: counter(h, lower-alpha) "."; font-family: var(--f-mono); color: var(--seal); }
.howto b { color: var(--fg); font-weight: 600; }
.path { font-family: var(--f-mono); font-size: 12.5px; color: var(--fg); background: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }

/* barra de firma */
.meter { display: grid; gap: 8px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.meter-top .pct { font-family: var(--f-mono); font-size: 13px; color: var(--seal); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--ink); border: 1px solid var(--rule); border-radius: 99px; overflow: hidden; }
.bar > div {
  height: 100%; width: 5%; background: var(--seal); border-radius: 99px; transition: width .9s ease;
  background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(0,0,0,.14) 6px 12px);
  background-size: 17px 17px; animation: crawl 1s linear infinite;
}
@keyframes crawl { to { background-position: 17px 0; } }
.stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.stage-list li { display: flex; gap: 10px; align-items: center; color: #5d6470; }
.stage-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.stage-list li.done { color: var(--dim); }
.stage-list li.done::before { background: var(--ok); border-color: var(--ok); }
.stage-list li.now { color: var(--fg); }
.stage-list li.now::before { border-color: var(--seal); background: var(--seal); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* sello de "firmado" */
.stamp {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--seal); border: 1.5px solid var(--seal); border-radius: 6px; padding: 6px 10px;
  transform: rotate(-2deg); animation: stamp .45s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes stamp { from { transform: rotate(-2deg) scale(1.6); opacity: 0; } }

.invite-form { display: grid; gap: 10px; }
.foot { font-family: var(--f-mono); font-size: 11px; color: #555c67; text-align: center; letter-spacing: .06em; }
