/* Acceso C2 (maqueta docs/design-system/c2-acceso.html): entrar con el correo,
   el código, el enlace y la invitación. Selectores propios `.ac-*`: el layout
   `devise` no carga el armazón del panel.

   Los colores de marca llegan como variables en el <body> (Brand#panel_css_variables):
   --c2-navy, --c2-navy-hi, --color-primary, --color-on-primary, --c2-blue-tint.
   Ninguno se escribe aquí. Se restaura la tarjeta centrada anterior con el logotipo dentro,
   manteniendo el correo y el código. El acento del botón conserva contraste
   sobre blanco (Brand.darken_until). */

.ac-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c2-navy);
  -webkit-font-smoothing: antialiased;
}

.ac {
  --ac-bg: #f2f4f8;
  --ac-surface: #fff;
  --ac-ink: #0c1b33;
  --ac-ink-2: #546074;
  --ac-ink-3: #8591a2;
  --ac-line: #e3e7ee;
  --ac-ok: #39d28f;
  --ac-ok-ink: #1d7a4d;
  --ac-warn: #955b00;
  --ac-warn-tint: #fff1d8;
  --ac-urgent: #cf3a1e;
  --ac-urgent-ink: #8e2410;
  --ac-urgent-tint: #fcebe6;
  --ac-info-ink: #12306e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(32px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 36px 24px, rgb(255 255 255 / 2%) 0 6px, transparent 6px), radial-gradient(circle at 36px 42px, rgb(255 255 255 / 2%) 0 6px, transparent 6px), radial-gradient(circle at 18px 42px, rgb(255 255 255 / 2%) 0 6px, transparent 6px), linear-gradient(160deg, var(--c2-navy), color-mix(in srgb, var(--c2-navy) 70%, var(--color-primary)) 55%, color-mix(in srgb, var(--c2-navy) 50%, var(--color-primary)));
  background-size: 60px 60px, 60px 60px, 60px 60px, auto;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ac-ink);
  font: 16px/1.45 "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ac *, .ac *::before, .ac *::after { box-sizing: border-box; }
/* Los campos de escribir enseñan el foco en su caja (`.ac-input:focus-within`,
   `.ac-code:focus-within`), nunca con un rectángulo dentro: el 2026-10-01 la
   regla alcanzaba a todo `input` y pintaba un cuadrado de 3 px dentro de la
   caja redonda de «Entra con tu correo». */
.ac a:focus-visible, .ac button:focus-visible, .ac input:is([type="checkbox"], [type="radio"]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* La misma tarjeta del acceso anterior, también en móvil. */
.ac-frame {
  width: min(100%, 448px);
  padding: 40px 32px;
  border-radius: 16px;
  background: var(--ac-surface);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 25%);
}
.ac-top { display: flex; justify-content: center; margin-bottom: 24px; }
.ac-mark { display: flex; justify-content: center; width: 100%; }
.ac-logo { display: block; width: auto; max-width: 100%; height: 80px; object-fit: contain; }
.ac-sheet { display: flex; flex-direction: column; }

.ac-h1 {
  margin: 0 0 6px;
  color: var(--ac-ink);
  font: 600 20px/1.4 "Hanken Grotesk", sans-serif;
  text-align: center;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.ac-sub { text-align: center; margin: 0 0 28px; color: var(--ac-ink-2); font-size: 15.5px; line-height: 1.5; }
.ac-sub b { color: var(--ac-ink); font-weight: 600; overflow-wrap: anywhere; }

.ac-form { display: flex; flex-direction: column; gap: 16px; }
.ac-field > label, .ac-field > .ac-label { display: block; margin: 0 0 6px; color: var(--ac-ink-2); font-size: 14px; font-weight: 600; }
.ac-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ac-surface);
  box-shadow: inset 0 0 0 2px var(--ac-line);
  color: var(--ac-ink);
  font-size: 16.5px;
}
.ac-input:focus-within { box-shadow: inset 0 0 0 2px var(--color-primary), 0 0 0 4px var(--c2-blue-tint); }
.ac-input.is-err { box-shadow: inset 0 0 0 2px var(--ac-urgent); }
.ac-input input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
}
.ac-input input::placeholder { color: var(--ac-ink-3); }
.ac-input.is-fixed { background: var(--ac-bg); box-shadow: none; font-weight: 600; overflow-wrap: anywhere; }
.ac-input.is-fixed svg { width: 18px; height: 18px; flex: none; color: var(--ac-ink-3); }
.ac-hint { margin: 6px 2px 0; color: var(--ac-ink-3); font-size: 13.5px; }
.ac-field-error { display: flex; gap: 6px; align-items: flex-start; margin: 8px 2px 0; color: var(--ac-urgent-ink); font-size: 14px; }

