:root {
  color-scheme: dark;
  --bg: #050914;
  --bg-mid: #06101c;
  --panel: #091322;
  --panel-deep: #07101d;
  --text: #eff8ff;
  --muted: #8ba1b8;
  --faint: #5f748b;
  --line: rgba(130, 174, 224, .15);
  --line-strong: rgba(53, 231, 255, .4);
  --accent: #35e7ff;
  --accent-rgb: 53, 231, 255;
  --accent-2: #8b7cff;
  --accent-2-rgb: 139, 124, 255;
  --green: #39e6a3;
  --green-rgb: 57, 230, 163;
  --red: #ff7188;
  --red-rgb: 255, 113, 136;
  --amber: #ffc766;
  --amber-rgb: 255, 199, 102;
  --surface: rgba(7, 15, 27, .88);
  --surface-2: rgba(7, 14, 25, .96);
  --surface-deep: rgba(7, 14, 25, .98);
  --input: rgba(3, 10, 19, .72);
  --input-focus: rgba(4, 13, 24, .94);
  --well: rgba(255, 255, 255, .03);
  --inset-hi: rgba(255, 255, 255, .035);
  --hi: #ffffff;
  --text-bright: #e6f2fb;
  --grid-line: rgba(107, 151, 196, .09);
  --h1-mid: #b7efff;
  --h1-end: #bdb6ff;
  --shadow: 0 38px 120px rgba(0, 0, 0, .56);
  --shadow-menu: 0 18px 45px rgba(0, 0, 0, .42);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 13% 10%, rgba(var(--accent-rgb), .11), transparent 31rem),
    radial-gradient(circle at 88% 88%, rgba(var(--accent-2-rgb), .12), transparent 34rem),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-mid) 52%, var(--bg) 100%);
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 27rem;
  height: 27rem;
  border-radius: 50%;
  filter: blur(95px);
  pointer-events: none;
  opacity: .16;
}

.ambient-a { top: -15rem; left: -9rem; background: var(--accent); }
.ambient-b { right: -12rem; bottom: -17rem; background: var(--accent-2); }

.grid-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .72), transparent 86%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 48px));
  min-height: min(640px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(390px, .82fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--inset-hi);
  backdrop-filter: blur(24px);
}

.welcome-panel {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 42px 46px 34px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), .075), transparent 42%),
    linear-gradient(320deg, rgba(var(--accent-2-rgb), .1), transparent 43%),
    var(--panel);
}

.welcome-panel::after {
  content: "";
  position: absolute;
  width: 30rem;
  height: 30rem;
  left: 49%;
  top: 51%;
  border: 1px solid rgba(var(--accent-rgb), .07);
  border-radius: 50%;
  box-shadow:
    0 0 0 5rem rgba(var(--accent-rgb), .018),
    0 0 0 10rem rgba(var(--accent-rgb), .014);
  pointer-events: none;
}

.brand-lockup, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}



.brand-mark img {
  width: 60px;
  height: 60px;
}

.brand-name { display: grid; gap: 2px; }
.brand-name strong { font-size: 18px; letter-spacing: .02em; }
.brand-name small { color: var(--faint); font: 600 11px var(--mono); letter-spacing: .1em; }

.partner-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 5px;
  color: var(--muted);
}

.partner-brand[hidden] { display: none; }
.partner-brand > i { color: var(--faint); font-style: normal; }
.partner-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.partner-logo { width: 28px; height: 28px; display: grid; place-items: center; }
.partner-logo[hidden] { display: none; }
.partner-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.welcome-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 19px;
  color: var(--accent);
  font: 700 10px var(--mono);
  letter-spacing: .17em;
}

.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(var(--green-rgb), .8);
  animation: pulse 1.8s ease-in-out infinite;
}

