:root {
  color-scheme: dark;
  --bg: #04162b;
  --surface: #08355a;
  --surface-2: #0b4674;
  --line: #25608b;
  --text: #f0f8ff;
  --muted: #b3d6ef;
  --accent: #6ed7ff;
  --accent-2: #086cb4;
  --orange: #096cb0;
  --radius: 28px;
  --shadow: 0 28px 80px rgba(0, 5, 13, .38);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.login-body {
  color-scheme: dark;
  --text: #f2f9ff;
  --muted: #b2ccde;
  --accent: #65d9df;
  --line: rgba(158, 205, 229, .25);
  background:
    radial-gradient(circle at 25% 12%, rgba(22, 105, 150, .18), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(38, 160, 170, .08), transparent 36%),
    #070e18;
}

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card {
  width: min(100%, 470px);
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(155deg, #102b41, #0a1725);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: -40% auto auto 45%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(62, 202, 224, .13);
  filter: blur(60px);
  pointer-events: none;
}
.brand-mark, .brand-symbol {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #127bbb, #08848f);
  color: #ffffff;
  font-weight: 950;
  transform: skew(-8deg);
}
.brand-mark { width: 58px; height: 58px; border-radius: 18px; margin-bottom: 38px; font-size: 1.55rem; }
.brand-mark span, .brand-symbol { transform: skew(8deg); }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: .78rem; font-weight: 850; letter-spacing: .15em; }
.login-card h1 { margin: 0; font-size: clamp(3.2rem, 12vw, 5rem); letter-spacing: -.075em; line-height: .95; }
.login-card h1 span, .accent { color: var(--accent); }
.login-copy { margin: 24px 0 34px; color: var(--muted); font-size: 1.04rem; line-height: 1.55; }
.login-form label { display: block; margin-bottom: 10px; font-size: .9rem; font-weight: 700; }
.password-row { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.password-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(55,193,211,.15); }
.password-row input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 17px 18px; color: var(--text); background: transparent; font-size: 1rem; }
.eye-button { width: 54px; align-self: stretch; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.15rem; }
.form-error { color: #ff8d7b; margin: 10px 0 0; font-size: .9rem; }
.primary-button {
  width: 100%; margin-top: 18px; border: 0; border-radius: 16px; padding: 17px 20px;
  display: flex; align-items: center; justify-content: space-between;
  color: #ffffff; background: var(--accent-2); font-weight: 850; cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.primary-button:hover { background: #075b95; transform: translateY(-2px); }
.login-body .primary-button { background: #65d9df; color: #082e50; }
.login-body .primary-button:hover { background: #8be8ec; }
.privacy-note { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 28px 0 0; color: var(--muted); font-size: .78rem; }
.privacy-note span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }

.topbar { height: 78px; padding: 0 clamp(22px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(5,7,6,.82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; font-weight: 900; letter-spacing: -.035em; }
.brand-symbol { width: 34px; height: 34px; border-radius: 10px; font-size: .85rem; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.live-pill, .server-chip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: #c7d1cf; background: rgba(255,255,255,.035); font-size: .83rem; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.logout { color: var(--muted); font-size: .86rem; }
.logout:hover { color: var(--text); }

.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 560px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 70px; padding: 74px 0 54px; border-bottom: 1px solid var(--line); }
.hero h1 { margin: 0; max-width: 760px; font-size: clamp(2.6rem, 5.4vw, 4.8rem); line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; }
.hero h1 span { color: #85918e; }
.hero-copy > p:last-child { max-width: 620px; margin: 30px 0 0; color: var(--muted); font-size: 1.1rem; line-height: 1.6; }
.connection-orbit { width: min(360px, 72vw); aspect-ratio: 1; display: grid; place-items: center; position: relative; justify-self: center; }
.orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(20,215,187,.25); }
.orbit-a { inset: 0; animation: pulse 3.4s ease-in-out infinite; }
.orbit-b { inset: 15%; border-color: rgba(20,215,187,.5); animation: pulse 3.4s 1s ease-in-out infinite; }
.power-core { width: 50%; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, #143d36, #08110f 68%); box-shadow: 0 0 80px rgba(20,215,187,.22), inset 0 0 0 1px rgba(255,255,255,.08); }
.power-icon { font-size: 2.4rem; color: var(--accent); line-height: 1; }
.power-core strong { margin-top: 8px; font-size: .85rem; letter-spacing: .18em; }
.power-core small { margin-top: 8px; color: var(--muted); }
@keyframes pulse { 50% { transform: scale(1.035); opacity: .55; } }

.protocols { padding: 74px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-heading h2, .check-card h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.055em; }
.protocol-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tab-button { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; text-align: left; color: var(--muted); background: var(--surface); cursor: pointer; font-weight: 800; transition: .2s ease; }
.tab-button span { margin-right: 12px; color: #53605d; font-size: .78rem; }
.tab-button:hover, .tab-button.active { color: var(--text); border-color: rgba(20,215,187,.48); background: linear-gradient(120deg, rgba(20,215,187,.12), rgba(20,215,187,.035)); }
.tab-button.active span { color: var(--accent); }
.protocol-panel { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
.panel-main, .qr-card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.panel-main { padding: clamp(28px, 5vw, 56px); }
.panel-kicker { color: var(--accent); font-size: .72rem; letter-spacing: .13em; font-weight: 850; }
.panel-main h3 { margin: 13px 0 12px; font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.055em; }
.panel-main > p { max-width: 700px; color: var(--muted); line-height: 1.6; }
.steps { list-style: none; padding: 0; margin: 34px 0; display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: rgba(20,215,187,.1); color: var(--accent); font-size: .82rem; font-weight: 900; }
.steps strong { display: block; font-size: 1rem; }
.steps p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.key-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); background: #070a09; border-radius: 17px; padding: 14px; }
.key-box small, .credential-grid small { display: block; margin-bottom: 7px; color: #65716e; font-size: .68rem; letter-spacing: .12em; font-weight: 800; }
.key-box code { display: block; max-width: 610px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #b9c5c2; font-size: .78rem; }
.copy-button, .credential-grid button { border: 1px solid rgba(20,215,187,.25); border-radius: 12px; padding: 11px 14px; color: var(--accent); background: rgba(20,215,187,.08); cursor: pointer; font-weight: 750; font-size: .8rem; }
.qr-card { padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.qr-frame { width: 100%; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 24px; padding: 16px; border-radius: 24px; background: white; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder { color: #06110e; font-weight: 950; font-size: 2rem; }
.qr-card strong { font-size: 1.05rem; }
.qr-card p { margin: 8px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }
.download-button { width: fit-content; min-width: 290px; }
.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.credential-grid > div { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #070a09; }
.credential-grid code { display: block; overflow-wrap: anywhere; min-height: 42px; color: #dbe4e2; }
.credential-grid button { margin-top: 12px; }
.check-card { margin-bottom: 74px; padding: clamp(28px, 5vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 40px; border: 1px solid rgba(255,122,0,.22); border-radius: var(--radius); background: linear-gradient(115deg, rgba(255,122,0,.09), rgba(255,122,0,.015)); }
.check-card p:last-child { max-width: 680px; margin: 14px 0 0; color: var(--muted); line-height: 1.55; }
.check-card > a { flex: 0 0 auto; padding: 16px 20px; border-radius: 14px; background: var(--orange); color: #160900; font-weight: 900; }
footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: #68736f; font-size: .82rem; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 999px; background: var(--text); color: #06110e; font-size: .84rem; font-weight: 850; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reference blues: saturated blue surfaces, sky highlights, dark contrast. */
.dashboard-body {
  background-color: #050f20;
  background-image:
    radial-gradient(ellipse 680px 540px at 87% 230px, rgba(28,157,216,.24), transparent 72%),
    radial-gradient(ellipse 850px 660px at -12% 80px, rgba(17,88,167,.34), transparent 74%),
    radial-gradient(ellipse 600px 800px at 106% 58%, rgba(30,105,181,.20), transparent 75%),
    radial-gradient(ellipse 700px 450px at 10% 94%, rgba(27,150,180,.13), transparent 74%),
    linear-gradient(160deg, #071327 0%, #050e1b 38%, #081b32 72%, #050e1c 100%);
  background-repeat: no-repeat;
}
.topbar { background: rgba(4,26,49,.94); box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.live-pill, .server-chip { color: #c1e7ff; background: #0b426b; }
.live-pill i { background: #64d5ff; box-shadow: 0 0 0 4px rgba(100,213,255,.12); }
.hero h1 span { color: #7dceff; }
.orbit { border-color: rgba(99,193,255,.35); }
.orbit-b { border-color: rgba(100,213,255,.6); }
.power-core {
  color: #f2f9ff;
  background: radial-gradient(circle at 40% 20%, #1585c3, #084779 55%, #052440);
  box-shadow: 0 0 80px rgba(28,161,229,.28), inset 0 0 0 1px rgba(125,218,241,.4);
}
.power-icon { color: #83e1ff; }
.power-core small { color: #c0e2fa; }
.tab-button span { color: #a4cde8; }
.tab-button:hover, .tab-button.active {
  color: #f0f8ff;
  border-color: #56bdf0;
  background: linear-gradient(120deg, #086daf, #094b7f);
}
.panel-main, .qr-card { box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.steps li > span { background: #0b4c79; }
.key-box, .credential-grid > div { background: #052541; }
.key-box small, .credential-grid small { color: #a7cce7; }
.key-box code, .credential-grid code { color: #c7e5fa; }
.copy-button, .credential-grid button {
  color: #91ddff; border-color: #267aaa; background: #094774;
}
.copy-button:hover, .credential-grid button:hover { background: #09659b; border-color: #69caff; }
.qr-frame { max-width: 230px; box-shadow: 0 12px 34px rgba(0,0,0,.18); border: 1px solid #31495b; }
.qr-placeholder { color: #10365c; }
.check-card {
  color: #f2f9ff;
  border-color: #217eaf;
  background: linear-gradient(115deg, #0b5687, #073055);
}
.check-card .eyebrow { color: #85dbff; }
.check-card p:last-child { color: #c0def3; }
.check-card > a { background: #79d5ff; color: #052642; }
.check-card > a:hover { background: #a4e6ff; }
footer {
  width: 100%; max-width: none; margin: 0;
  padding: 32px max(20px, calc((100% - 1180px) / 2)) 40px;
  border-color: #20567f; background: linear-gradient(110deg, #0b426b, #052747); color: #b8d9ef;
}
.toast { background: #0a6098; color: #f0f8ff; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.login-body { --accent: #7bd8ff; --muted: #b3d6ef; background: radial-gradient(ellipse at 20% 15%, #0c6397, transparent 65%), #041c35; }
.login-card { background: linear-gradient(145deg, #0b4b78, #062a4a); }
.login-card::before { background: rgba(64,177,246,.2); }
.login-body .primary-button { background: #7bd8ff; color: #052642; }
.login-body .primary-button:hover { background: #a4e6ff; }
.brand-mark, .brand-symbol { background: none; border-radius: 0; transform: none; }
.brand { font-size: 2rem; line-height: 1.1; gap: 12px; white-space: nowrap; }
.brand-symbol { width: 54px; height: 54px; flex: 0 0 auto; }
.brand-mark { width: 80px; height: 80px; margin-bottom: 26px; }
.brand-mark img, .brand-symbol img { display: block; width: 100%; height: 100%; object-fit: contain; }
.client-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 24px; }
.client-picker a { display: flex; align-items: center; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .875rem; font-weight: 750; }
.client-picker a[aria-current] { border-color: var(--accent); background: #09659b; }
.client-notice { padding: 14px; border-left: 3px solid var(--accent); background: #052541; font-size: .9rem; }
.client-note { font-size: .875rem; }
.rules-link { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.hero-copy, .panel-main, .qr-card, .steps li > div, .key-box > div { min-width: 0; }
.steps p, .panel-main > p, .check-card p, footer { overflow-wrap: anywhere; }
.eye-button { flex: 0 0 48px; min-height: 48px; }
.logout { display: inline-flex; align-items: center; min-height: 44px; }
.copy-button, .credential-grid button { min-height: 44px; }
.login-shell { min-height: 100svh; }
.toast { max-width: calc(100vw - 32px); bottom: max(20px, env(safe-area-inset-bottom)); text-align: center; }
:is(a, button, input):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.eyebrow, .panel-kicker { font-size: .875rem; }
.key-box small, .credential-grid small { font-size: .75rem; }

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 62px; }
  .connection-orbit { width: 280px; }
  .protocol-panel { grid-template-columns: 1fr; }
  .qr-card { max-width: none; }
  .qr-frame { width: min(330px, 100%); }
  .server-chip { display: none; }
}

@media (max-width: 620px) {
  .login-shell { padding: 14px; }
  .login-card { padding: 34px 24px; border-radius: 26px; }
  .topbar { min-height: 68px; height: auto; gap: 12px; padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); }
  .brand { font-size: 1.65rem; gap: 8px; }
  .brand-symbol { width: 44px; height: 44px; }
  .live-pill { width: 10px; height: 10px; padding: 0; border: 0; font-size: 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
  .live-pill i { display: none; }
  .top-actions { gap: 14px; }
  .app-shell { width: min(100% - 28px, 1180px); }
  .hero { min-height: auto; padding: 34px 0 32px; gap: 24px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 3.2rem); }
  .hero-copy > p:last-child { font-size: 1rem; }
  .connection-orbit { width: min(250px, 100%); }
  .power-core { width: 68%; padding: 16px 10px; text-align: center; }
  .power-icon { font-size: 2rem; }
  .power-core strong { margin-top: 6px; font-size: .875rem; line-height: 1.25; letter-spacing: .14em; }
  .power-core small { margin-top: 6px; font-size: .875rem; line-height: 1.3; white-space: nowrap; }
  .protocols { padding: 34px 0; }
  .protocol-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tab-button { min-height: 48px; padding: 12px 4px; text-align: center; font-size: .875rem; border-radius: 14px; }
  .tab-button span { display: none; }
  .panel-main, .qr-card { border-radius: 22px; padding: 22px 18px; }
  .panel-main h3 { font-size: clamp(1.65rem, 7.5vw, 2.3rem); overflow-wrap: anywhere; }
  .section-heading h2, .check-card h2 { font-size: 2rem; }
  .steps { margin: 24px 0; }
  .steps li { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .steps li > span { width: 30px; height: 30px; }
  .key-box { grid-template-columns: 1fr; }
  .copy-button { width: 100%; }
  .credential-grid { grid-template-columns: 1fr; }
  .download-button { width: 100%; min-width: 0; }
  .check-card { align-items: stretch; flex-direction: column; gap: 24px; padding: 24px 20px; margin-bottom: 34px; }
  .check-card > a { text-align: center; }
  footer { flex-direction: column; width: 100%; padding-inline: 20px; }
}

@media (max-width: 360px) {
  .brand { font-size: 1.4rem; }
  .brand-symbol { width: 38px; height: 38px; }
  .top-actions { gap: 8px; }
  .login-card { padding: 28px 20px; }
}

@media (hover: none) {
  .primary-button:hover { transform: none; }
}

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