/* ════════════════════════════════════════════════════════════
   /login — Metronic "login-6" (classic split, network-pattern
   background, доогуур зурастай underline талбарууд) загварт
   тулгуурлан verified.mn-ийн брэнд өнгөөр хийсэн.
════════════════════════════════════════════════════════════ */

html, body { height: 100%; }
body {
  min-height: 100vh; margin: 0;
  background: var(--bg);
}
.net-bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; display: block;
}

.l6-page {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 20px;
  box-sizing: border-box;
}

.l6-row {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 1080px;
  background: #ffffff; border-radius: 15px; padding: 20px;
  border: 1px solid #0f4c8130;
  box-shadow: 0 24px 60px -12px rgba(15,76,129,0.22);
}

/* ══════════════════════════════
   ЗҮҮН ТАЛ (Aside)
══════════════════════════════ */
.l6-aside {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 30px; text-align: center;
}
.l6-aside-inner { width: 100%; max-width: 380px; }
.l6-logo { height: 72px; width: auto; display: block; margin: 0 auto 2rem; }
.l6-title {
  font-size: 24px; font-weight: 700; color: var(--text-primary);
  line-height: 1.35; letter-spacing: -0.4px; margin: 0 0 14px;
}
.l6-desc {
  font-size: 13.5px; color: var(--text-secondary);
  line-height: 1.75; margin: 0 0 28px;
}
.l6-features { display: flex; flex-direction: column; gap: 10px; }
.l6-feature {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.65); border: 1px solid var(--border-light);
  border-radius: 100px; padding: 9px 18px 9px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.l6-feature i { font-size: 16px; color: var(--primary); }

.l6-btn-outline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 18px; padding: 12px 18px; width: 100%; box-sizing: border-box;
  background: transparent; border: 1px solid var(--primary); border-radius: 100px;
  color: var(--primary); font-size: 13.5px; font-weight: 600; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.l6-btn-outline i { font-size: 16px; }
.l6-btn-outline:hover { background: var(--primary); color: #fff; }

/* ══════════════════════════════
   ХООРОНДЫН ЗААГ (Divider)
══════════════════════════════ */
.l6-divider { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.l6-divider > div {
  width: 1px; height: 380px;
  background: linear-gradient(180deg, transparent, rgba(15,76,129,0.22) 20%, rgba(15,76,129,0.22) 80%, transparent);
}

/* ══════════════════════════════
   БАРУУН ТАЛ (Sign in form)
══════════════════════════════ */
.l6-content { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px; }
.l6-content-inner { width: 100%; max-width: 380px; }

.l6-form-head { text-align: center; margin-bottom: 1.75rem; }
.l6-form-head h2 {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.3px; margin: 0 0 6px;
}
.l6-form-head p { font-size: 13.5px; color: var(--text-secondary); margin: 0; }

.l6-form { display: flex; flex-direction: column; gap: 18px; }

/* Талбарууд — доогуур зурастай, нэгдсэн хайрцаг дотор */
.l6-fields {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.l6-frow { display: flex; align-items: center; }
.l6-frow + .l6-frow { border-top: 1px solid var(--border-light); }
.l6-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  padding: 15px 16px; font-size: 14px; font-family: inherit; color: var(--text-primary);
}
.l6-input::placeholder { color: var(--text-secondary); opacity: 0.75; }
.pw-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 18px;
  display: flex; align-items: center; padding: 4px; margin-right: 12px;
  transition: color 0.15s;
}
.pw-toggle:hover { color: var(--text-primary); }

.l6-opt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 5px; padding-right: 5px; }
.l6-remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.l6-remember input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.l6-forgot { font-size: 13px; color: var(--primary); font-weight: 600; text-decoration: none; }
.l6-forgot:hover { text-decoration: underline; }

.l6-submit-wrap { text-align: center; margin-top: 6px; }
.l6-back-row { text-align: center; margin-top: 16px; }

