/* ============================================================
   login.css — ValdiviaLux v2.12
   Pantalla de ingreso con animación (diseño «Ingreso ValdiviaLux · Motion»).
   Se carga al final. Teléfono primero; tablet desde 640 px; PC en dos
   columnas desde 960 px. Sin recursos externos: la letra Jost se usa sólo
   si está instalada en el equipo, si no la del sistema.
   ============================================================ */

.auth-screen.lg {
  --lg-bg:#f5f3ef; --lg-panel:#ebe7e0; --lg-ink:#1c1c1e; --lg-mute:#625e57; --lg-line:#d6d1c7;
  --lg-field:#fbfaf8; --lg-alu:#e3e3e2; --lg-glass:#bfd9e3; --lg-on-ink:#f5f3ef; --lg-acc:#a8814b;
  position: fixed; inset: 0; z-index: 10000;
  display: block; padding: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--lg-bg); color: var(--lg-ink);
  font-family: Jost, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: opacity .3s ease;
}
.auth-screen.lg.lg-dark {
  --lg-bg:#141415; --lg-panel:#1c1c1f; --lg-ink:#ecebe8; --lg-mute:#a29e97; --lg-line:#36363c;
  --lg-field:#202023; --lg-alu:#2e2f31; --lg-glass:#4a6672; --lg-on-ink:#141415; --lg-acc:#c9a468;
}
.auth-screen.lg.lg-leave { opacity: 0; }
.lg *, .lg *::before, .lg *::after { box-sizing: border-box; }

/* ── Estructura (teléfono) ─────────────────────────────────── */
.lg-grid { display: flex; flex-direction: column; min-height: 100%; min-height: 100dvh; }
.lg-stage {
  position: relative; background: var(--lg-panel);
  padding: calc(18px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 16px max(24px, env(safe-area-inset-left));
  border-radius: 0 0 28px 28px;
  display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.lg-brand { display: flex; align-items: center; gap: 10px; }
.lg-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--lg-ink); color: var(--lg-on-ink);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; letter-spacing: .04em;
}
.lg-name { font-weight: 500; font-size: 17px; letter-spacing: .01em; }
.lg-art { width: 100%; height: auto; max-height: 26vh; max-height: 26dvh; display: block; margin: 0 auto; }
.lg-caption { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lg-tag { font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--lg-mute); }
.lg-words { position: relative; height: 40px; overflow: hidden; margin-top: 4px; }
.lg-word {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-weight: 300; font-size: 32px; line-height: 40px; letter-spacing: .02em;
  opacity: 0; animation: lg-word 9s infinite;
}
.lg-word:nth-child(2) { animation-delay: 3s; }
.lg-word:nth-child(3) { animation-delay: 6s; }
.lg-word em { font-style: normal; color: var(--lg-acc); }
.lg-bars { display: flex; gap: 6px; align-items: center; padding-bottom: 12px; }
.lg-bars i { display: block; height: 2px; width: 18px; background: var(--lg-mute); opacity: .35; animation: lg-bar 9s infinite; }
.lg-bars i:nth-child(2) { animation-delay: 3s; }
.lg-bars i:nth-child(3) { animation-delay: 6s; }

.lg-main {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 26px max(24px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.lg-form {
  width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  opacity: 0; animation: lg-rise .9s cubic-bezier(.2,.7,.2,1) .35s forwards;
}
.lg-h { margin: 0; font-weight: 300; font-size: 30px; line-height: 1.15; letter-spacing: .01em; color: var(--lg-ink); }
.lg-sub { margin: 6px 0 2px; font-size: 15px; line-height: 1.5; color: var(--lg-mute); }
.lg-field { display: flex; flex-direction: column; gap: 8px; }
.lg-label { font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--lg-mute); }
.lg-input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--lg-line); background: var(--lg-field); color: var(--lg-ink);
  font: 400 16px Jost, system-ui, -apple-system, "Segoe UI", sans-serif;   /* 16 px: iOS no acerca */
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.lg-input::placeholder { color: var(--lg-mute); opacity: .75; }
.lg-input:focus { border-color: var(--lg-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lg-acc) 35%, transparent); }
.lg-pw { position: relative; }
.lg-pw .lg-input { padding-right: 56px; }
.lg-eye {
  position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: var(--lg-mute); display: grid; place-items: center; cursor: pointer;
  touch-action: manipulation;
}
.lg-eye:hover { color: var(--lg-ink); }
.lg-eye:focus-visible { outline: 2px solid var(--lg-ink); outline-offset: -2px; }
.lg-btn {
  position: relative; overflow: hidden; margin-top: 6px; height: 54px; border: 0; border-radius: 999px;
  background: var(--lg-ink); color: var(--lg-on-ink); cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font: 500 13px Jost, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .2em; text-transform: uppercase;
}
.lg-btn svg { transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.lg-btn:hover svg { transform: translateX(5px); }
.lg-btn:focus-visible { outline: 3px solid var(--lg-acc); outline-offset: 3px; }
.lg-btn:disabled { cursor: wait; }
.lg-btn::after {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
  transform: translateX(-160%); animation: lg-sheen 6s 3.2s infinite;
}
.lg-btn.busy::after { animation-duration: 1.1s; animation-delay: 0s; }
.lg-msg { min-height: 20px; font-size: 14px; font-weight: 500; color: #b42318; }
.lg-dark .lg-msg { color: #f97066; }
.lg-msg:empty { min-height: 0; margin-top: -16px; }
.lg-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--lg-mute); }
.lg-keyhint { white-space: nowrap; }
/* Sin teclado físico (teléfono, tablet) no se menciona la tecla ENTER */
@media (hover: none) and (pointer: coarse) { .lg-keyhint { display: none; } }
.lg-kbd { font: 500 11px ui-monospace, Consolas, monospace; padding: 2px 7px; border: 1px solid var(--lg-line); border-radius: 6px; color: var(--lg-ink); }
.lg-foot {
  margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--lg-line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--lg-mute);
}
.lg-shake { animation: lg-shake .45s cubic-bezier(.36,.07,.19,.97) both !important; opacity: 1; }

