:root {
  --login-bg: #f7f9fc;
  --login-panel: rgba(255, 255, 255, 0.96);
  --login-panel-strong: #ffffff;
  --login-navy: #132647;
  --login-navy-soft: #41516c;
  --login-gold: #d79a2b;
  --login-gold-soft: rgba(215, 154, 43, 0.14);
  --login-line: #dde4ee;
  --login-shadow: 0 24px 60px rgba(16, 30, 60, 0.12);
  --login-shadow-soft: 0 12px 28px rgba(16, 30, 60, 0.08);
  --login-text: #18243c;
  --login-text-soft: #5f6d85;
  --login-success: #2c8a68;
  --login-warn: #d79a2b;
  --login-danger: #c14545;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.login-body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(215, 154, 43, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(19, 38, 71, 0.08), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, var(--login-bg) 100%);
  color: var(--login-text);
  font-family: "Segoe UI", Arial, sans-serif;
}

.icon-defs { position: absolute; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 12px;
}

.login-layout {
  width: min(100%, 1460px);
  min-height: calc(100vh - 24px);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  background: var(--login-panel);
  border: 1px solid rgba(218, 227, 239, 0.9);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--login-shadow);
}

.brand-panel,
.form-panel {
  position: relative;
  min-width: 0;
}

.brand-panel {
  padding: 28px 30px 18px;
  background:
    radial-gradient(circle at 82% 34%, rgba(215, 154, 43, 0.09), transparent 24%),
    radial-gradient(circle at 14% 92%, rgba(91, 117, 176, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247,250,255,0.98) 100%);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(215, 154, 43, 0.26);
  background: rgba(255,255,255,0.92);
  display: grid;
  place-items: center;
  color: var(--login-gold);
  box-shadow: var(--login-shadow-soft);
}

.brand-logo svg {
  width: 30px;
  height: 30px;
}

.brand-copy strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--login-navy);
}

.brand-copy span {
  display: block;
  margin-top: 5px;
  color: var(--login-navy-soft);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.brand-content {
  max-width: 500px;
  padding-top: 28px;
  position: relative;
  z-index: 3;
}

.brand-eyebrow {
  margin: 0 0 10px;
  color: var(--login-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-content h1 {
  margin: 0;
  max-width: 420px;
  font-size: clamp(30px, 3.5vw, 44px);
  line-height: 1.08;
  font-weight: 700;
  color: var(--login-navy);
}

.brand-content h1 span {
  color: var(--login-gold);
}

.brand-description {
  max-width: 430px;
  margin: 14px 0 18px;
  color: var(--login-text-soft);
  font-size: 14px;
  line-height: 1.48;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  max-width: 390px;
}

.feature-list li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  max-width: 390px;
}

.feature-list li + li {
  padding-top: 10px;
  border-top: 1px solid rgba(213, 223, 236, 0.9);
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  box-shadow: var(--login-shadow-soft);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-gold { background: rgba(215, 154, 43, 0.14); color: var(--login-gold); }
.feature-blue,
.feature-green,
.feature-purple { background: rgba(19, 38, 71, 0.08); color: var(--login-navy); }

.feature-list strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  color: var(--login-navy);
}

.feature-list p {
  margin: 0;
  color: var(--login-text-soft);
  line-height: 1.38;
  font-size: 13px;
}

.brand-illustration {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 42%;
  height: 42%;
  pointer-events: none;
  opacity: 0.72;
  z-index: 1;
  overflow: hidden;
}

.halo {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
}

.halo-gold {
  width: 180px;
  height: 180px;
  right: 54px;
  top: 18px;
  background: rgba(215, 154, 43, 0.08);
}

.halo-navy {
  width: 320px;
  height: 320px;
  right: -36px;
  bottom: -96px;
  background: rgba(19, 38, 71, 0.08);
}

.skyline-grid {
  position: absolute;
  width: 92px;
  height: 92px;
  background-image: radial-gradient(rgba(33, 63, 114, 0.34) 1.6px, transparent 1.6px);
  background-size: 22px 22px;
  opacity: 0.5;
}

.skyline-grid-top { right: 86px; top: 8px; }
.skyline-grid-bottom { right: 26px; bottom: 34px; background-image: radial-gradient(rgba(215, 154, 43, 0.52) 1.6px, transparent 1.6px); }

.skyline-art {
  position: absolute;
  left: 12%;
  right: 0;
  bottom: 0;
  width: 96%;
  height: auto;
}

.ground-line,
.tower-gold,
.tower-muted,
.tree-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ground-line { stroke: rgba(83, 102, 133, 0.22); stroke-width: 2.2; }
.tower-gold { stroke: rgba(215, 154, 43, 0.92); stroke-width: 2.2; }
.tower-muted { stroke: rgba(95, 112, 145, 0.38); stroke-width: 2; }
.tree-line { stroke: rgba(95, 112, 145, 0.42); stroke-width: 2; }
.sun-disc { fill: rgba(215, 154, 43, 0.28); }

.form-panel {
  background:
    radial-gradient(circle at 18% 22%, rgba(215, 154, 43, 0.08), transparent 20%),
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(252,253,255,0.99) 100%);
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card {
  margin: auto;
  width: min(100%, 500px);
  padding: 0 8px;
  text-align: center;
}

.login-card-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--login-gold);
  background: var(--login-gold-soft);
  box-shadow: inset 0 0 0 1px rgba(215, 154, 43, 0.14);
}

