/*
 * Login nuevo - Fase 1. La referencia visual fue ajustada por Martín el 21-11-2026:
 * fondo siempre claro, cintas frontales y rectas, textura suave y movimiento más lento.
 * Los colores y componentes siguen saliendo de los tokens --td-* del sistema.
 *
 * Alcance: solo la página de login. ingresar.blade.php carga td.css y después este archivo;
 * no depende de app.css, tema.js ni de cambios en AdminPanelProvider. td.css aporta los tokens
 * --td-*, Geist/Geist Mono y los componentes base; aquí solo está el escenario y las medidas
 * propias de la tarjeta (46px de alto en campos, 48px en el botón).
 *
 * Lo de aquí es solo lo que no existe en el sistema global: el fondo de piezas de cuero animado y
 * las medidas propias de la tarjeta de login (46px de alto en campos, 48px en el botón, etc.).
 */

[x-cloak] { display: none !important; }

.td-login-stage,
.td-login-stage *,
.td-login-stage *::before,
.td-login-stage *::after {
  box-sizing: border-box;
}

/* ---------- Escenario a pantalla completa ----------
   position:fixed cubre toda la ventana por encima de la tarjeta vacía que deja el layout «simple»
   de Filament (no se tocó ese layout ni AdminPanelProvider). z-index bajo: por debajo de modales y
   de la pila de notificaciones del panel, por encima del contenido normal sin posicionar. */
.td-login-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--td-bg);
  color: var(--td-ink);
  font-family: var(--td-font-sans);
  font-size: 14px;
  line-height: 20px;
  color-scheme: light;
}
.td-login-stage a { color: var(--td-brand-text); text-decoration: none; }
.td-login-stage a:hover { color: var(--td-brand-hover); }
.td-login-stage :focus-visible { outline: 2px solid var(--td-focus); outline-offset: 2px; }
/* .td-icon ya viene de td.css (mismo tamaño/trazo): no se repite aquí. */

/* ---------- Fondo: cintas verticales frontales, sin perspectiva ---------- */
.td-lg-plane {
  position: absolute;
  inset: 0;
  opacity: .72;
}
.td-lg-cols {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(88px, 1fr));
  justify-content: center;
  gap: 24px;
  padding: 0 24px;
}
.td-lg-col { position: relative; overflow: hidden; }
.td-lg-col:nth-child(n + 11) { display: none; }
.td-lg-track { display: flex; flex-direction: column; will-change: transform; }
.td-lg-up { animation: td-lg-up linear infinite; }
.td-lg-down { animation: td-lg-down linear infinite; }
.td-lg-track { animation-duration: 180s !important; }
.td-lg-col:nth-child(3n + 1) .td-lg-track { animation-duration: 220s !important; }
.td-lg-col:nth-child(3n + 2) .td-lg-track { animation-duration: 200s !important; }
@keyframes td-lg-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes td-lg-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .td-lg-track { animation: none; }
}

.td-pz {
  position: relative; flex: none; width: 100%; margin-bottom: 20px; border-radius: var(--td-radius-md);
  background-image:
    radial-gradient(120% 70% at 25% 0%, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0) 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.025));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.035),
    0 5px 14px -10px rgba(0, 0, 0, 0.24);
}
.td-pz::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background: url("login-assets/textura-grano-cuero.png") 0 0 / 160px 160px;
  opacity: var(--td-grain, .12);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.td-pz svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.td-seam { x: 7px; y: 7px; width: calc(100% - 14px); height: calc(100% - 14px); rx: 5px; fill: none; stroke-width: 1; stroke-dasharray: 3 4; stroke-linecap: round; }
.td-seam-hole { stroke: rgba(0, 0, 0, 0.12); transform: translateY(0.5px); }
.td-seam-thread { stroke: var(--td-thread); opacity: .52; }
.td-groove { x: 4px; y: 4px; width: calc(100% - 8px); height: calc(100% - 8px); rx: 7px; fill: none; stroke: rgba(0, 0, 0, 0.045); stroke-width: 1; }

