@font-face { font-family: Geist; src: url(geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url(permanent-marker.woff2) format("woff2"); font-display: swap; }
:root {
  color-scheme: light dark;
  --background: oklch(0.99 0.002 80);
  --muted-bg: oklch(0.965 0.003 75);
  --foreground: oklch(0.22 0.006 56);
  --muted-foreground: oklch(0.52 0.012 58);
  --card: oklch(1 0 0);
  --muted: oklch(0.965 0.003 75);
  --border: oklch(0.915 0.004 60);
  --input: oklch(0.89 0.005 60);
  --primary: oklch(0.52 0.09 190);
  --primary-foreground: oklch(0.99 0.01 190);
  --destructive: oklch(0.53 0.2 27);
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.17 0.004 60);
    --muted-bg: oklch(0.17 0.004 60);
    --foreground: oklch(0.95 0.003 75);
    --muted-foreground: oklch(0.69 0.01 60);
    --card: oklch(0.2 0.005 60);
    --muted: oklch(0.24 0.006 60);
    --border: oklch(1 0 0 / 9%);
    --input: oklch(1 0 0 / 14%);
    --primary: oklch(0.72 0.1 185);
    --primary-foreground: oklch(0.2 0.03 190);
    --destructive: oklch(0.68 0.18 25);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100svh; display: grid; place-items: center; padding: 16px;
  background: color-mix(in oklab, var(--muted-bg) 40%, var(--background));
  color: var(--foreground); font: 14px/1.5 Geist, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Tarjeta: estantería a la izquierda (desde 768px) y logo, título y formulario a la derecha. */
.card {
  width: 100%; max-width: 24rem; display: grid; overflow: hidden;
  background: var(--card); border-radius: 14px;
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px oklch(0 0 0 / 5%);
}
.art { display: none; position: relative; }
.art-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-bg { fill: var(--muted); }
.art-rack { fill: color-mix(in oklab, var(--foreground) 25%, transparent); }
@media (min-width: 768px) {
  .card { max-width: 48rem; grid-template-columns: 1fr 1fr; }
  .art { display: block; }
  .side { min-height: 28rem; padding: 32px; }
}
.side { display: flex; flex-direction: column; justify-content: center; gap: 32px; padding: 24px; }
header { display: grid; justify-items: center; gap: 12px; }
header img { width: 64px; height: 64px; display: block; }
h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
form { display: grid; gap: 24px; }
p { margin: 0; }
/* Etiqueta flotante: adentro del input vacío; al enfocar, escribir o autocompletar sube al borde y corta la línea. */
.field { position: relative; }
.field label {
  position: absolute; top: 0; left: 8px; padding: 0 4px; pointer-events: none;
  background: var(--card); color: var(--muted-foreground); transform-origin: left;
  translate: 0 calc(22px - 50%); transition: translate 200ms cubic-bezier(0.23, 1, 0.32, 1), scale 200ms cubic-bezier(0.23, 1, 0.32, 1), color 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.field input:focus + label, .field input:not(:placeholder-shown) + label, .field input:autofill + label { translate: 0 -50%; scale: 0.85; }
.field input:focus + label { color: var(--primary); }
input {
  width: 100%; height: 44px; padding: 0 12px; font: inherit; color: inherit; background: transparent;
  border: 1px solid var(--input); border-radius: 8px; outline: none;
  /* El borde también transiciona: al terminar la entrada el foco cae en Usuario y el cambio de color de golpe se notaba. */
  transition: border-color 200ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
/* El autocompletado pinta el fondo de azul y la etiqueta quedaría como un parche: la sombra interna lo tapa. */
input:autofill { box-shadow: inset 0 0 0 100px var(--card); -webkit-text-fill-color: var(--foreground); }
/* Sin zoom al enfocar en iOS. */
@media (pointer: coarse) { input { font-size: 16px; } }
input:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
input:autofill:focus-visible { box-shadow: 0 0 0 1px var(--primary), inset 0 0 0 100px var(--card); }
input[aria-invalid="true"] { border-color: var(--destructive); }
input[aria-invalid="true"]:focus-visible { border-color: var(--destructive); box-shadow: 0 0 0 1px var(--destructive); }
/* La misma sacudida que la app (index.css, --animate-shake): 200 ms, ±4 px. */
@keyframes shake { 20%, 60% { translate: -4px; } 40%, 80% { translate: 4px; } }
.shake { animation: shake 200ms cubic-bezier(0.23, 1, 0.32, 1); }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
button {
  height: 40px; font: inherit; font-weight: 500; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--primary); color: var(--primary-foreground);
  transition: scale 150ms cubic-bezier(0.23, 1, 0.32, 1);
}
button:active { scale: 0.97; }
button:disabled { opacity: 0.6; cursor: default; }
@media (prefers-reduced-motion: reduce) { button, .field label { transition: none; } }
/* Siempre ocupa su lugar: el margen negativo lo mete en el hueco entre contraseña y botón, así nada se mueve al aparecer (como en la app). */
[role="alert"] { margin: -22px 0; min-height: 20px; font-size: 14px; line-height: 20px; text-align: center; color: var(--destructive); }
/* Entrada: solo un fundido corto de opacidad, como en la app (animate-in fade-in-0 duration-fast). */
.card { animation: card-in 150ms cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes card-in { from { opacity: 0; } }
/* Links a términos y privacidad, al pie del formulario. */
.legal-links { text-align: center; font-size: 13px; color: var(--muted-foreground); }
.legal-links a { color: inherit; }
.legal-links a:hover { color: var(--foreground); }
/* "¿Olvidaste tu contraseña?": link chico bajo Entrar, como en la app (-mt-3 en el hueco del formulario). */
button.link {
  height: 32px; margin: -12px auto 0; padding: 0 8px; background: none; color: var(--muted-foreground);
  font-size: 13px; font-weight: 500; text-underline-offset: 4px;
}
button.link:hover { color: var(--foreground); text-decoration: underline; }
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Diálogo de recuperar la contraseña (ADR 0023). */
dialog {
  width: min(24rem, 100% - 32px); max-height: calc(100svh - 32px); padding: 24px; border: 0; border-radius: 14px;
  background: var(--card); color: var(--foreground); box-shadow: 0 0 0 1px var(--border), 0 10px 30px oklch(0 0 0 / 15%);
}
dialog[open] { animation: dialog-in 150ms cubic-bezier(0.23, 1, 0.32, 1); }
dialog::backdrop { background: oklch(0 0 0 / 50%); }
@keyframes dialog-in { from { opacity: 0; scale: 0.96; } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
dialog form { gap: 16px; }
dialog form[hidden] { display: none; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; text-align: center; }
.hint { margin-top: -8px; text-align: center; color: var(--muted-foreground); text-wrap: pretty; }
.hint strong { font-weight: 500; color: var(--foreground); overflow-wrap: anywhere; }
dialog [role="alert"] { margin: 0; min-height: 0; }
/* Vacío no ocupa lugar pero sigue en el árbol de accesibilidad: así el lector anuncia el error cuando aparece. */
dialog [role="alert"]:empty { margin-top: -16px; }
/* El código que llega por mail: cifras grandes y espaciadas; el padding extra compensa el espacio de la última. */
input.code { height: 48px; padding-left: calc(12px + 0.4em); text-align: center; font-size: 24px; font-weight: 500; letter-spacing: 0.4em; font-variant-numeric: tabular-nums; }
.field input.code + label { translate: 0 calc(24px - 50%); }
.field input.code:focus + label, .field input.code:not(:placeholder-shown) + label { translate: 0 -50%; }
.actions { display: flex; flex-direction: column-reverse; gap: 8px; }
@media (min-width: 640px) { .actions { flex-direction: row; justify-content: flex-end; } .actions button { padding: 0 16px; } }
button.secondary { background: transparent; color: var(--foreground); box-shadow: inset 0 0 0 1px var(--input); }
button.secondary:hover { background: var(--muted); }