.l6-frow.invalid { background: #FEF2F2; }
.l6-frow.invalid .l6-input { color: #991B1B; }

.reg-pw-rules {
  list-style: none; margin: 10px 2px 0; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.reg-pw-rules li {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-muted);
  transition: color 0.15s;
}
.reg-pw-rules li i { font-size: 14px; color: var(--border); transition: color 0.15s; }
.reg-pw-rules li.ok { color: #16A34A; }
.reg-pw-rules li.ok i { color: #16A34A; }
.l6-btn {
  background: var(--primary); color: #fff; border: none;
  padding: 13px 42px; border-radius: 100px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; box-shadow: 0 10px 24px rgba(15,76,129,0.25);
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}
.l6-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(15,76,129,0.32); }
.l6-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* Анхааруулга (warning) alert */
.l6-warn {
  display: flex; align-items: flex-start; gap: 9px;
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  font-size: 12.5px; line-height: 1.6; color: #92400E;
}
.l6-warn i { font-size: 16px; flex-shrink: 0; margin-top: 1px; color: #D97706; }
.l6-warn strong { font-weight: 700; }

/* Error alert */
.auth-error {
  display: none; align-items: flex-start; gap: 9px;
  background: #FEF2F2; border: 1px solid #FECACA;
  border-radius: 10px; padding: 12px 14px;
  font-size: 13px; color: #991B1B;
}
.auth-error.show { display: flex; }
.auth-error i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 0.9s linear infinite; }

/* Үндсэн хуудас руу буцах — зүүн дээд буланд тогтмол байрлалтай дугуй icon товч */
.home-fab {
  position: fixed; top: 22px; left: 22px; z-index: 50;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border);
  color: var(--primary); font-size: 19px; text-decoration: none;
  box-shadow: 0 4px 14px rgba(15,76,129,0.12);
  transition: background 0.15s, transform 0.15s;
}
.home-fab:hover { background: var(--primary-light); transform: translateX(-3px); }

.l6-copyright {
  position: fixed; left: 0; right: 0; bottom: 18px; z-index: 10;
  text-align: center; font-size: 12.5px; color: var(--text-secondary);
}

/* ══════════════════════════════
   Систем сонгох modal (2+ эрхтэй бол)
══════════════════════════════ */
.sys-pick-ov {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: none; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.sys-pick-ov.open { display: flex; }
.sys-pick-box {
  background: #fff; border-radius: 18px; width: 100%; max-width: 440px;
  padding: 28px 26px; box-shadow: 0 24px 70px rgba(0,0,0,.25);
  animation: sysPickIn .2s ease;
}
@keyframes sysPickIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.sys-pick-title { font-size: 19px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.sys-pick-sub   { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.sys-pick-list  { display: flex; flex-direction: column; gap: 10px; }
.sys-pick-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; cursor: pointer; text-align: left; width: 100%;
  font-family: inherit; transition: .15s;
}
.sys-pick-card:hover { border-color: var(--primary); background: var(--bg); transform: translateY(-1px); }
.sys-pick-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.sys-pick-card.sys-user      .sys-pick-icon { background: #eff6ff; color: #1d4ed8; }
.sys-pick-card.sys-certifier .sys-pick-icon { background: #eef2f8; color: #0E2340; }
.sys-pick-card.sys-admin     .sys-pick-icon { background: #fef2f2; color: #ef4444; }
.sys-pick-text { flex: 1; min-width: 0; }
.sys-pick-name { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.sys-pick-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.sys-pick-arrow { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }

/* ══════════════════════════════
   Нууц үг сэргээх modal
══════════════════════════════ */
.fg-ov {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: none; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.fg-ov.open { display: flex; }
.fg-card {
  position: relative; background: #fff; border-radius: 18px;
  width: 100%; max-width: 400px; padding: 32px 28px 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.25); text-align: center;
  animation: sysPickIn .2s ease;
}
.fg-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--bg); color: var(--text-secondary); font-size: 16px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fg-close:hover { background: var(--border-light); color: var(--text-primary); }
.fg-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary); font-size: 26px;
  display: flex; align-items: center; justify-content: center;
}
.fg-icon.fg-icon-ok { background: #DCFCE7; color: #16A34A; }
.fg-icon svg { display: block; }

/* Алхам 1: утас — блиц мигалдах текст мөр/курсор */
@keyframes fgBlink { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0; } 100% { opacity: 1; } }
.fg-s1-l1 { animation: fgBlink 2.4s steps(1) infinite; }
.fg-s1-l2 { animation: fgBlink 2.4s steps(1) infinite; animation-delay: .3s; }
.fg-s1-cursor { animation: fgBlink 1s steps(1) infinite; }

/* Алхам 2: тойрог spinner arc */
@keyframes fgSpin { to { transform: rotate(360deg); } }
.fg-spin-arc { transform-origin: center; animation: fgSpin 1.1s linear infinite; }

/* Алхам 3: түлхүүр — цоож бага зэрэг хөдөлж байх */
@keyframes fgShackle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
.fg-s3-shackle { transform-box: fill-box; transform-origin: center; animation: fgShackle 2.6s ease-in-out infinite; }

/* Алхам 4: амжилтын тэмдэг зурагдах */
.fg-ok-circle { stroke-dasharray: 107; stroke-dashoffset: 107; animation: fgDraw .6s ease-out forwards; }
.fg-ok-check  { stroke-dasharray: 24; stroke-dashoffset: 24; animation: fgDraw .35s ease-out .5s forwards; }
@keyframes fgDraw { to { stroke-dashoffset: 0; } }
.fg-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.fg-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 18px; }
.fg-error {
  display: none; font-size: 12.5px; color: #991B1B; background: #FEF2F2;
  border: 1px solid #FECACA; border-radius: 8px; padding: 9px 12px; margin-bottom: 14px;
}
.fg-error.show { display: block; }
.fg-btn { width: 100%; margin-top: 16px; }
.fg-qr-wrap { display: flex; justify-content: center; margin: 4px 0 10px; }
.fg-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 16px; }
.fg-link-btn {
  font-size: 13px; color: var(--primary); font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.fg-link-btn:hover { text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 991px) {
  .l6-row { flex-direction: column; max-width: 420px; }
  .l6-aside, .l6-content { padding: 20px; }
  .l6-divider { width: 100%; padding: 4px 0; }
  .l6-divider > div {
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15,76,129,0.22) 20%, rgba(15,76,129,0.22) 80%, transparent);
  }
  .l6-features { display: none; }
  .l6-desc { margin-bottom: 8px; }
}
@media (max-width: 480px) {
  .l6-page { padding: 32px 14px; }
  .l6-title { font-size: 20px; }
}