.welcome-copy h1 {
  margin: 0;
  font-size: clamp(42px, 4.5vw, 60px);
  line-height: 1.16;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.welcome-copy h1 b { font: inherit; color: inherit; }

.welcome-copy h1 span {
  background: linear-gradient(100deg, var(--accent), var(--h1-mid) 46%, var(--h1-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-lead {
  max-width: 520px;
  margin: 21px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.signal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid rgba(var(--accent-rgb), .16);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--inset-hi);
}

.signal-visual {
  position: relative;
  width: 54px;
  height: 54px;
}

.signal-core {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), .65);
}

.orbit {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(var(--accent-rgb), .27);
  border-radius: 50%;
}

.orbit-b { inset: 0; border-color: rgba(var(--accent-2-rgb), .22); }
.signal-node { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.node-a { left: 8px; top: 14px; }
.node-b { right: 5px; top: 26px; background: var(--accent-2); }
.node-c { left: 25px; bottom: 1px; background: var(--green); }

.signal-copy { min-width: 0; display: grid; gap: 3px; }
.signal-copy > span { color: var(--accent); font: 700 9px var(--mono); letter-spacing: .14em; }
.signal-copy strong { font-size: 13px; }
.signal-copy small { color: var(--faint); font-size: 11px; line-height: 1.5; }
.signal-status { display: flex; align-items: center; gap: 6px; color: var(--faint); font: 600 9px var(--mono); white-space: nowrap; }
.signal-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(var(--green-rgb), .65); }

.login-company-endorsement {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(var(--accent-rgb), .13);
}
.login-company-endorsement small {
  color: var(--faint);
  font: 700 8px var(--mono);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.login-company-endorsement img { display: block; width: 82px; height: auto; }
.login-company-mobile { display: none; }

.auth-panel {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 48px 34px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--well), transparent 18%),
    var(--surface-2);
}

.auth-preferences { position: absolute; z-index: 20; top: 23px; right: 25px; display: flex; align-items: flex-start; gap: 8px; }
.language-picker, .theme-picker { position: relative; }
.language-toggle { min-width: 82px; height: 36px; padding: 0 11px; border: 1px solid rgba(var(--accent-2-rgb), .3); border-radius: 9px; background: rgba(var(--accent-2-rgb), .07); color: var(--accent-2); font: 700 12px var(--mono); cursor: pointer; }
.language-toggle:hover { border-color: rgba(var(--accent-2-rgb), .58); background: rgba(var(--accent-2-rgb), .13); color: var(--accent-2); }
.language-menu { position: absolute; right: 0; top: calc(100% + 7px); min-width: 118px; padding: 5px; border: 1px solid rgba(var(--accent-2-rgb), .34); border-radius: 10px; background: var(--surface-deep); box-shadow: var(--shadow-menu); }
.language-menu[hidden] { display: none; }
.language-menu button { width: 100%; height: 32px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 7px; padding: 0 9px; background: transparent; color: var(--muted); font: 600 11px var(--mono); cursor: pointer; }
.language-menu button:hover { background: rgba(var(--accent-2-rgb), .11); color: var(--text); }
.language-menu button.is-selected { background: rgba(var(--accent-2-rgb), .14); color: var(--accent-2); }
.language-menu button.is-selected::after { content: "✓"; color: var(--accent-2); }

.mobile-brand { display: none; }
.auth-heading { margin-bottom: 30px; }
.step-label { margin: 0 0 14px; color: var(--accent); font: 700 9px var(--mono); letter-spacing: .15em; }
.auth-heading h2 { margin: 0; font-size: 38px; line-height: 1.15; letter-spacing: -.035em; }
.auth-heading > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.page-notice {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin: -7px 0 17px;
  padding: 10px 11px;
  border: 1px solid rgba(var(--accent-rgb), .18);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), .055);
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
}