/* Teléfono: todo en una pantalla de ~800 px de alto, sin desplazar */
@media (max-width: 639px) {
  .lg-tag { display: none; }
  .lg-art { max-height: 22vh; max-height: 22dvh; }
  .lg-form { gap: 14px; }
  .lg-sub { font-size: 14px; }
  .lg-main { padding-top: 22px; }
}

/* ── Tablet ─────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .lg-stage { padding: calc(36px + env(safe-area-inset-top)) 56px 26px; border-radius: 0 0 40px 40px; gap: 10px; }
  .lg-art { max-height: 30vh; max-height: 30dvh; }
  .lg-words { height: 56px; }
  .lg-word { font-size: 46px; line-height: 56px; }
  .lg-main { padding: 36px 56px 48px; }
  .lg-h { font-size: 38px; }
}
/* ── PC: dos columnas ───────────────────────────────────────── */
@media (min-width: 960px) {
  .lg-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
  .lg-stage { border-radius: 0; padding: 44px 56px 40px; justify-content: space-between; }
  .lg-art { max-height: 60vh; max-width: 640px; }
  .lg-words { height: 64px; }
  .lg-word { font-size: 56px; line-height: 64px; }
  .lg-main { padding: 56px 72px; }
  .lg-h { font-size: 42px; }
}
/* Poca altura (teléfono acostado, ventana baja): la animación se achica */
@media (max-height: 560px) and (max-width: 959px) {
  .lg-art { max-height: 38vh; }
  .lg-caption { display: none; }
}

