/* ============================================================
   LMS ERP — Login Screen
   Self-contained. Scoped under .lgn so it cannot leak into
   the rest of the application.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.lgn {
  --navy-900: #0B1C36;
  --navy-800: #12294A;
  --navy-700: #1B3A63;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-50:  #EFF6FF;
  --ink:      #0F172A;
  --ink-2:    #475569;
  --ink-3:    #94A3B8;
  --line:     #E2E8F0;
  --line-2:   #CBD5E1;
  --white:    #FFFFFF;
  --surface:  #F8FAFC;
  --danger:   #DC2626;
  --ok:       #059669;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv01' 1;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}

/* Reset the dark app shell for this page only */
body.auth-body {
  margin: 0;
  background: var(--surface, #F8FAFC);
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────── */
.lgn-wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  background: #F8FAFC;
}

/* ── LEFT: brand / promo ────────────────────────────────── */
.lgn-promo {
  position: relative;
  background: linear-gradient(155deg, var(--navy-900) 0%, var(--navy-800) 55%, #0E2242 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.lgn-promo::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 25%, rgba(37,99,235,.22) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 85% 80%, rgba(56,189,248,.12) 0%, transparent 60%);
  pointer-events: none;
}
.lgn-promo > * { position: relative; z-index: 1; }

.lgn-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
}
.lgn-brand-mark {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(37,99,235,.35);
}
.lgn-brand-mark svg { width: 22px; height: 22px; color: #fff; }
.lgn-brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.lgn-brand-sub {
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  margin-top: 1px;
}

.lgn-headline {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.035em;
  margin: 0 0 14px;
}
.lgn-sub {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,.62);
  max-width: 400px;
  margin: 0 0 40px;
}

/* Feature list */
.lgn-features {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 44px;
}
.lgn-feat { display: flex; gap: 14px; align-items: flex-start; }
.lgn-feat-ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.lgn-feat-ico svg { width: 18px; height: 18px; color: #7DB0FF; }
.lgn-feat h4 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 1px 0 3px;
  color: #fff;
}
.lgn-feat p {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,.55);
  margin: 0;
}

/* Stats */
.lgn-stats {
  display: flex;
  gap: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.lgn-stat b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
}
.lgn-stat span {
  font-size: 11.5px;
  color: rgba(255,255,255,.5);
}

/* ── RIGHT: form ────────────────────────────────────────── */
.lgn-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 32px 24px;
  background: #F8FAFC;
}

.lgn-card {
  width: 100%;
  max-width: 424px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 36px 34px 30px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px rgba(15,23,42,.07);
}

.lgn-head { margin-bottom: 26px; }
.lgn-head h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 0 0 6px;
  color: var(--ink);
}
.lgn-head p {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
}

/* Fields */
.lgn-field { margin-bottom: 17px; }
.lgn-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}
.lgn-hint {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
}
.lgn-hint.ok { color: var(--ok); }

.lgn-input {
  position: relative;
  display: flex;
  align-items: center;
}
.lgn-input > svg {
  position: absolute;
  left: 13px;
  width: 17px; height: 17px;
  color: var(--ink-3);
  pointer-events: none;
  z-index: 1;
}

.lgn-input input,
.lgn-input select {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 41px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.lgn-input input::placeholder { color: var(--ink-3); }

.lgn-input input:focus,
.lgn-input select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3.5px rgba(37,99,235,.13);
}

.lgn-input select {
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.7' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.lgn-input select:disabled {
  background-color: var(--surface);
  color: var(--ink-3);
  cursor: not-allowed;
}

/* Password visibility toggle */
.lgn-eye {
  position: absolute;
  right: 6px;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-3);
  transition: color .15s ease, background .15s ease;
}
.lgn-eye:hover { color: var(--ink-2); background: var(--surface); }
.lgn-eye svg { width: 17px; height: 17px; }
.lgn-eye:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }

.lgn-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blue-600);
  text-decoration: none;
}
.lgn-link:hover { color: var(--blue-700); text-decoration: underline; }

/* Checkbox */
.lgn-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 22px;
  cursor: pointer;
}
.lgn-check input {
  width: 16px; height: 16px;
  accent-color: var(--blue-600);
  cursor: pointer;
  flex-shrink: 0;
}
.lgn-check label {
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

/* Submit */
.lgn-btn {
  width: 100%;
  height: 47px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--blue-600);
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px rgba(37,99,235,.3);
}
.lgn-btn:hover:not(:disabled) {
  background: var(--blue-700);
  box-shadow: 0 4px 14px rgba(37,99,235,.32);
  transform: translateY(-1px);
}
.lgn-btn:active:not(:disabled) { transform: translateY(0); }
.lgn-btn:disabled { opacity: .7; cursor: not-allowed; }
.lgn-btn.done { background: var(--ok); }
.lgn-btn:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 2px; }

.lgn-spin {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lgnspin .65s linear infinite;
}
@keyframes lgnspin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Inline alert */
.lgn-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 18px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.lgn-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* Help note */
.lgn-help {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.lgn-help b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.lgn-help span {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ── Footer ─────────────────────────────────────────────── */
.lgn-foot {
  width: 100%;
  max-width: 424px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.lgn-foot-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.lgn-foot-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.lgn-foot-url {
  display: inline-block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--blue-600);
  text-decoration: none;
}
.lgn-foot-url:hover { color: var(--blue-700); text-decoration: underline; }
.lgn-foot-ver {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-3);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .lgn-promo  { padding: 40px 40px; }
  .lgn-headline { font-size: 33px; }
  .lgn-stats  { gap: 26px; }
}

@media (max-width: 900px) {
  .lgn-wrap { grid-template-columns: 1fr; min-height: auto; }
  .lgn-promo {
    padding: 34px 26px 30px;
    text-align: center;
    align-items: center;
  }
  .lgn-brand    { margin-bottom: 24px; }
  .lgn-headline { font-size: 28px; }
  .lgn-sub      { font-size: 14px; margin-bottom: 26px; }
  .lgn-features { display: none; }          /* keep the fold tight on tablet */
  .lgn-stats    { justify-content: center; border-top: none; padding-top: 0; }
  .lgn-side     { padding: 30px 22px 22px; }
}

@media (max-width: 520px) {
  .lgn-promo    { padding: 26px 20px 24px; }
  .lgn-headline { font-size: 24px; }
  .lgn-sub      { margin-bottom: 20px; }
  .lgn-stats    { display: none; }          /* non-essential on phones */
  .lgn-card     { padding: 26px 20px 24px; border-radius: var(--r); }
  .lgn-head h1  { font-size: 22px; }
  .lgn-side     { padding: 22px 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .lgn-btn, .lgn-input input, .lgn-input select { transition: none; }
  .lgn-btn:hover:not(:disabled) { transform: none; }
  .lgn-spin { animation-duration: 2s; }
}