.login-card-icon svg {
  width: 16px;
  height: 16px;
}

.login-card h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.08;
  color: var(--login-navy);
}

.login-card > p {
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--login-text-soft);
}

.login-form {
  display: grid;
  gap: 11px;
  text-align: left;
}

.field > span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--login-navy);
}

.field-input {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(220, 229, 240, 0.9);
  border-radius: 13px;
  background: rgba(255,255,255,0.96);
  padding: 0 11px;
  box-shadow: var(--login-shadow-soft);
}

.field-input:focus-within {
  border-color: rgba(19, 38, 71, 0.42);
  box-shadow: 0 0 0 4px rgba(19, 38, 71, 0.06);
}

.field-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #98a5ba;
  flex: 0 0 auto;
}

.field-icon svg,
.password-toggle svg {
  width: 17px;
  height: 17px;
}

.field-input input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  min-width: 0;
  min-height: 40px;
  padding: 0 8px;
  color: var(--login-text);
  font-size: 13px;
  outline: none;
}

.field-input input::placeholder {
  color: #97a4b9;
}

.password-toggle {
  min-height: 0;
  padding: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #97a4b9;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.password-toggle:hover {
  background: rgba(19, 38, 71, 0.06);
  box-shadow: none;
  transform: none;
}

.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -1px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--login-text);
  cursor: pointer;
  font-size: 13px;
}

.checkbox-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-icon {
  width: 20px;
  height: 20px;
  color: #c4cede;
}

.checkbox-row input:checked + .checkbox-icon {
  color: var(--login-gold);
}

.link-primary {
  color: #2449d8;
  text-decoration: none;
  font-weight: 500;
}

.link-primary:hover {
  text-decoration: underline;
}

.signin-btn {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #132647 0%, #0d1c35 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 20px 34px rgba(13, 28, 53, 0.22);
}

.signin-btn:hover {
  background: linear-gradient(180deg, #19305a 0%, #102140 100%);
}

.btn-lock {
  width: 16px;
  height: 16px;
  color: var(--login-gold);
}

.btn-lock svg {
  width: 14px;
  height: 14px;
}

.form-footer {
  margin: 0;
  text-align: center;
  color: var(--login-text-soft);
  font-size: 13px;
}

body[data-theme="dark"] {
  --login-bg: #0f1726;
  --login-panel: rgba(17, 27, 45, 0.98);
  --login-panel-strong: #12203a;
  --login-navy: #eef3fb;
  --login-navy-soft: #b7c4d8;
  --login-line: rgba(102, 122, 157, 0.32);
  --login-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  --login-shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.24);
  --login-text: #edf3fb;
  --login-text-soft: #aeb9cd;
}

body[data-theme="dark"] .login-layout {
  background: rgba(14, 23, 38, 0.96);
  border-color: rgba(69, 89, 122, 0.38);
}

body[data-theme="dark"] .brand-panel {
  background:
    radial-gradient(circle at 82% 34%, rgba(215, 154, 43, 0.12), transparent 24%),
    radial-gradient(circle at 14% 92%, rgba(91, 117, 176, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(15,22,36,0.98) 0%, rgba(18,28,47,0.98) 100%);
}

body[data-theme="dark"] .form-panel {
  background:
    radial-gradient(circle at 18% 22%, rgba(215, 154, 43, 0.1), transparent 20%),
    linear-gradient(180deg, rgba(14,22,38,0.98) 0%, rgba(16,25,43,0.99) 100%);
}

body[data-theme="dark"] .brand-logo,
body[data-theme="dark"] .field-input {
  background: rgba(18, 30, 50, 0.96);
  border-color: rgba(86, 107, 141, 0.34);
}

body[data-theme="dark"] .field-input input,
body[data-theme="dark"] .checkbox-row {
  color: var(--login-text);
}

body[data-theme="dark"] .field-input input::placeholder {
  color: #7f91af;
}

body[data-theme="dark"] .password-toggle,
body[data-theme="dark"] .field-icon,
body[data-theme="dark"] .checkbox-icon {
  color: #8395b3;
}

@media (max-width: 1180px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 480px;
  }

  .brand-illustration {
    left: 34%;
    height: 40%;
  }

  .form-panel {
    padding-top: 18px;
  }

  .login-card {
    padding-bottom: 14px;
  }
}

@media (max-width: 780px) {
  .login-shell {
    padding: 12px;
  }

  .login-layout {
    min-height: auto;
    border-radius: 22px;
  }

  .brand-panel,
  .form-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .brand-content {
    padding-top: 24px;
  }

  .brand-content h1 {
    font-size: 32px;
  }

  .brand-description {
    font-size: 16px;
  }

  .feature-list li {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .brand-illustration {
    position: relative;
    left: auto;
    right: auto;
    height: 220px;
    margin-top: 12px;
    opacity: 0.5;
  }

  .login-card h2 {
    font-size: 28px;
  }

  .signin-btn {
    min-height: 50px;
    font-size: 17px;
  }

  .form-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

.login-message {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.login-message.is-error {
  background: #fff4f2;
  color: #b42318;
  border: 1px solid #f5c2ba;
}

.login-message.is-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.signin-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}