.page-notice[hidden] { display: none; }
.page-notice i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.page-notice.warning { border-color: rgba(var(--amber-rgb), .22); background: rgba(var(--amber-rgb), .06); color: var(--amber); }
.page-notice.warning i { background: var(--amber); }
.page-notice.success { border-color: rgba(var(--green-rgb), .2); background: rgba(var(--green-rgb), .06); color: var(--green); }
.page-notice.success i { background: var(--green); }

#authForm { display: grid; gap: 21px; }
.field { display: grid; gap: 9px; color: var(--text); font-size: 15px; font-weight: 700; }
.field[hidden] { display: none; }
.field > span:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.field > span:first-child small { color: var(--faint); font-size: 9px; font-weight: 500; }

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell input {
  width: 100%;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--input);
  padding: 0 43px;
  color: var(--text);
  font-size: 16px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.input-shell input::placeholder { color: var(--faint); }
.input-shell input:hover { border-color: var(--line-strong); }
.input-shell input:focus { border-color: var(--line-strong); background: var(--input-focus); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .065), 0 0 24px rgba(var(--accent-rgb), .045); }
.input-shell input[aria-invalid="true"] { border-color: rgba(var(--red-rgb), .58); box-shadow: 0 0 0 3px rgba(var(--red-rgb), .06); }

.field-icon {
  position: absolute;
  z-index: 1;
  left: 15px;
  width: 13px;
  height: 13px;
  color: var(--faint);
  pointer-events: none;
}

.account-icon, .user-icon { border: 1px solid currentColor; border-radius: 50%; }
.account-icon::after, .user-icon::after { content: ""; position: absolute; left: -3px; right: -3px; bottom: -7px; height: 7px; border: 1px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; }
.user-icon::before { content: ""; position: absolute; width: 3px; height: 3px; right: -5px; bottom: -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), .7); }
.lock-icon { top: 22px; height: 11px; border: 1px solid currentColor; border-radius: 3px; }
.lock-icon::before { content: ""; position: absolute; left: 2px; top: -7px; width: 7px; height: 7px; border: 1px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; }

.field-help { color: var(--faint); font-size: 9px; font-weight: 500; line-height: 1.45; }
.field-help.warning { color: var(--amber); }
.field-help[hidden] { display: none; }

.form-message {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: -3px;
  padding: 9px 10px;
  border: 1px solid rgba(var(--red-rgb), .24);
  border-radius: 9px;
  background: rgba(var(--red-rgb), .06);
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
}

.form-message[hidden] { display: none; }
.form-message i { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: rgba(var(--red-rgb), .15); font: 700 10px var(--mono); }
.form-message.success { border-color: rgba(var(--green-rgb), .24); background: rgba(var(--green-rgb), .06); color: var(--green); }
.form-message.success i { background: rgba(var(--green-rgb), .15); }

.submit-button {
  position: relative;
  height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), .55);
  border-radius: 11px;
  background: linear-gradient(110deg, rgba(var(--accent-rgb), .95), rgba(var(--accent-rgb), .86));
  padding: 0 18px;
  color: #021018;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(var(--accent-rgb), .13), inset 0 1px 0 rgba(255, 255, 255, .42);
  transition: transform .15s, filter .15s, box-shadow .15s;
}

.submit-button::before {
  content: "";
  position: absolute;
  width: 90px;
  height: 100%;
  left: -110px;
  transform: skewX(-20deg);
  background: rgba(255, 255, 255, .25);
  transition: left .45s;
}

