:root {
  color-scheme: dark;
  --bg: #061526;
  --bg-soft: #08223a;
  --panel: #0b2d49;
  --panel-strong: #0d3554;
  --line: #22628d;
  --line-soft: rgba(103, 178, 229, .25);
  --text: #f5f8fc;
  --muted: #91abc1;
  --blue: #2d96f5;
  --blue-strong: #1776cf;
  --green: #22c874;
  --amber: #f4b63e;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 84% 8%, rgba(35, 126, 191, .24), transparent 30rem),
    linear-gradient(135deg, #061526 0%, #072139 52%, #061827 100%);
}

a { color: inherit; }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 58px 0 34px; }
.hero { display: flex; align-items: center; gap: 26px; padding-bottom: 48px; }
.hero-product { padding-bottom: 28px; }
.brand-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  padding: 9px;
  border: 1px solid rgba(126, 190, 232, .35);
  border-radius: 50%;
  background: rgba(255,255,255,.94);
}
.eyebrow { margin: 0 0 8px; color: #56adfa; font-size: .78rem; font-weight: 850; letter-spacing: .22em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.02; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.02em; }
.subtitle { margin-bottom: 0; color: #a8c0d4; font-size: 1.08rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 18px 0 20px; }
.security-chip, .channel, .status {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .75rem;
  font-weight: 800;
}
.security-chip::before { content: "●"; margin-right: 7px; color: var(--green); }
.app-grid, .version-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.app-card, .version-card, .install-help, .notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(14, 54, 84, .97), rgba(8, 39, 64, .97));
  box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}
