:root {
  color-scheme: dark;
  --ink: #edf8ff;
  --muted: #9aafc4;
  --line: #263e51;
  --primary: #65e1d4;
  --danger: #ffb0b0;
  --font: 'Public Sans', 'Cairo', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #050d18; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased;
  background: #050d18; overflow-x: hidden;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 5px; }
[hidden] { display: none !important; }

/* Quiet ambient motion stays behind the form, with no layout animation. */
.network-space { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.space-nebula { position: absolute; inset: 0; background:
  radial-gradient(ellipse at 50% 42%, #123e514f, transparent 52%),
  radial-gradient(ellipse at 13% 22%, #084b643d, transparent 38%),
  radial-gradient(ellipse at 92% 80%, #15307552, transparent 44%); }
.space-stars { position: absolute; inset: 0; opacity: .45; background-image:
  radial-gradient(1.4px 1.4px at 20% 35%, #d4f5ff 75%, transparent),
  radial-gradient(1px 1px at 70% 65%, #5a8f9f 99%, transparent),
  radial-gradient(1.3px 1.3px at 40% 85%, #d9e9ff 75%, transparent);
  background-size: 173px 191px, 247px 263px, 311px 337px; }
.orbit { position: absolute; left: 50%; top: 47%; border: 1px solid #5ebdcb12;
  border-radius: 50%; transform: translate(-50%, -50%) rotate(-24deg); }
.orbit-one { width: 64vw; height: 52vh; }
.orbit-two { width: 86vw; height: 77vh; transform: translate(-50%, -50%) rotate(18deg); }
.orbit-three { width: 108vw; height: 100vh; }
.network-links { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .17;
  transition: opacity .8s; }
.network-links line { stroke: #73c9d9; stroke-width: .55; vector-effect: non-scaling-stroke; }
.network-node { position: absolute; display: grid; place-items: center;
  width: 37px; height: 37px; border: 1px solid #6197ab35; border-radius: 50%;
  background: #0b1b2a; color: #7394a6; opacity: .45; transform: translate(-50%, -50%);
  transition: opacity .9s; }
.network-node svg { width: 23px; height: 23px; }
.node-router { width: 53px; height: 53px; border-radius: 15px; color: #67d7cc;
  border-color: #67d7cc42; background: #0b242d; opacity: .65; }
.node-router svg { width: 32px; height: 32px; }
.protocol { position: absolute; font-size: clamp(11px, 1.2vw, 17px); font-weight: 500;
  letter-spacing: .18em; direction: ltr; color: #75b8c5; opacity: .5;
  transition: opacity .8s; }
.p1 { left: 13%; top: 43%; color: #71e4d4; }
.p2 { right: 13%; top: 28%; color: #83caff; }
.p3 { left: 29%; top: 18%; }
.p4 { right: 16%; bottom: 20%; font-size: 12px; }
.p5 { left: 18%; bottom: 25%; }
.p6 { right: 31%; top: 12%; }

html:not(.login-intro) .space-stars { animation: stars-breathe 7s ease-in-out infinite alternate; }
.space-stars::after { content: ''; position: absolute; inset: -16px;
  background: radial-gradient(2px 2px at 28% 17%, #d4fff5 35%, transparent),
    radial-gradient(1.6px 1.6px at 74% 64%, #c2e0ff 30%, transparent);
  background-size: 287px 239px, 389px 321px;
  animation: star-drift 18s ease-in-out infinite alternate; }
html:not(.login-intro) .protocol { animation: protocol-glow 5s ease-in-out infinite alternate;
  text-shadow: 0 0 9px #70d9e080, 0 0 23px #70d9e04d; }
html:not(.login-intro) .p2 { animation-delay: -3s; }
html:not(.login-intro) .p3 { animation-delay: -1s; }
html:not(.login-intro) .p4 { animation-delay: -4s; }
html:not(.login-intro) .p5 { animation-delay: -2s; }
html:not(.login-intro) .p6 { animation-delay: -5s; }
.network-links .network-pulse { stroke: #a0fff0; stroke-width: 1.7;
  stroke-dasharray: 3 97; stroke-dashoffset: 103;
  animation: link-travel 9s linear infinite; }
.login-intro .network-pulse { visibility: hidden; }
.space-meteor { position: absolute; width: 210px; height: 1.5px; opacity: 0;
  background: linear-gradient(90deg, #e5fff9, #8fe8deaa 25%, #68cecd25 65%, transparent);
  transform: rotate(-32deg); animation: meteor-pass 17s linear infinite; }
.space-meteor::before { content: ''; position: absolute; left: 0; top: -1px;
  width: 4px; height: 4px; border-radius: 50%; background: #edfffa; box-shadow: 0 0 12px #b3ffe9; }
.meteor-one { left: 82%; top: 10%; animation-delay: -5s; }
.meteor-two { left: 36%; top: 20%; animation-duration: 23s; animation-delay: -11s; }
.meteor-three { left: 96%; top: 56%; animation-duration: 29s; animation-delay: -18s; }
.login-intro .space-meteor { visibility: hidden; }
@keyframes stars-breathe { from { opacity: .42; } to { opacity: .88; } }
@keyframes star-drift { from { transform: translate3d(-8px, -10px, 0); opacity: .5; }
  to { transform: translate3d(14px, 16px, 0); opacity: 1; } }
@keyframes protocol-glow { from { opacity: .45; } to { opacity: .95; } }
@keyframes link-travel { 0% { stroke-dashoffset: 103; opacity: 0; }
  8%, 65% { opacity: 1; } 80%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes meteor-pass {
  0%, 72% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-32deg); }
  74%, 77% { opacity: .85; }
  84%, 100% { opacity: 0; transform: translate3d(-36vw, 22vh, 0) rotate(-32deg); }
}
.background-paused .network-space *, .background-paused .network-space *::after {
  animation-play-state: paused !important;
}

.intro-emblem { position: fixed; left: 50%; top: 47%; z-index: 2;
  width: min(340px, 90vw); text-align: center;
  transform: translate(-50%, -50%) scale(.85); opacity: 0; visibility: hidden;
  transition: opacity .5s, transform .7s, visibility .5s; pointer-events: none; }
.intro-emblem .logo-badge { position: relative; width: 116px; height: 116px;
  filter: drop-shadow(0 0 32px #21d3d04f); }
.emblem-aura { position: absolute; width: 250px; height: 250px; top: -65px; left: 50%;
  transform: translateX(-50%); border-radius: 50%; border: 1px solid #4cddca25;
  box-shadow: 0 0 100px #33caba16, inset 0 0 65px #38d3c414; }
.intro-wordmark { font-size: 26px; letter-spacing: .19em; font-weight: 700; margin-top: 22px; }
.intro-wordmark span { color: #75e2d8; font-weight: 400; }
.intro-emblem p { font-size: 14px; color: #adc1ce; margin: 14px 0 25px; }
.intro-rule { display: block; width: 40px; height: 2px; background: #75e2d8; margin: auto; }
.intro-skip { position: fixed; z-index: 8; bottom: 28px; left: 50%; transform: translateX(-50%);
  border: 1px solid #73b9c13d; border-radius: 30px; background: #0b1b2be6;
  color: #c0d2df; padding: 10px 20px; font-size: 12px; cursor: pointer; }
.intro-skip span { margin-right: 14px; }
.login-intro .intro-emblem { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1);
  animation: emblem-arrive 3.9s both; }
.login-intro .network-node { opacity: .9; animation: network-assemble 2.5s cubic-bezier(.22,.7,.22,1) both;
  animation-delay: var(--delay); }
.login-intro .network-links { animation: links-arrive 3.9s both; }
.login-intro .protocol { animation: protocol-arrive 3.9s both; opacity: .9; }
.login-intro .orbit { animation: orbit-arrive 3.9s both; }
@keyframes network-assemble {
  0% { opacity: 0; transform: translate(var(--sx), var(--sy)) rotate(var(--turn)) scale(.5); }
  18% { opacity: .9; }
  100% { transform: translate(-50%, -50%) rotate(0) scale(1); }
}
@keyframes emblem-arrive {
  0%, 25% { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
  65%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes links-arrive { 0%, 30% { opacity: 0; } 70%, 100% { opacity: .4; } }
@keyframes protocol-arrive {
  0%, 35% { opacity: 0; translate: 0 16px; }
  75%, 100% { opacity: .9; translate: 0 0; }
}
@keyframes orbit-arrive { 0%, 25% { opacity: 0; } 80%, 100% { opacity: 1; } }

.card-wrap { position: relative; z-index: 3; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 90px 24px 38px; transition: opacity .7s, transform .7s, visibility .7s; }
.login-intro .card-wrap { opacity: 0; visibility: hidden; transform: translateY(32px) scale(.96);
  pointer-events: none; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .eyebrow { display: inline-flex; align-items: center; gap: 10px;
  color: #a1bdcb; font-size: 10px; letter-spacing: .25em; margin-bottom: 12px; }
.login-brand .eyebrow::before, .login-brand .eyebrow::after { content: ''; width: 23px; height: 1px; background: #63dfca75; }
.login-brand .wordmark { font-size: 25px; letter-spacing: .12em; font-weight: 700; }
.login-brand .wordmark span { color: #6ce2d3; font-weight: 400; }
.login-brand p { color: #92a9bb; font-size: 12px; margin: 9px 0 0; }
.card { width: 100%; max-width: 420px; margin: 0; position: relative;
  padding: 30px 32px 24px; border: 1px solid #385266; border-radius: 24px;
  background: linear-gradient(145deg, #112436f5, #0a1627fa);
  box-shadow: 0 25px 80px #0006, 0 0 70px #3ab7bd08, inset 0 1px #c9f8ff0c; }
.card::before { content: ''; position: absolute; top: -1px; left: 25%; width: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, #77e5d5, transparent); }
.card .h { margin-bottom: 24px; }
.card h2 { margin: 0; font-size: 23px; font-weight: 800; }
.card .sub { color: var(--muted); font-size: 12.5px; margin-top: 7px; line-height: 1.9; }
.err, .notice { padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 1.8;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.err { color: var(--danger); background: #fb718514; border: 1px solid #fb71854d; }
.notice { color: #87e6db; background: #5eead414; border: 1px solid #5eead447; }
.field { margin-bottom: 18px; }
.field label { display: flex; align-items: center; gap: 6px; font-weight: 600;
  font-size: 12px; margin-bottom: 8px; color: #c0d1de; }
.field .ip { position: relative; }
.field .ip i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: #7796ad; font-size: 16px; pointer-events: none; }
.field input { width: 100%; min-height: 50px; padding: 12px 42px 12px 14px;
  border: 1px solid #2b4357; border-radius: 11px; background: #06121e80;
  color: var(--ink); font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field input::placeholder { color: #7d94a7; font-size: 12px; }
.field input:hover { border-color: #506d80; }
.field input:focus { border-color: #63dacc; box-shadow: 0 0 0 3px #63dacc17; }
.field .hint { color: var(--muted); font-size: 11px; line-height: 1.9; margin-top: 7px; }
.btn { width: 100%; min-height: 49px; padding: 12px 16px; border: 1px solid #adfff02e;
  border-radius: 11px; font-weight: 800; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(115deg, #55d5c4, #80e8cf); color: #062e31;
  box-shadow: 0 6px 24px #4dd7c31a; transition: filter .2s, transform .2s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.signup-cta { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.signup-cta a { display: inline-flex; align-items: center; gap: 6px;
  color: #8aeadb; font-weight: 700; text-decoration: none; padding: 7px 10px; }
.signup-cta a:hover { color: #fff; }
.foot-line { margin-top: 20px; color: #8299ac; font-size: 10px; text-align: center; }
.foot-line strong { color: #a4b8c8; font-weight: 500; letter-spacing: .08em; }
.realm-toggle { background: transparent; border: 0; color: var(--primary); cursor: pointer;
  font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; }
.realm-toggle:hover { text-decoration: underline; }
.company-chip { display: flex; align-items: center; gap: 9px; padding: 11px 13px;
  border-radius: 10px; margin-bottom: 18px; background: #5eead409; border: 1px solid #5eead42e;
  font-weight: 700; font-size: 13px; color: #d6eee9; }
.company-chip > i { color: var(--primary); }
.top-tab { position: absolute; top: 24px; right: 28px; z-index: 5;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 30px;
  font-size: 11px; font-weight: 600; text-decoration: none;
  background: #0d2031b3; color: #bdcfdd; border: 1px solid #345163; }
.top-tab:hover { border-color: #73d7ca; color: #fff; }
.top-tab i { color: #73d7ca; }
.scene-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 22px; gap: 4px; }
.intro-replay, .motion-toggle { padding: 9px 14px; background: transparent; border: 0;
  color: #8ca9bb; font-size: 11px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.intro-replay:hover, .motion-toggle:hover { color: #bdf5ee; }
.demo-roles { display: grid; gap: 10px; margin: 4px 0 16px; }
.demo-role { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #06121e80;
  color: var(--ink); cursor: pointer; text-align: start; }
.demo-role:hover, .demo-role.main { border-color: #58c5b978; background: #5eead40a; }
.demo-role .ri { width: 36px; height: 36px; border-radius: 10px; display: grid;
  place-items: center; flex: none; font-size: 17px; background: #5eead414; color: var(--primary); }
.demo-role b { display: block; font-size: 14px; }
.demo-role small { color: var(--muted); font-size: 11px; }
.demo-role > .bi-arrow-left { margin-inline-start: auto; color: var(--primary); }
.demo-note { font-size: 11px; color: #abc0d0; line-height: 1.9; padding: 11px;
  border-radius: 10px; background: #80b8d40b; }
@media (max-width: 600px) {
  .card-wrap { padding: 82px 20px 24px; }
  .card { padding: 25px 23px 22px; border-radius: 20px; }
  .login-brand { margin-bottom: 20px; }
  .login-brand .wordmark { font-size: 23px; }
  .top-tab { top: 18px; right: 20px; padding: 8px 13px; font-size: 10px; }
  .network-node { width: 25px; height: 25px; opacity: .25; }
  .network-node svg { width: 17px; height: 17px; }
  .node-router { width: 35px; height: 35px; border-radius: 10px; }
  .node-router svg { width: 24px; height: 24px; }
  .network-links { opacity: .12; }
  .protocol { font-size: 10px; opacity: .35; letter-spacing: .1em; }
  .p1 { left: 6%; top: 29%; }
  .p2 { right: 6%; top: 68%; }
  .p3 { left: 10%; top: 14%; }
  .p4 { right: 8%; bottom: 13%; font-size: 10px; }
  .p5 { left: 7%; bottom: 20%; }
  .p6 { right: 16%; top: 19%; }
  .orbit-one { width: 110vw; }
  .orbit-two { width: 160vw; }
  .orbit-three { width: 210vw; }
  .space-meteor { width: 125px; }
  .meteor-three { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .login-intro .card-wrap { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  .intro-emblem, .intro-skip, .intro-replay, .motion-toggle, .space-meteor, .network-pulse { display: none !important; }
}
