:root {
  --ink: #0f1b2d;
  --ink-soft: #1b2a41;
  --text-on-ink: #f2f5f9;
  --muted-on-ink: #b9c4d3;
  --paper: #f4f6f9;
  --line: #cfd6e0;
  --text: #0f1b2d;
  --muted: #4d5b70;
  --stamp: #2547d0;
  --stamp-hover: #1c39a8;
  --highlight: #ffd84d;
  --error: #b42318;
  --focus: #2547d0;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.layout {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(380px, 5fr) 6fr;
}

/* ---- Formulario ---------------------------------------------------------------------------- */
.access {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px clamp(24px, 6vw, 72px);
}
.access__inner { width: 100%; max-width: 380px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 0 48px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { display: block; }

h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 750; }
.access__lead { margin: 0 0 32px; color: var(--muted); font-size: 16px; line-height: 1.5; }

.field { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid #aeb8c6;
  border-radius: 8px;
}
input:hover { border-color: #8593a6; }
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[aria-invalid='true'] { border-color: var(--error); }

.field__password { position: relative; }
.field__password input { padding-right: 84px; }
.ghost {
  position: absolute;
  top: 5px;
  right: 5px;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--stamp);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.ghost:hover { background: #e8edfb; }
.ghost:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }

.form-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--error);
  background: #fdecea;
  border-left: 3px solid var(--error);
  border-radius: 4px;
}

.primary {
  width: 100%;
  height: 48px;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  color: #fff;
  background: var(--stamp);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.primary:hover { background: var(--stamp-hover); }
.primary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.primary:disabled { opacity: 0.7; cursor: progress; }

.access__help { margin: 24px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.credit { margin: 56px 0 0; font-size: 13px; color: var(--muted); }

/* ---- Panel de presentación ------------------------------------------------------------------ */
.showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(24px, 5vw, 72px);
  color: var(--text-on-ink);
  background: radial-gradient(120% 90% at 20% 10%, #1d3150 0%, var(--ink) 60%);
}
.showcase__inner { width: 100%; max-width: 520px; }
.scene { display: block; width: 100%; max-height: 52vh; margin: 0 auto 32px; overflow: visible; }

h2 { margin: 0 0 18px; font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
.legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.legend li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; font-size: 15px; line-height: 1.5; color: var(--muted-on-ink); }
.legend strong { color: var(--text-on-ink); font-weight: 650; }
.legend__mark { width: 26px; height: 18px; margin-top: 3px; border-radius: 3px; }
.legend__mark--ocr { background: var(--highlight); }
.legend__mark--stamp { border: 2.5px solid #7f9bff; border-radius: 5px; transform: rotate(-8deg); }
.legend__mark--cover { background: #f2f5f9; }

/* ---- Animación de entrada (una sola secuencia) ---------------------------------------------- */
.scene__band, .scene__cover, .scene__stamp { transform-box: fill-box; }
.scene__band { transform-origin: left center; animation: sweep 0.7s 0.25s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.scene__cover { transform-origin: left center; animation: sweep 0.45s 0.95s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.scene__stamp { transform-origin: center; animation: stamp 0.55s 1.45s cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }

@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes stamp {
  from { opacity: 0; transform: translateY(-26px) scale(1.5); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scene__band, .scene__cover, .scene__stamp { animation: none; }
}

/* ---- Pantallas angostas --------------------------------------------------------------------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .access { padding: 28px 24px 24px; }
  .brand { margin-bottom: 32px; }
  .showcase { padding: 32px 24px; }
  .scene { display: none; }
}
