/* Neuralgate
   Paleta: papel #F1F3F8, tinta #0F1B33, cobalto #2346D8 (acciones), ámbar #F6A723 (nodos del logo).
   Tipografía: Bricolage Grotesque (SIL OFL), servida desde este mismo sitio. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f1f3f8;
  --ink: #0f1b33;
  --ink-soft: #46526b;
  --line: #cbd2df;
  --white: #ffffff;
  --cobalt: #2346d8;
  --cobalt-deep: #1a37b0;
  --amber: #f6a723;
  --ok: #17794b;
  --bad: #b4271f;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 28px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
p,
dl,
dd {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Piezas compartidas ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.pill:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--cobalt);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--cobalt-deep);
}

.btn--light {
  background: var(--white);
  color: var(--ink);
}

.btn--light:hover {
  background: #dfe5f2;
}

.btn:disabled,
.field:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.logo-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-node {
  fill: var(--amber);
  stroke: var(--ink);
  stroke-width: 3;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 16px var(--gutter) 20px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* ---------- Inicio e ingreso: el portal ---------- */

.top {
  padding: 20px var(--gutter);
}

.stage {
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 16px var(--gutter) 48px;
}

.gate {
  position: relative;
  display: grid;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px 999px 0 0;
}

/* El umbral: una línea de piso que cruza toda la pantalla. */
.gate::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 100vw;
  height: 2px;
  background: var(--ink);
  transform: translateX(-50%);
}

.gate--intro {
  width: min(62vw, 300px, 42vh);
  aspect-ratio: 3 / 4;
  place-items: center;
}

.gate--intro .logo {
  width: 48%;
}

.wordmark {
  margin-top: 28px;
  font-size: clamp(2.441rem, 8vw, 3.815rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.035em;
}

.gate--form {
  width: min(100%, 340px);
  padding: 56px 28px 32px;
  justify-items: stretch;
  align-content: start;
}

.gate--form .logo {
  width: 84px;
  justify-self: center;
  margin-bottom: 36px;
}

.gate--form :focus-visible {
  outline-color: var(--amber);
}

.gate-title {
  margin-bottom: 20px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.01em;
}

.field-label {
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.field {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
}

.field[aria-invalid="true"] {
  border-color: #ff8a80;
}

.field-error {
  margin-top: 10px;
  color: #ffc2bb;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.gate--form .btn {
  margin-top: 20px;
  min-height: 52px;
}

/* Único movimiento de la página: el logo se enciende al cargar. */
@media (prefers-reduced-motion: no-preference) {
  .gate--intro .logo-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw 1.2s 0.15s ease-in-out forwards;
  }

  .gate--intro .logo-node {
    transform-box: fill-box;
    transform-origin: center;
    animation: light 0.28s ease-out both;
  }

  .gate--intro .n1 { animation-delay: 0.1s; }
  .gate--intro .n2 { animation-delay: 0.5s; }
  .gate--intro .n3 { animation-delay: 1s; }
  .gate--intro .n4 { animation-delay: 1.35s; }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes light {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
}

/* ---------- Páginas internas ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 10px;
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-gate {
  display: grid;
  place-items: center;
  width: 30px;
  height: 38px;
  border-radius: 15px 15px 0 0;
  background: var(--ink);
  color: var(--paper);
}

.brand-gate .logo {
  width: 22px;
}

.brand span:last-child {
  padding-bottom: 3px;
}

.panel {
  width: min(100% - 2 * var(--gutter), 520px);
  margin: clamp(32px, 7vh, 72px) auto 64px;
}

.panel h1 {
  font-size: clamp(1.75rem, 5vw, 2.441rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 46ch;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 1.0625rem;
}

.lead strong {
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
}

.notice {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: 8px;
}

.notice--bad {
  border-left: 4px solid var(--bad);
  background: #fbe9e7;
  color: #7a1a14;
}

/* Montos: una columna tipo libro contable, con las cifras alineadas a la derecha. */
.amounts {
  margin: 32px 0 28px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  min-inline-size: 0;
}

.amount {
  display: grid;
  grid-template-columns: 24px auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.amount:hover {
  background: rgba(255, 255, 255, 0.6);
}

.amount input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
}

.amount input::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cobalt);
  transform: scale(0);
  transition: transform 0.12s ease-out;
}

.amount input:checked {
  border-color: var(--cobalt);
}

.amount input:checked::before {
  transform: scale(1);
}

.amount input:focus-visible {
  outline-offset: 4px;
}

.amount-cur {
  color: var(--ink-soft);
  font-size: 1.25rem;
}

.amount-num {
  justify-self: end;
  font-size: clamp(1.563rem, 6vw, 1.953rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.amount:has(input:checked) {
  background: var(--white);
  box-shadow: inset 4px 0 0 var(--cobalt);
}

.amount:has(input:checked) .amount-num {
  font-weight: 700;
}

.cta {
  width: 100%;
}

/* El botón nombra el monto elegido (sin JavaScript). */
.cta-pick {
  display: none;
}

form:has(#monto-0:checked) .cta-pick-0,
form:has(#monto-1:checked) .cta-pick-1,
form:has(#monto-2:checked) .cta-pick-2,
form:has(#monto-3:checked) .cta-pick-3,
form:has(#monto-4:checked) .cta-pick-4,
form:has(#monto-5:checked) .cta-pick-5,
form:has(#monto-6:checked) .cta-pick-6,
form:has(#monto-7:checked) .cta-pick-7 {
  display: inline;
}

form:has(.amount input:checked) .cta-default {
  display: none;
}

/* Estado del pago */
.mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 28px 28px 0 0;
  background: var(--ink);
}

.mark svg {
  width: 44px;
  fill: none;
  stroke: var(--white);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark--ok {
  background: var(--ok);
}

.mark--bad {
  background: var(--bad);
}

.facts {
  margin: 28px 0 32px;
  border-top: 1px solid var(--line);
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--ink-soft);
}

.facts dd {
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.panel--status .lead + .btn {
  margin-top: 28px;
}

@media (prefers-reduced-motion: reduce) {
  .amount input::before {
    transition: none;
  }
}
