/* ==========================================================================
   Inicio de sesión — usa los mismos tokens de app.css
   ========================================================================== */

.login { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100vh; }

/* ---------- Panel de marca (mismo verde del menú lateral) ---------- */
.login-brand {
  background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; padding: 32px 44px; gap: 32px;
  position: relative; overflow: hidden;
}
.login-brand .brand { padding: 0; }
.login-pitch { margin: auto 0; display: grid; gap: 28px; max-width: 460px; }
.login-lead {
  font-size: 30px; line-height: 1.22; font-weight: 600; letter-spacing: -.02em;
  margin: 0; color: #fff; text-wrap: balance;
}
.login-chart { width: 100%; height: 170px; display: block; overflow: visible; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; }
.login-points li { display: flex; align-items: center; gap: 10px; }
.login-points li::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: var(--sidebar-act) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%239fe0c4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.login-foot { color: var(--sidebar-dim); font-size: 12.5px; }

/* Un solo momento de movimiento: la línea de ventas se dibuja al cargar */
.lc-line { stroke-dasharray: 700; stroke-dashoffset: 700; animation: lc-draw 1.4s cubic-bezier(.3,.7,.2,1) .15s forwards; }
.lc-area, .lc-dot { opacity: 0; animation: lc-fade .5s ease 1.2s forwards; }
@keyframes lc-draw { to { stroke-dashoffset: 0; } }
@keyframes lc-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lc-line { animation: none; stroke-dashoffset: 0; }
  .lc-area, .lc-dot { animation: none; opacity: 1; }
}

/* ---------- Formulario ---------- */
.login-panel {
  background: var(--surface); position: relative;
  display: grid; place-items: center; padding: 48px 24px;
}
.login-theme { position: absolute; top: 20px; right: 20px; }
.login-form { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.login-form h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
.login-sub { margin: -10px 0 4px; color: var(--ink-2); }
.login-form input[type="text"], .login-form input[type="password"] { width: 100%; min-height: 44px; font-size: 15px; }
.login-form input[aria-invalid="true"] { border-color: var(--critical); }

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.pass-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted);
  border-radius: 6px; cursor: pointer; display: grid; place-items: center;
}
.pass-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pass-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pass-toggle .eye-closed, .pass-toggle[aria-pressed="true"] .eye-open { display: none; }
.pass-toggle[aria-pressed="true"] .eye-closed { display: block; }
.caps-hint { color: var(--warning-ink); font-weight: 500; }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

.btn-block { width: 100%; justify-content: center; min-height: 46px; font-size: 15px; }
.btn[disabled] { cursor: progress; opacity: .85; }
.spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-error, .login-notice {
  font-size: 14px; border-radius: 8px; padding: 10px 12px; display: flex; gap: 8px; align-items: flex-start;
}
.login-error { color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 9%, transparent); border: 1px solid color-mix(in srgb, var(--critical) 35%, transparent); }
.login-error::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--critical); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.login-notice { color: var(--accent); background: var(--accent-soft); }
.login-error[hidden], .login-notice[hidden] { display: none; }

.login-help { font-size: 13px; color: var(--muted); margin: -4px 0 0; text-align: center; }


.login-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--sidebar); color: #9fe0c4; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mobile-brand { display: flex; }
  .login-panel { place-items: start center; padding: 72px 16px 40px; }
}