.app-card { display: flex; flex-direction: column; min-height: 290px; padding: 24px; }
.app-card img { width: 58px; height: 58px; object-fit: contain; padding: 6px; border-radius: 15px; background: rgba(255,255,255,.94); }
.app-card h3 { margin: 18px 0 8px; font-size: 1.35rem; }
.app-card p { color: var(--muted); line-height: 1.55; }
.app-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding: 14px 0; }
.status.available { color: #65eca2; border-color: rgba(34, 200, 116, .35); background: rgba(34, 200, 116, .1); }
.status.planned { color: #c4d1dd; }
.channel { color: #83c5ff; }
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px solid #319cf4;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue-strong), var(--blue));
  font-weight: 850;
  text-decoration: none;
  transition: transform .16s ease, filter .16s ease;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button.disabled { pointer-events: none; color: var(--muted); border-color: var(--line-soft); background: rgba(255,255,255,.035); }
.back-link { display: inline-block; margin-bottom: 30px; color: #75bdff; font-weight: 750; text-decoration: none; }
.notice { display: flex; gap: 12px; padding: 16px 20px; color: #dbe8f3; }
.notice strong { color: var(--amber); white-space: nowrap; }
.muted, .loading { color: var(--muted); }
.version-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.version-card { display: flex; flex-direction: column; min-height: 440px; padding: 24px; }
.version-head { display: flex; justify-content: space-between; gap: 14px; }
.version-number { margin: 4px 0 0; font-size: 1.7rem; font-weight: 900; }
.version-card.current { border-color: #289cf5; box-shadow: 0 0 0 1px rgba(45,150,245,.18), 0 18px 42px rgba(0,0,0,.2); }
.version-card dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 22px 0 16px; }
.version-card dt { color: var(--muted); }
.version-card dd { margin: 0; text-align: right; }
.hash { min-height: 76px; margin: 4px 0 16px; color: #78a2c2; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; overflow-wrap: anywhere; }
.notes { margin: 0 0 20px; padding-left: 18px; color: #b9cada; line-height: 1.45; font-size: .88rem; }
.version-card .button { margin-top: auto; }
.install-help { margin-top: 28px; padding: 24px 28px; }
.install-help ol { margin: 16px 0 0; padding-left: 22px; color: #b9cada; line-height: 1.8; }
footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 42px; padding: 22px 0; border-top: 1px solid var(--line-soft); color: #7595ad; font-size: .8rem; }
.portal-login { display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(420px, 100%); overflow: hidden; border: 1px solid #285677; border-radius: 22px; background: linear-gradient(160deg, #102f50, #0b2744); box-shadow: 0 24px 65px rgba(0,0,0,.3); text-align: center; }
.auth-brand { padding: 28px 30px 0; }
.auth-brand img { display: block; width: 104px; height: 92px; margin: 0 auto 16px; object-fit: contain; }
.auth-brand > h1, .auth-brand > p:not(.auth-description) { display: none; }
.auth-environment { display: inline-flex; padding: 5px 10px; border: 1px solid rgba(244,63,94,.5); border-radius: 6px; color: #fb7185; background: rgba(190,24,93,.12); font-size: .68rem; font-weight: 900; letter-spacing: .14em; }
.auth-brand h2 { margin: 14px 0 7px; font-size: 2rem; line-height: 1.08; }
.auth-description { margin: 0 0 18px; color: #a8c0d4; font-size: .94rem; line-height: 1.45; white-space: nowrap; }
.auth-card { padding: 25px 30px 0; text-align: left; }
.auth-form { display: grid; }
.auth-form > label { margin: 0 0 7px; color: #dce9f4; font-size: .86rem; font-weight: 850; }
.auth-form > label:not(:first-child) { margin-top: 15px; }
.auth-input-wrap { position: relative; }
.auth-input-wrap input { display: block; width: 100%; height: 52px; padding: 0 48px; border: 1px solid #315b7c; border-radius: 11px; outline: 0; background: #071a2e; color: #f5f8fc; font-family: inherit; font-size: .95rem; font-weight: 600; }
.auth-input-wrap input::placeholder { color: #718ba3; }
.auth-input-wrap input:hover { border-color: #4382aa; }
.auth-input-wrap input:focus { border-color: #2d96f5; box-shadow: 0 0 0 3px rgba(45,150,245,.16); }
.auth-input-icon, .password-toggle { position: absolute; top: 50%; transform: translateY(-50%); color: #60aaf5; }
.auth-input-icon { left: 15px; width: 21px; height: 21px; pointer-events: none; }
.auth-input-icon svg, .password-toggle svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle { right: 12px; width: 32px; height: 32px; padding: 6px; border: 0; background: transparent; cursor: pointer; }
.password-toggle:hover { color: #9dd0ff; }
.auth-error { min-height: 18px; margin: 10px 0 0; color: #fb7185; font-size: .82rem; font-weight: 750; text-align: center; }
.auth-submit { width: 100%; min-height: 50px; margin-top: 5px; border: 0; border-radius: 10px; cursor: pointer; letter-spacing: .05em; }
.auth-submit:disabled { cursor: wait; opacity: .7; }
.remember-login { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 15px 0 0 !important; color: #adc2d5 !important; cursor: pointer; }
.remember-login input { width: 21px; height: 21px; margin: 0; accent-color: #2d96f5; }
.forgot-link { justify-self: center; margin-top: 10px; padding: 3px; border: 0; color: #66b4fa; background: transparent; font-family: inherit; font-size: .84rem; font-weight: 800; line-height: 1.2; cursor: pointer; }
.forgot-link:hover { text-decoration: underline; }
.forgot-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.forgot-panel[hidden] { display: none; }
.forgot-panel form { display: grid; gap: 9px; }
.forgot-panel label { color: #dce9f4; font-size: .84rem; font-weight: 800; }
.forgot-panel input { height: 46px; padding: 0 13px; border: 1px solid #315b7c; border-radius: 10px; outline: 0; background: #071a2e; color: #f5f8fc; font: inherit; }
.forgot-panel .button { min-height: 44px; border-radius: 10px; cursor: pointer; }
.forgot-panel p { min-height: 18px; margin: 2px 0 0; color: #9fc5e4; font-size: .78rem; text-align: center; }
.auth-credit { display: grid; justify-content: center; gap: 5px; width: 100%; margin: 19px auto 0; padding: 0 30px 22px; border: 0; color: #6686a3; font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-align: center; }
.auth-credit strong { color: #587895; font-size: .68rem; }

@media (max-width: 820px) {
  .app-grid, .version-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 580px) {
  .shell { width: min(100% - 24px, 1080px); padding-top: 30px; }
  .hero { align-items: flex-start; gap: 15px; padding-bottom: 30px; }
  .brand-logo { width: 64px; height: 64px; }
  h1 { font-size: 2rem; }
  .subtitle { font-size: .94rem; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .app-grid, .version-grid { grid-template-columns: 1fr; }
  .notice { flex-direction: column; }
  footer { flex-direction: column; }
  .portal-login { padding: 14px; }
  .auth-brand { padding: 24px 20px 0; }
  .auth-card { padding: 22px 20px 0; }
  .auth-description { font-size: .78rem; white-space: normal; }
  .auth-brand img { width: 96px; height: 86px; }
}
