/* ════════════════════════════════════════════════════════════════════════
   EPM — LOGIN (split hero) tokenizado
   Cambio OpenSpec: 2026-06-ui-refresh-foundation / DES-008
   ------------------------------------------------------------------------
   Hero atmosférico (dark siempre, imagen agrícola) + form panel conmutable.
   Light: panel cream + card blanca + imagen de hero "sun mode".
   ════════════════════════════════════════════════════════════════════════ */

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-primary);
}

.epm-login { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }

/* ── Hero (siempre dark) ─────────────────────────────────────────────── */
.epm-login__hero {
  position: relative; overflow: hidden;
  background: #0b1118 url("/static/img/bg-emser-tasks-center.jpg") center/cover no-repeat;
  display: flex; align-items: flex-end;
}
.epm-login__hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(11, 17, 24, .35) 0%, rgba(11, 17, 24, .88) 100%);
}
.epm-login__hero-content { position: relative; z-index: 1; padding: 48px 56px; color: #fff; }
.epm-login__hero-logo { width: 56px; height: auto; margin-bottom: 18px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .5)); }
/* Título de marca: "Emser" (blanco, fuerte) en una línea y "Profile Manager"
   (accent de marca) debajo. text-shadow para legibilidad sobre la foto. */
.epm-login__hero-title { font-size: 36px; font-weight: 800; line-height: 1.05; letter-spacing: -.01em; margin: 0 0 10px; text-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.epm-login__hero-title span { display: block; font-size: 20px; font-weight: 600; color: #f1515d; letter-spacing: .02em; margin-top: 3px; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.epm-login__hero-sub { font-size: 14px; color: rgba(255, 255, 255, .72); margin: 0; }

/* ── Form panel ──────────────────────────────────────────────────────── */
.epm-login__panel {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 32px; background: var(--bg-canvas);
}
.epm-login__prefs { position: absolute; top: 18px; right: 18px; display: flex; gap: 8px; }
.epm-login__toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  color: var(--text-secondary); cursor: pointer;
}
.epm-login__toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.epm-login__card {
  width: 100%; max-width: 380px;
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 44px 40px;
}
.epm-login__brand-mobile { display: none; text-align: center; margin-bottom: 18px; }
.epm-login__brand-mobile img { width: 48px; height: auto; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .35)); }

.epm-login__heading { font-size: 22px; font-weight: 700; color: var(--text-primary); margin: 0 0 5px; text-align: center; }
.epm-login__subheading { font-size: 13px; color: var(--text-tertiary); margin: 0; text-align: center; }

.epm-login__head { margin-bottom: 30px; }
.epm-login__badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px;
  padding: 4px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--accent-soft-bg); border: 1px solid var(--accent-soft-bd); color: var(--accent);
}

.epm-login__field { margin-bottom: 18px; }
.epm-login__field label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--text-tertiary); margin-bottom: 6px;
}
.epm-login__control { position: relative; }
.epm-login__field-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); font-size: 14px; pointer-events: none;
}
.epm-login__input {
  width: 100%; box-sizing: border-box; height: 44px; padding: 0 40px;
  background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-sans); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.epm-login__input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-soft-bg); }
.epm-login__input:focus ~ .epm-login__field-icon { color: var(--accent); }
.epm-login__input::placeholder { color: var(--text-muted); }
.epm-login__pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer;
  color: var(--text-tertiary); border-radius: var(--radius-sm);
}
.epm-login__pw-toggle:hover { color: var(--accent); background: var(--bg-hover); }

.epm-login__submit {
  width: 100%; height: 44px; margin-top: 8px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  font-family: var(--font-sans); cursor: pointer;
  transition: all .18s cubic-bezier(.16, 1, .3, 1);
}
.epm-login__submit:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(178, 33, 48, .28); }
.epm-login__submit:active { transform: translateY(0); }

.epm-login__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-subtle);
  font-size: 11px; color: var(--text-tertiary);
}
.epm-login__foot-brand { display: inline-flex; align-items: center; gap: 6px; }
.epm-login__foot-dot { font-size: 7px; color: var(--accent); }
.epm-login__foot-sec { display: inline-flex; align-items: center; gap: 5px; color: var(--state-success); }
.epm-login__ver { margin-top: 10px; text-align: center; font-size: 10px; color: var(--text-muted); }

/* Hero: grid de puntos decorativo (top-right) */
.epm-login__hero-grid {
  position: absolute; top: 0; right: 0; width: 45%; height: 45%; z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .10) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(225deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(225deg, #000 0%, transparent 70%);
}

/* ── Theme transition overlay (login) ────────────────────────────────── */
.theme-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(245, 241, 232, .55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .22s ease; pointer-events: none;
}
.theme-overlay.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .theme-overlay { display: none !important; } }

/* ── LIGHT overrides ─────────────────────────────────────────────────── */
[data-theme="light"] .epm-login__hero {
  background-image: url("/static/img/bg-emser-tasks-center-sun-mode.png");
}
[data-theme="light"] .epm-login__hero-overlay {
  background: linear-gradient(160deg, rgba(239, 233, 221, .10) 0%, rgba(40, 30, 20, .55) 100%);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .epm-login { grid-template-columns: 1fr; }
  .epm-login__hero { display: none; }
  .epm-login__brand-mobile { display: block; }
}
