/* Login gate (spec 7.1): split screen - brand panel left, form card right. */

/* ------------------------------------------------ gate + loader */
#login-root { display: none; }
body.auth-login #login-root { display: block; }
body.auth-login #app { display: none; }
body.gate-checking #app,
body.gate-checking #login-root { display: none; }

.gate-loader {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center; gap: 12px;
  background: var(--bg, #f4f6f9); color: var(--muted, #6b7685);
  font-size: 14px;
}
body.gate-checking .gate-loader { display: flex; }

.signed-user { font-size: 13px; color: var(--muted, #6b7685); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------ screen layout */
.lg-screen {
  position: fixed; inset: 0; z-index: 250;
  display: flex; background: #ffffff; overflow: auto;
}

.lg-brand {
  flex: 0 0 56%; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 46px 56px; color: #c6d0dd;
  background:
    radial-gradient(900px 480px at 12% 8%, rgba(45,110,190,.35), transparent 60%),
    linear-gradient(160deg, #0f1b2d 0%, #16263d 55%, #1d3a5f 100%);
}
.lg-brand::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 22px 22px; pointer-events: none;
}
.lg-brand-glow {
  position: absolute; width: 460px; height: 460px; right: -120px; top: -140px;
  background: radial-gradient(circle, rgba(59,130,246,.28), transparent 65%);
  pointer-events: none;
}
.lg-brand-logo { display: flex; align-items: center; gap: 14px; position: relative; }
.lg-brand-name { font-weight: 700; letter-spacing: 2.5px; font-size: 15px; color: #e8eef7; }

.lg-brand-body { position: relative; margin: auto 0; max-width: 560px; }
.lg-brand-body h1 {
  font-size: 40px; line-height: 1.15; color: #ffffff; margin: 0 0 18px;
  font-weight: 700; letter-spacing: -.5px;
}
.lg-brand-body p { font-size: 16px; line-height: 1.65; color: #aebccd; margin: 0 0 26px; }

.lg-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lg-checklist li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: #d5deea; }
.lg-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px;
  background: rgba(23,128,61,.35); color: #7ee2a8; font-size: 12px; font-weight: 700;
}

.lg-badges { position: relative; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
.lg-badge {
  font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase;
  color: #9fb2c9; border: 1px solid rgba(198,208,221,.35);
  border-radius: 999px; padding: 6px 12px; background: rgba(255,255,255,.05);
}

/* ------------------------------------------------ form side */
.lg-form-side {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 34px 26px; min-width: 0;
}
.lg-card {
  width: 100%; max-width: 430px; background: #ffffff;
  border: 1px solid var(--border, #e3e8ef); border-radius: 14px;
  box-shadow: var(--shadow-lg, 0 8px 30px rgba(16,24,40,.12));
  padding: 30px 32px 22px;
}
.lg-card-head { display: flex; justify-content: center; margin-bottom: 18px; }
.lg-card-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text, #1c2430); }
.brand-mark.sm {
  width: 26px; height: 26px; font-size: 9px; border-radius: 7px; line-height: 26px;
}

.lg-tabs {
  display: flex; background: var(--gray-bg, #eef1f5); border-radius: 10px;
  padding: 4px; margin-bottom: 22px;
}
.lg-tab {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  padding: 9px 8px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--muted, #6b7685); font-family: inherit;
}
.lg-tab.active { background: #fff; color: var(--accent, #0b5cad); box-shadow: var(--shadow); }

.lg-screen-title { font-size: 19px; font-weight: 700; color: var(--text, #1c2430); margin: 2px 0 6px; }
.lg-sub { font-size: 13.5px; color: var(--muted, #6b7685); margin: 0 0 18px; line-height: 1.5; }
.lg-receipt {
  font-size: 14px; color: var(--text, #1c2430); line-height: 1.6;
  background: var(--gray-bg, #eef1f5); border-radius: 10px;
  padding: 14px 16px; margin: 0 0 18px;
}

.lg-field { margin-bottom: 15px; }
.lg-field > label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--muted, #6b7685);
  margin-bottom: 6px; letter-spacing: .2px;
}
.lg-field input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border, #e3e8ef); border-radius: 9px; background: #fff;
  color: var(--text, #1c2430); outline: none; font-family: inherit;
}
.lg-field input:focus { border-color: var(--accent, #0b5cad); box-shadow: 0 0 0 3px rgba(11,92,173,.12); }

.lg-pw-wrap { position: relative; }
.lg-pw-wrap input { padding-right: 42px; }
.lg-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted, #6b7685);
  cursor: pointer; padding: 5px; display: flex; border-radius: 6px;
}
.lg-eye:hover { color: var(--accent, #0b5cad); }

.lg-code { letter-spacing: 8px; text-align: center; font-size: 20px !important;
  font-family: var(--mono, monospace) !important; }
.lg-code.big { font-size: 28px !important; padding: 14px !important; letter-spacing: 14px; }

/* captcha */
.lg-captcha-row { display: flex; gap: 8px; align-items: stretch; }
.lg-captcha-img {
  border: 1px solid var(--border, #e3e8ef); border-radius: 8px; flex: 0 0 auto;
  height: 46px; width: 148px;
}
.lg-captcha-refresh {
  border: 1px solid var(--border, #e3e8ef); background: #fff; border-radius: 8px;
  width: 40px; cursor: pointer; color: var(--accent, #0b5cad);
  display: flex; align-items: center; justify-content: center;
}
.lg-captcha-refresh:hover { background: var(--accent-soft, #e8f1fb); }
.lg-captcha-input { flex: 1; min-width: 0; }

/* banners + buttons */
.lg-banner {
  border-radius: 9px; padding: 11px 13px; font-size: 13.5px; margin: 4px 0 15px;
  line-height: 1.45;
}
.lg-banner-err { background: var(--red-bg, #fdecea); color: var(--red, #b42318);
  border: 1px solid rgba(180,35,24,.25); }
.lg-banner-ok { background: var(--green-bg, #e7f6ec); color: var(--green, #17803d);
  border: 1px solid rgba(23,128,61,.25); }

.lg-submit {
  width: 100%; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--accent, #0b5cad); color: #fff; font-weight: 600;
  font-size: 14.5px; padding: 12px 16px; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.lg-submit:hover { background: #094a90; }
.lg-submit:disabled { opacity: .65; cursor: default; }

.lg-spin, .spinner.gate {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: lg-rot .8s linear infinite; display: inline-block;
}
@keyframes lg-rot { to { transform: rotate(360deg); } }

.lg-links {
  display: flex; flex-direction: column; gap: 9px; align-items: center;
  margin-top: 16px; font-size: 13.5px;
}
.lg-links a { color: var(--accent, #0b5cad); text-decoration: none; }
.lg-links a:hover { text-decoration: underline; }
.lg-back { font-weight: 600; }

.lg-copy { text-align: center; color: var(--muted, #6b7685); font-size: 12px; margin-top: 20px; }

/* ------------------------------------------------ narrow screens */
@media (max-width: 900px) {
  .lg-brand { display: none; }
  .lg-form-side { padding: 22px 16px; }
  .lg-card { padding: 24px 20px 18px; }
}