.submit-button:hover { filter: brightness(1.04); box-shadow: 0 13px 35px rgba(var(--accent-rgb), .2); }
.submit-button:hover::before { left: calc(100% + 30px); }
.submit-button:active { transform: translateY(1px); }
.submit-button:disabled { cursor: wait; filter: saturate(.55); opacity: .7; }
.submit-button > span { position: relative; z-index: 1; text-align: center; }
.submit-button > i { position: relative; z-index: 1; width: 9px; height: 9px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.submit-button.loading > i { width: 14px; height: 14px; border: 2px solid rgba(2, 16, 24, .25); border-top-color: #021018; border-radius: 50%; transform: none; animation: spin .7s linear infinite; }

.mode-hint { margin: 17px 0 0; color: var(--faint); font-size: 10px; text-align: center; }
.mode-hint button { border: 0; background: none; padding: 2px 4px; color: var(--accent); font-size: inherit; cursor: pointer; }
.mode-hint button:hover { text-decoration: underline; }
.mode-hint button:disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }
.admin-entry{margin-top:18px;padding:14px 15px;display:flex;align-items:center;gap:11px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--muted);text-decoration:none;transition:border-color .18s,color .18s}.admin-entry:hover{border-color:var(--line-strong);color:var(--accent)}.admin-entry>i{width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 10px rgba(var(--accent-rgb),.55)}.admin-entry span{display:grid}.admin-entry strong{font-size:14px;color:var(--text)}.admin-entry b{margin-left:auto;font-size:20px;font-weight:400}

.noscript { position: fixed; z-index: 5; left: 50%; bottom: 20px; transform: translateX(-50%); border: 1px solid rgba(255, 113, 136, .3); border-radius: 9px; background: #25111a; padding: 9px 13px; color: #ffc0ca; font-size: 12px; }

@keyframes pulse { 50% { opacity: .45; box-shadow: 0 0 4px rgba(var(--green-rgb), .35); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 880px) {
  body { align-items: start; }
  .auth-shell {
    width: min(520px, calc(100vw - 28px));
    min-height: 0;
    margin: 22px 0;
    grid-template-columns: 1fr;
  }
  .welcome-panel { display: none; }
  .auth-panel { min-height: calc(100dvh - 44px); padding: 34px 38px 28px; border-left: 0; }
  .mobile-brand { display: flex; margin-bottom: auto; padding-bottom: 44px; }
  .mobile-brand > span:last-child { display: grid; gap: 2px; }
  .mobile-brand strong { font-size: 18px; }
  .mobile-brand small { color: var(--faint); font: 600 10px var(--mono); letter-spacing: .09em; }
  .login-company-mobile { display: flex; margin-top: 24px; }
}

@media (max-width: 520px) {
  body { display: block; }
  .auth-shell { width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .auth-panel { min-height: 100dvh; justify-content: flex-start; padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)); }
  .auth-preferences { top: max(21px, env(safe-area-inset-top)); right: 18px; }
  .mobile-brand { margin: 0 0 44px; padding: 0; }
  .auth-heading h2 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fa;
  --bg-mid: #e7edf5;
  --panel: #ffffff;
  --panel-deep: #eef3f9;
  --text: #16283d;
  --muted: #4f647c;
  --faint: #8496ab;
  --line: rgba(23, 54, 94, .14);
  --line-strong: rgba(6, 120, 160, .45);
  --accent: #2296a6;
  --accent-rgb: 34, 150, 166;
  --accent-2: #6459b8;
  --accent-2-rgb: 100, 89, 184;
  --green: #149f73;
  --green-rgb: 20, 159, 115;
  --red: #d14b63;
  --red-rgb: 209, 75, 99;
  --amber: #b07d1f;
  --amber-rgb: 176, 125, 31;
  --surface: rgba(255, 255, 255, .88);
  --surface-2: #ffffff;
  --surface-deep: #ffffff;
  --input: #ffffff;
  --input-focus: #ffffff;
  --well: rgba(23, 54, 94, .05);
  --inset-hi: rgba(255, 255, 255, .55);
  --hi: #0d1c30;
  --text-bright: #16283d;
  --grid-line: rgba(23, 54, 94, .07);
  --h1-mid: #0e9ec9;
  --h1-end: #6a58e8;
  --shadow: 0 24px 70px rgba(23, 54, 94, .18);
  --shadow-menu: 0 18px 45px rgba(23, 54, 94, .2);
}