.ac-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  font: 600 16px/1.3 "Hanken Grotesk", sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.ac-btn svg { width: 19px; height: 19px; flex: none; }
.ac-btn--primary { background: var(--ac-action, var(--color-primary)); color: var(--ac-surface); transition: background-color .15s; }
.ac-btn--primary:hover { background: color-mix(in srgb, var(--ac-action, var(--color-primary)) 85%, black); }
.ac-btn--ghost { background: transparent; color: var(--ac-ink); box-shadow: inset 0 0 0 2px var(--ac-line); }
.ac-btn--text { min-height: 44px; background: transparent; color: var(--ac-ink-2); font-weight: 500; font-size: 15px; text-decoration: underline; }
.ac-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ac-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-primary);
  font: 600 14.5px/1.3 Figtree, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.ac-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ac-links form { margin: 0; }

.ac-foot { margin-top: auto; padding-top: 26px; color: var(--ac-ink-3); font-size: 13.5px; line-height: 1.5; text-align: center; }
.ac-foot b { color: var(--ac-ink-2); font-weight: 600; }

.ac-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; }
.ac-alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.ac-alert p { margin: 0; }
.ac-alert--error { background: var(--ac-urgent-tint); color: var(--ac-urgent-ink); }
.ac-alert--info { background: var(--c2-blue-tint); color: var(--ac-info-ink); }
.ac-alert--ok { background: #e3f6ec; color: var(--ac-ok-ink); }

.ac-sent { display: flex; gap: 12px; align-items: center; margin: 0 0 18px; padding: 12px 14px; border-radius: 16px; background: var(--ac-bg); }
.ac-sent p { margin: 0; color: var(--ac-ink-2); font-size: 14.5px; line-height: 1.4; }
.ac-sent b { display: block; color: var(--ac-ink); font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }

.ac-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; }
.ac-icon svg { width: 27px; height: 27px; }
.ac-icon--ok { background: var(--ac-ok); color: var(--c2-navy); }
.ac-icon--warn { background: var(--ac-warn-tint); color: var(--ac-warn); }
.ac-icon--mail { background: var(--c2-blue-tint); color: var(--color-primary); }
.ac-sent .ac-icon { width: 42px; height: 42px; margin: 0; }
.ac-sent .ac-icon svg { width: 21px; height: 21px; }

.ac-state { padding: 6px 2px 0; text-align: center; }
.ac-state .ac-h1 { margin-bottom: 8px; }
.ac-state .ac-sub { margin-bottom: 22px; }

.ac-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--ac-ink-3); font-size: 13.5px; }
.ac-or::before, .ac-or::after { content: ""; flex: 1; height: 1px; background: var(--ac-line); }

/* Seis casillas sobre UN solo campo: el teclado numérico, el autocompletado
   del código que ofrecen iOS y Android y pegarlo funcionan como en cualquier
   campo; las casillas solo lo pintan. */
.ac-code { position: relative; }
.ac-code input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  font-size: 16px;
  caret-color: transparent;
}
.ac-code-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; pointer-events: none; }
.ac-code-cells span {
  display: grid;
  place-items: center;
  height: 60px;
  border-radius: 14px;
  background: var(--ac-surface);
  box-shadow: inset 0 0 0 2px var(--ac-line);
  color: var(--ac-ink);
  font: 700 25px/1 Figtree, sans-serif;
  font-variant-numeric: tabular-nums;
}
.ac-code:focus-within .ac-code-cells span.is-next { box-shadow: inset 0 0 0 2px var(--color-primary), 0 0 0 4px var(--c2-blue-tint); }
.ac-code.is-err .ac-code-cells span { box-shadow: inset 0 0 0 2px var(--ac-urgent); color: var(--ac-urgent-ink); }

.ac-hello { padding: 14px 2px 0; text-align: center; }
.ac-avatar { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--c2-blue-tint); color: var(--color-primary); font-size: 21px; font-weight: 700; }
.ac-device { display: inline-flex; gap: 6px; align-items: center; margin: 0 0 22px; padding: 7px 12px; border-radius: 999px; background: var(--ac-bg); color: var(--ac-ink-2); font-size: 14px; }
.ac-device svg { width: 17px; height: 17px; flex: none; }

.ac-who { display: flex; gap: 12px; align-items: center; margin: 0 0 16px; }
.ac-who .ac-avatar { width: 48px; height: 48px; margin: 0; font-size: 16px; flex: none; }
.ac-who p { margin: 0; color: var(--ac-ink-2); font-size: 15.5px; line-height: 1.4; }
.ac-who b { color: var(--ac-ink); font-weight: 700; }
.ac-kv { margin: 0 0 18px; padding: 0; overflow: hidden; border-radius: 16px; background: var(--ac-bg); }
.ac-kv div { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 15px; }
.ac-kv div + div::before { content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px; background: var(--ac-line); }
.ac-kv dt { margin: 0; color: var(--ac-ink-2); white-space: nowrap; }
.ac-kv dd { margin: 0; min-width: 0; color: var(--ac-ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }

@media (min-width: 640px) {
  .ac { padding: 48px 24px; }
  .ac-frame { padding: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .ac *, .ac *::before, .ac *::after { transition: none !important; animation: none !important; }
}

/* Páginas del sistema (maqueta c2-sistema.html): el código que se dicta por
   teléfono en un 500. */
.ac-ref { font: 700 19px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; user-select: all; }
