:root {
  color-scheme: dark;
  color: #eaf0fc;
  background: #03050a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --accent: #7597f8;
  --line: rgba(147, 172, 235, .14);
  --muted: #8998b5;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 28px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(70, 105, 207, .18), transparent 29rem),
    radial-gradient(circle at 88% 82%, rgba(43, 92, 179, .11), transparent 25rem),
    linear-gradient(145deg, #050810, #020307 70%);
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .23;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(400px, 1.08fr);
  width: min(960px, 100%);
  min-height: 600px;
  overflow: hidden;
  border: 1px solid rgba(144, 167, 224, .15);
  border-radius: 32px;
  background: rgba(7, 11, 20, .94);
  box-shadow: 0 40px 110px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(20px);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-width: 0;
  padding: clamp(34px, 5vw, 58px);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 25% 18%, rgba(100, 136, 239, .2), transparent 18rem),
    linear-gradient(155deg, rgba(25, 39, 77, .58), rgba(7, 12, 24, .82));
}

.hero::after {
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(129, 159, 239, .13);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 45px rgba(94,129,219,.035), 0 0 0 90px rgba(94,129,219,.02);
}

.hero-brand, .hero-message, .hero-features, .hero > div { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 14px; }

.hero-logo {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  overflow: hidden;
  border: 1px solid rgba(157,181,244,.18);
  border-radius: 20px;
  background: rgba(8,14,28,.62);
  box-shadow: 0 16px 40px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.06);
}
.hero-logo img { display: block; max-width: 50px; max-height: 50px; object-fit: contain; }
.hero-eyebrow, .auth-heading > span, .access-info > span {
  color: #8fabf6;
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .14em;
}
.hero-title { max-width: 380px; margin: 0 0 10px; color: #f5f8ff; font-size: clamp(2rem, 4vw, 3.25rem); line-height: .98; letter-spacing: -.055em; }
.hero-subtitle { max-width: 360px; margin: 0; color: #9eacc7; font-size: .96rem; line-height: 1.55; }
.hero-message { margin-top: auto; }
.hero-message strong { display: block; max-width: 350px; color: #eaf0ff; font-size: 1.18rem; line-height: 1.3; }
.hero-message p { max-width: 370px; margin: 9px 0 0; color: #8999b6; font-size: .82rem; line-height: 1.6; }
.hero-features { display: flex; flex-wrap: wrap; gap: 9px 15px; }
.hero-features span { display: inline-flex; align-items: center; gap: 7px; color: #aebbd3; font-size: .7rem; }
.hero-features i { width: 6px; height: 6px; border-radius: 50%; background: #7ca3ff; box-shadow: 0 0 12px rgba(124,163,255,.8); }

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(34px, 6vw, 66px);
  background: linear-gradient(165deg, rgba(10,15,27,.96), rgba(5,8,15,.98));
}
.auth-heading { margin-bottom: 27px; }
.auth-heading h2 { margin: 9px 0 7px; color: #f4f7fe; font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.035em; }
.auth-heading p { margin: 0; color: var(--muted); font-size: .85rem; }
.login-form { display: grid; gap: 17px; }
.field { display: grid; gap: 8px; }
.field label { color: #aebbd2; font-size: .75rem; font-weight: 700; }
.input-wrap { position: relative; }
.input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: #7183a6;
  stroke-width: 1.7;
  pointer-events: none;
}
.field input {
  width: 100%;
  min-height: 54px;
  padding: 13px 15px 13px 46px;
  border: 1px solid rgba(137,160,218,.15);
  border-radius: 15px;
  outline: none;
  color: #eef3ff;
  background: rgba(5,9,17,.82);
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input::placeholder { color: #596780; }
.field input:focus { border-color: #688dea; background: #080e1b; box-shadow: 0 0 0 4px rgba(91,130,226,.12); }
.password-input-wrap input { padding-right: 88px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  min-height: 36px;
  padding: 7px 10px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  color: #aebee0;
  background: rgba(100,133,213,.12);
  cursor: pointer;
  font: inherit;
  font-size: .68rem;
  font-weight: 750;
}
.password-toggle:hover, .password-toggle:focus-visible { color: #eef4ff; background: rgba(100,133,213,.22); outline: none; }
.submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  margin-top: 3px;
  padding: 13px 18px;
  border: 1px solid #7699ed;
  border-radius: 15px;
  color: #f8faff;
  background: linear-gradient(135deg, #3159a7, #527bd8);
  box-shadow: 0 15px 34px rgba(40,75,157,.24);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.submit:hover:not(:disabled), .submit:focus-visible { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 18px 38px rgba(40,75,157,.32); }
.submit b { font-size: 1.12rem; }
.submit:disabled { cursor: wait; opacity: .78; }
.submit.is-loading b { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }

.error {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding: 12px 13px;
  border: 1px solid rgba(248,113,113,.2);
  border-radius: 13px;
  color: #fecaca;
  background: rgba(127,29,29,.14);
}
.error span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(248,113,113,.12); font-weight: 850; }
.error p { margin: 0; font-size: .75rem; line-height: 1.4; }

.access-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.065);
}
.access-info > span { grid-column: 1 / -1; color: #7186b5; font-size: .58rem; }
.access-info p { margin: 0; color: #7787a2; font-size: .72rem; }
.access-info a { display: inline-flex; align-items: center; gap: 7px; color: #bcd0ff; font-size: .72rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.access-info a:hover { color: #fff; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  body { display: block; padding: 0; background: #050811; }
  .login-shell { grid-template-columns: 1fr; width: 100%; min-height: 100dvh; border: 0; border-radius: 0; }
  .hero { justify-content: flex-start; gap: 18px; padding: 28px 22px 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-brand { justify-content: space-between; }
  .hero-logo { width: 58px; height: 58px; flex-basis: 58px; border-radius: 17px; }
  .hero-logo img { max-width: 43px; max-height: 43px; }
  .hero-title { max-width: none; margin-bottom: 7px; font-size: 1.85rem; }
  .hero-subtitle { font-size: .83rem; }
  .hero-message, .hero-features { display: none; }
  .auth-panel { justify-content: flex-start; padding: 30px 22px calc(34px + env(safe-area-inset-bottom)); }
  .auth-heading { margin-bottom: 24px; }
}

@media (max-width: 390px) {
  .hero { padding: 22px 17px 24px; }
  .auth-panel { padding: 26px 17px calc(28px + env(safe-area-inset-bottom)); }
  .field input, .submit { min-height: 52px; }
  .access-info { grid-template-columns: 1fr; }
  .access-info a { margin-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}