.td-leather-1 { --td-grain: .12; background-color: color-mix(in srgb, var(--td-leather-1) 26%, var(--td-surface)); --td-thread: #a87550; }
.td-leather-2 { --td-grain: .10; background-color: color-mix(in srgb, var(--td-leather-2) 12%, var(--td-surface)); --td-thread: #8f8b84; }
.td-leather-3 { --td-grain: .09; background-color: color-mix(in srgb, var(--td-leather-3) 72%, var(--td-surface)); --td-thread: #b7a894; }
.td-leather-4 { --td-grain: .08; background-color: color-mix(in srgb, var(--td-leather-4) 70%, var(--td-surface)); --td-thread: #aaa9a4; }
.td-leather-5 { --td-grain: .11; background-color: color-mix(in srgb, var(--td-leather-5) 34%, var(--td-surface)); --td-thread: #b79a7d; }

/* Sello del isotipo en bajo relieve.
   BLOQUEADO (ver informe): sin SVG original del isotipo. Se usa de forma temporal el icono de marca
   que ya existe en producción (marca/logo-dorado-icono.png, no uno de los PNG provisionales del
   paquete) como máscara. No cumple el criterio «el isotipo viene del SVG original»: reemplazar esta
   máscara en cuanto exista el SVG. */
.td-stamp {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px;
  transform: translate(-50%, -50%);
  opacity: .26;
  pointer-events: none;
}
.td-stamp::before, .td-stamp::after, .td-stamp i {
  content: "";
  position: absolute; inset: 0;
  -webkit-mask: url("/marca/logo-dorado-icono.png") center / contain no-repeat;
  mask: url("/marca/logo-dorado-icono.png") center / contain no-repeat;
}
.td-stamp::before { background: rgba(0, 0, 0, 0.30); transform: translateY(-1.2px); z-index: 1; }
.td-stamp::after { background: rgba(255, 255, 255, 0.55); transform: translateY(1.2px); z-index: 1; }
.td-stamp i { display: block; background: var(--td-stamp); z-index: 2; }
.td-leather-1 { --td-stamp: #93491b; }
.td-leather-3 { --td-stamp: #e6dccf; }
.td-leather-4 { --td-stamp: #d9d8d4; }
.td-leather-5 { --td-stamp: #bd916a; }
.td-leather-2 .td-stamp::before { background: rgba(0, 0, 0, 0.7); }
.td-leather-2 .td-stamp::after { background: rgba(255, 255, 255, 0.14); }
.td-leather-2 { --td-stamp: #161412; }

.td-f-matte { background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.02)); }
.td-f-matte::before { opacity: .07; }
.td-f-gloss {
  background-image:
    radial-gradient(85% 50% at 32% 6%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 62%),
    linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.045) 48%, rgba(255, 255, 255, 0) 58%);
}
.td-f-gloss::before { opacity: .05; }
.td-h1 { height: 92px; }
.td-h2 { height: 136px; }
.td-h3 { height: 188px; }
.td-h4 { height: 118px; }
.td-h5 { height: 220px; }
.td-h6 { height: 156px; }

.td-lg-fade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 44% 64% at 50% 50%, color-mix(in srgb, var(--td-bg) 92%, transparent) 0%, color-mix(in srgb, var(--td-bg) 58%, transparent) 58%, transparent 100%),
    linear-gradient(180deg, var(--td-bg) 0%, transparent 16%, transparent 84%, var(--td-bg) 100%);
}

@media (max-width: 640px) {
  .td-lg-cols { grid-template-columns: repeat(3, minmax(88px, 1fr)); gap: 16px; padding: 0 16px; }
  .td-lg-col:nth-child(n + 4) { display: none; }
  .td-lg-plane { opacity: .60; }
}

/* ---------- Tarjeta del formulario ---------- */
.td-lg-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 20px;
  padding: 40px;
  background: var(--td-surface);
  border: 1px solid var(--td-border);
  border-radius: var(--td-radius-lg);
  box-shadow: var(--td-shadow-card);
}
.td-lg-logo { width: 156px; height: auto; margin-bottom: 12px; }
.td-login-stage .td-lg-logo--light { display: block; }
.td-login-stage .td-lg-logo--dark { display: none; }
.td-lg-title {
  margin: 0 0 4px; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.035em;
  font-family: var(--td-font-sans); color: var(--td-ink);
}

/* .td-alert, .td-alert__body y .td-alert--danger ya vienen de td.css (mismos valores): no se
   repiten aquí. La vista usa esos nombres de clase (con la variante normalizada), no --danger. */

/* ---------- Campos ----------
   .td-field, .td-field__label y .td-input (base) ya vienen de td.css; aquí solo el alto propio del
   login (46px en vez de los 36px por defecto del panel). */
.td-lg-form { display: flex; flex-direction: column; gap: 20px; }
.td-lg-input { height: 46px; border-radius: var(--td-radius-md); }

.td-lg-pw { position: relative; }
.td-lg-pw .td-input { padding-right: 44px; }
.td-lg-pw .td-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.td-lg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.td-lg-help-wrap { display: flex; flex-direction: column; gap: 14px; }
.td-lg-check {
  display: inline-flex; align-items: center; gap: 8px; font: 500 13px/18px var(--td-font-sans);
  color: var(--td-ink); cursor: pointer;
}
.td-lg-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--td-brand); }
.td-lg-link {
  border: 0; background: none; padding: 0; font: 500 13px/18px var(--td-font-sans); color: var(--td-ink-muted);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--td-border-strong);
}
.td-lg-link:hover { color: var(--td-ink); }
.td-lg-help {
  margin: 0; padding: 10px 12px; border-radius: var(--td-radius-md);
  background: var(--td-surface-sunken); color: var(--td-ink-muted); font-size: 13px; line-height: 18px;
}

/* ---------- Botones ----------
   .td-btn y sus variantes (--primary, --ghost, --icon) ya vienen de td.css con los mismos
   colores; aquí solo el alto propio del botón de enviar (48px en vez de los 36px por defecto). */
.td-lg-submit { width: 100%; height: 48px; font-size: 15px; margin-top: 4px; }
.td-lg-loading { display: inline-flex; align-items: center; gap: 8px; }
.td-lg-spin {
  width: 16px; height: 16px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff; animation: td-lg-rot .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .td-lg-spin { animation-duration: 1.6s; }
}
@keyframes td-lg-rot { to { transform: rotate(360deg); } }

.td-lg-footer {
  position: relative; z-index: 1; margin: 24px 0 0; color: var(--td-ink-muted); font-size: 12px;
  font-family: var(--td-font-sans);
}
