/* ==========================================================================
   Login — la "puerta" del mismo sistema
   Celular: franja de marca (color del menú lateral) + hoja que sube con el
   formulario. PC (≥ 992px): panel de marca a la izquierda, tarjeta a la derecha.
   Colores y forma desde public/css/theme.css (--t-*): claro Tómbola / oscuro básico.
   El login no tiene botón de tema: sigue la preferencia guardada o la del sistema.
   ========================================================================== */

.login-secure {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--t-font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--t-text);
  background: var(--t-bg);
}

.lg {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Franja / panel de marca ---------- */
.lg-hero {
  position: relative;
  flex: none;
  padding: calc(2.25rem + env(safe-area-inset-top, 0px)) 1.25rem 3.25rem;
  color: #FFFFFF;
  text-align: center;
  background: linear-gradient(180deg, var(--t-sidebar), var(--t-sidebar-2));
  overflow: hidden;
}
/* Brillo suave detrás del logo (decorativo) */
.lg-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 120%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}
.lg-hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.lg-logo {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  padding: 4px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.lg-brand {
  margin: 0.875rem 0 0;
  font-family: var(--t-font-display);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.lg-slogan { margin: 0.25rem 0 0; font-size: 1rem; color: var(--t-sidebar-text); }
.lg-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.875rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

/* ---------- Hoja con el formulario ---------- */
.lg-sheet {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: -1.75rem;           /* sube sobre la franja */
  padding: 1.75rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--t-surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  animation: lg-up 380ms var(--t-ease) both;
}
@keyframes lg-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.lg-card { width: 100%; max-width: 420px; margin: 0 auto; }
.lg-title {
  margin: 0 0 1.25rem;
  font-family: var(--t-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--t-heading);
}

/* Error */
.lg-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--t-danger);
  background: var(--t-danger-soft);
  border: 1px solid var(--t-danger);
  border-radius: var(--t-radius-sm);
}
.lg-alert i { margin-top: 0.15rem; }

/* Campos */
.lg-form { display: flex; flex-direction: column; gap: 1rem; }
.lg-field { display: flex; flex-direction: column; gap: 0.375rem; }
.lg-label { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--t-text); }
.lg-input {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 52px;
  padding: 0 0.375rem 0 0.875rem;
  background: var(--t-field);
  border: 1px solid var(--t-border-strong);
  border-radius: var(--t-radius-md);
  transition: border-color 150ms var(--t-ease), box-shadow 150ms var(--t-ease);
}
.lg-input:focus-within { border-color: var(--t-primary); box-shadow: var(--t-focus); }
.lg-input.is-invalid { border-color: var(--t-danger); }
.lg-input-icon { flex: none; width: 1.125rem; text-align: center; color: var(--t-placeholder); }
.lg-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  font: inherit;
  font-size: 1rem;                /* 16px: sin zoom en iOS */
  color: var(--t-text);
  background: transparent;
  border: 0;
  outline: 0;
}
.lg-input input::placeholder { color: var(--t-placeholder); opacity: 1; }
.lg-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--t-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--t-radius-sm);
  cursor: pointer;
}
.lg-toggle:hover { background: var(--t-hover); }
.lg-toggle:focus-visible { outline: 2px solid var(--t-primary); outline-offset: 0; }
.lg-hint { display: flex; align-items: center; gap: 0.375rem; margin: 0; font-size: 0.8125rem; color: var(--t-warning); }
.lg-hint[hidden] { display: none; }

/* Acceder: la acción principal del tema (dorado 3D en claro, lima en oscuro) */
.lg-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 52px;
  margin-top: 0.5rem;
  font-family: var(--t-font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--t-cta-ink);
  background: var(--t-cta);
  border: 0;
  border-radius: var(--t-radius-md);
  box-shadow: 0 4px 0 var(--t-cta-edge);
  cursor: pointer;
  transition: transform 100ms var(--t-ease), box-shadow 100ms var(--t-ease), filter 150ms var(--t-ease);
}
.lg-submit:hover { filter: brightness(1.05); }
.lg-submit:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--t-cta-edge); }
.lg-submit:focus-visible { outline: 2px solid var(--t-text); outline-offset: 3px; }
.lg-submit[disabled] { cursor: progress; filter: saturate(0.7); }
.lg-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: lg-spin 700ms linear infinite;
}
.lg-submit[aria-busy="true"] .lg-spinner { display: inline-block; }
@keyframes lg-spin { to { transform: rotate(360deg); } }

/* Aviso y pie */
.lg-notice {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0.75rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--t-text-muted);
  background: var(--t-surface-2);
  border-radius: var(--t-radius-sm);
}
.lg-notice i { margin-top: 0.15rem; color: var(--t-primary); }
.lg-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem;
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--t-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   PC (≥ 992px): panel de marca a la izquierda, tarjeta a la derecha
   ========================================================================== */
@media (min-width: 992px) {
  .lg { flex-direction: row; }
  .lg-hero {
    flex: 0 0 44%;
    max-width: 640px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
  }
  .lg-logo { width: 112px; height: 112px; padding: 6px; }
  .lg-brand { margin-top: 1.25rem; font-size: 2.5rem; }
  .lg-slogan { font-size: 1.25rem; }
  .lg-pill { margin-top: 1.25rem; }

  .lg-sheet {
    flex: 1;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 3rem 2rem 1.5rem;
    background: var(--t-bg);
    border-radius: 0;
    box-shadow: none;
  }
  .lg-card {
    padding: 2.25rem 2rem 2rem;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow-card-lg);
  }
  .lg-foot { margin-top: 0; }
}

/* ---------- Preferencias del sistema ---------- */
@media (prefers-reduced-motion: reduce) {
  .lg-sheet { animation: none; }
  .lg-input, .lg-submit { transition: none; }
  .lg-submit:active { transform: none; }
  .lg-spinner { animation-duration: 1.6s; }
}
@media (prefers-contrast: more) {
  .lg-input { border-color: var(--t-text-muted); }
  .lg-card { border-color: var(--t-border-strong); }
}