/* ── Dibujo animado ─────────────────────────────────────────── */
.lg-ln { fill: none; stroke: var(--lg-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-al { fill: var(--lg-alu); stroke: var(--lg-ink); stroke-width: 2; }
.lg-gl { fill: var(--lg-glass); fill-opacity: .6; stroke: var(--lg-ink); stroke-width: 1.5; }
.lg-handle { fill: var(--lg-ink); }
/* Vano: al correrse la hoja se ve «abierto» (color del panel), no aluminio */
.lg-open { fill: var(--lg-panel); stroke: var(--lg-ink); stroke-width: 2; stroke-linejoin: round; }
.lg-dimt { font: 400 13px Jost, system-ui, sans-serif; fill: var(--lg-acc); letter-spacing: .04em; }
.lg-draw {
  stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0;
  animation: lg-draw 1.5s cubic-bezier(.65,0,.35,1) forwards, lg-fill .7s ease-out 1.25s forwards;
}
.lg-d2 { animation-delay: .35s, 1.5s; }
.lg-in1, .lg-in2 { opacity: 0; animation: lg-in .9s cubic-bezier(.2,.7,.2,1) forwards; }
.lg-in1 { animation-delay: 1.55s; }
.lg-in2 { animation-delay: 1.8s; }
.lg-slide { animation: lg-slide 9s ease-in-out 3.6s infinite; }
.lg-gleam { fill: #fff; opacity: .45; transform: translateX(-300px); animation: lg-gleam 9s ease-in-out 2.6s infinite; }
.lg-dim { opacity: 0; animation: lg-fade .8s ease-out 2.5s forwards; }
.lg-dim .lg-ln { stroke: var(--lg-acc); stroke-width: 1.5; }
.lg-dot {
  fill: var(--lg-acc); transform-box: fill-box; transform-origin: center; transform: scale(0);
  animation: lg-pop .5s cubic-bezier(.3,1.6,.5,1) forwards;
}
.lg-dot:nth-of-type(1) { animation-delay: 2.15s; }
.lg-dot:nth-of-type(2) { animation-delay: 2.27s; }
.lg-dot:nth-of-type(3) { animation-delay: 2.39s; }
.lg-dot:nth-of-type(4) { animation-delay: 2.51s; }

@keyframes lg-draw { to { stroke-dashoffset: 0; } }
@keyframes lg-fill { to { fill-opacity: 1; } }
@keyframes lg-in { from { opacity: 0; transform: translateY(-22px); } to { opacity: 1; transform: none; } }
@keyframes lg-fade { to { opacity: 1; } }
@keyframes lg-pop { to { transform: scale(1); } }
@keyframes lg-slide { 0%, 14% { transform: translateX(0); } 42%, 58% { transform: translateX(-150px); } 86%, 100% { transform: translateX(0); } }
@keyframes lg-gleam { 0% { transform: translateX(-300px); } 22%, 100% { transform: translateX(420px); } }
@keyframes lg-word { 0% { opacity: 0; transform: translateY(22px); } 5%, 30% { opacity: 1; transform: none; } 35%, 100% { opacity: 0; transform: translateY(-22px); } }
@keyframes lg-bar { 0% { width: 18px; opacity: .35; background: var(--lg-mute); } 4%, 30% { width: 34px; opacity: 1; background: var(--lg-acc); } 35%, 100% { width: 18px; opacity: .35; background: var(--lg-mute); } }
@keyframes lg-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes lg-sheen { 0% { transform: translateX(-160%); } 18%, 100% { transform: translateX(360%); } }
@keyframes lg-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  .lg *, .lg *::after, .auth-screen.lg { animation: none !important; transition: none !important; }
  .lg-draw { stroke-dashoffset: 0; fill-opacity: 1; }
  .lg-in1, .lg-in2, .lg-dim, .lg-form { opacity: 1; }
  .lg-dot { transform: none; }
  .lg-gleam { display: none; }
  .lg-word:first-child { opacity: 1; }
  .lg-bars i:first-child { width: 34px; opacity: 1; background: var(--lg-acc); }
}

/* ── Pantalla de carga (v2.12) ──────────────────────────────────
   Antes salía con los colores por omisión (azul marino, logo bronce con
   degradado) y cambiaba de golpe al aplicarse el tema. Ahora usa la misma
   paleta fija que el ingreso, y el tono oscuro lo decide boot-theme.js
   antes del primer cuadro. Selectores con #id para ganar a main.css/v211.css. */
html { background: #f5f3ef; }
html.vl-boot-dark { background: #141415; }
#seed-screen {
  --sd-bg:#f5f3ef; --sd-ink:#1c1c1e; --sd-mute:#625e57; --sd-line:#d6d1c7; --sd-acc:#a8814b; --sd-on:#f5f3ef;
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  padding: 24px;
  background: var(--sd-bg) !important; color: var(--sd-ink) !important;
  font-family: Jost, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  animation: sd-in .4s ease-out both;
}
html.vl-boot-dark #seed-screen {
  --sd-bg:#141415; --sd-ink:#ecebe8; --sd-mute:#a29e97; --sd-line:#36363c; --sd-acc:#c9a468; --sd-on:#141415;
}
#seed-screen .seed-logo {
  width: 52px; height: 52px; margin: 0 0 18px; border: 0 !important; border-radius: 14px;
  background: var(--sd-ink) !important; color: var(--sd-on) !important;
  box-shadow: none !important; text-shadow: none !important;
  display: grid; place-items: center;
  font: 600 17px Jost, system-ui, -apple-system, "Segoe UI", sans-serif !important; font-style: normal !important; letter-spacing: .04em;
}
#seed-screen .seed-title {
  margin: 0; color: var(--sd-ink) !important;
  font: 300 30px/1.15 Jost, system-ui, -apple-system, "Segoe UI", sans-serif !important; letter-spacing: .02em !important;
  text-transform: none !important;
}
#seed-screen .seed-sub {
  margin: 8px 0 0; color: var(--sd-mute) !important;
  font: 500 11px Jost, system-ui, -apple-system, "Segoe UI", sans-serif !important; letter-spacing: .22em !important; text-transform: uppercase;
}
#seed-screen .seed-bar-wrap {
  width: 160px; height: 2px; margin: 28px 0 12px; border-radius: 2px; overflow: hidden;
  background: var(--sd-line) !important;
}
#seed-screen .seed-bar {
  height: 100%; width: 0; border-radius: 2px;
  background: var(--sd-acc) !important; transition: width .4s ease;
}
#seed-screen .seed-msg {
  min-height: 20px; color: var(--sd-mute) !important; opacity: 1 !important;
  font: 400 13px Jost, system-ui, -apple-system, "Segoe UI", sans-serif !important; letter-spacing: .02em;
}
#seed-screen .seed-version-tag {
  position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom));
  margin: 0; padding: 0; border: 0 !important; background: none !important; text-align: center;
  color: var(--sd-mute) !important;
  font: 500 10.5px Jost, system-ui, -apple-system, "Segoe UI", sans-serif !important; letter-spacing: .2em !important; text-transform: uppercase;
}
@keyframes sd-in { from { opacity: 0; } to { opacity: 1; } }

/* El ingreso aparece suave sobre la pantalla de carga */
.auth-screen.lg { animation: sd-in .35s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  #seed-screen, .auth-screen.lg { animation: none; }
  #seed-screen .seed-bar { transition: none; }
}
