:root {
  color-scheme: dark;
  --bg: #061426;
  --panel: rgba(7, 27, 47, .82);
  --text: #f4f8ff;
  --muted: #b0c5dc;
  --cyan: #25dcf4;
  --blue: #078cf4;
  --line: rgba(75, 174, 223, .42);
  --focus: rgba(37, 220, 244, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 16% 50%, rgba(12, 80, 122, .56), transparent 46%),
    radial-gradient(ellipse at 95% 92%, rgba(0, 132, 218, .25), transparent 38%),
    linear-gradient(120deg, #071a2d 0%, #061426 48%, #020b17 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .56;
  background:
    radial-gradient(ellipse 60% 30% at 100% 5%, rgba(0, 177, 255, .14), transparent 72%),
    linear-gradient(151deg, transparent 0 53%, rgba(31, 158, 225, .08) 53.1%, transparent 53.5% 100%);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  align-items: center;
  align-content: center;
  gap: clamp(42px, 6vw, 92px);
  width: min(100%, 1480px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(38px, env(safe-area-inset-top)) clamp(28px, 5vw, 76px) max(34px, env(safe-area-inset-bottom));
}
.brand-panel { max-width: 650px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(187, 242, 255, .72);
  border-radius: 19px;
  color: #031426;
  background: linear-gradient(145deg, #dcfbff 0%, #48e0f4 48%, #078cf4 100%);
  box-shadow: 0 10px 34px rgba(0, 174, 255, .26), inset 0 1px 0 rgba(255,255,255,.72);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -.06em;
}
.eyebrow {
  margin: 24px 0 16px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .14em;
  line-height: 1.4;
}
.brand-panel h1 {
  max-width: 660px;
  margin: 0;
  color: #f5f8ff;
  font-size: clamp(42px, 4.7vw, 68px);
  font-weight: 850;
  letter-spacing: -.052em;
  line-height: 1.02;
  text-wrap: balance;
}
.intro {
  max-width: 510px;
  margin: 24px 0 20px;
  color: #c4d6e9;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.55;
}
.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid rgba(98, 181, 222, .38);
  border-radius: 999px;
  color: #dceeff;
  background: rgba(12, 44, 70, .48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  font-size: 13px;
  line-height: 1.4;
}
.privacy-note span { color: #29e86f; font-size: 12px; text-shadow: 0 0 12px rgba(41,232,111,.55); }
.card {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-width: 0;
  justify-self: end;
  padding: clamp(26px, 3vw, 38px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(14, 42, 65, .84), rgba(5, 20, 36, .9));
  box-shadow: 0 28px 90px rgba(0,0,0,.38), inset 0 1px 0 rgba(231,250,255,.08), 0 0 36px rgba(0,156,236,.055);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.card::before {
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(151,236,255,.62), transparent);
}
.install-button {
  float: right;
  min-height: 40px;
  margin: -1px 0 8px 12px;
  padding: 8px 15px;
  border: 1px solid rgba(100, 201, 240, .64);
  border-radius: 999px;
  color: #e6f8ff;
  background: rgba(13, 48, 73, .75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.install-button:hover { border-color: var(--cyan); background: rgba(18, 74, 105, .92); transform: translateY(-1px); }
.card .eyebrow { margin: 0 0 8px; padding-top: 2px; }
.card h2 {
  margin: 0 0 6px;
  color: #f5f8ff;
  font-size: clamp(25px, 2.2vw, 31px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.18;
}
.muted { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
#auth-form { display: flex; flex-direction: column; min-width: 0; }
.card label { display: block; margin: 15px 0 7px; color: #d5e5f4; font-size: 13px; font-weight: 700; }
.card input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(88, 157, 197, .64);
  border-radius: 11px;
  outline: 0;
  color: #f5faff;
  background: rgba(2, 15, 29, .74);
  font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.card input:focus { border-color: #3bd8f5; background: rgba(2, 18, 34, .95); box-shadow: 0 0 0 3px var(--focus); }
.card input::placeholder { color: #7f9bb4; }
.password-field { position: relative; min-width: 0; }
.card .password-field input { padding-right: 84px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 65px;
  min-height: 38px;
  padding: 7px 9px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: #45e2ff;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.password-toggle:hover { background: rgba(255,255,255,.07); }
.password-toggle:focus-visible, .install-button:focus-visible, .link-button:focus-visible, .primary:focus-visible, .secondary:focus-visible { outline: 2px solid #71eaff; outline-offset: 3px; }
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 51px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}
.primary {
  width: 100%;
  margin-top: 21px;
  color: #021426;
  background: linear-gradient(100deg, #25dfed 0%, #08bdf5 52%, #078bf4 100%);
  box-shadow: 0 9px 28px rgba(0, 171, 255, .21), inset 0 1px 0 rgba(255,255,255,.35);
}
.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary:disabled, .secondary:disabled { cursor: wait; opacity: .72; }
.secondary { width: 100%; margin-top: 10px; border-color: rgba(91, 163, 204, .46); color: #eef9ff; background: rgba(25, 58, 84, .76); }
.secondary:hover { border-color: var(--cyan); background: rgba(30, 80, 111, .9); }
.actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; margin-top: 18px; }
.link-button {
  min-height: 36px;
  padding: 4px 2px;
  border: 0;
  color: #57e5ff;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(87,229,255,.74);
  text-underline-offset: 4px;
  cursor: pointer;
}
.link-button:hover { color: #a6f4ff; }
.message { min-height: 0; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.message:not(:empty) { min-height: 22px; margin-top: 10px; }
.message.error { color: #ff9aab; }
.message.success { color: #60e8b0; }
.install-help { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--cyan); border-radius: 0 9px 9px 0; color: #c5dced; background: rgba(21, 72, 100, .35); font-size: 12px; line-height: 1.5; }
.config-warning { margin-top: 12px; padding: 12px; border: 1px solid #a88436; border-radius: 10px; color: #ffe7a9; background: rgba(63, 48, 18, .72); font-size: 13px; line-height: 1.5; }
.config-warning code { color: #fff; }
.card footer { margin: 18px 0 0; padding: 14px 4px 0; border-top: 1px solid rgba(91, 153, 188, .24); color: #a8bdd0; font-size: 11px; line-height: 1.5; text-align: center; }
.account-panel { grid-column: 2; }
.account-panel h2 { margin-bottom: 12px; }
.account-panel .small { margin: 0 0 20px; color: #bfd2e7; font-size: 13px; line-height: 1.5; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    justify-items: center;
    gap: 28px;
    width: min(100%, 680px);
    padding: max(30px, env(safe-area-inset-top)) clamp(22px, 6vw, 42px) max(30px, env(safe-area-inset-bottom));
  }
  .brand-panel { width: 100%; max-width: 560px; }
  .brand-panel h1 { max-width: 560px; font-size: clamp(40px, 7.3vw, 58px); }
  .intro { margin-top: 18px; font-size: 16px; }
  .card { justify-self: center; max-width: 560px; }
  .account-panel { grid-column: 1; }
}
@media (max-width: 600px) {
  body { background: radial-gradient(ellipse at 50% 28%, rgba(9, 75, 117, .48), transparent 54%), linear-gradient(160deg, #071a2d 0%, #061426 60%, #020b17 100%); }
  .shell { gap: 22px; padding: max(25px, env(safe-area-inset-top)) 18px max(26px, env(safe-area-inset-bottom)); }
  .brand-mark { width: 58px; height: 58px; border-radius: 17px; font-size: 21px; }
  .brand-panel .eyebrow { margin: 18px 0 12px; font-size: 10px; letter-spacing: .13em; }
  .brand-panel h1 { max-width: 470px; font-size: clamp(35px, 9.6vw, 44px); line-height: 1.04; }
  .intro { max-width: 440px; margin: 15px 0 14px; font-size: 15px; line-height: 1.48; }
  .privacy-note { gap: 8px; padding: 9px 12px; font-size: 11px; }
  .card { padding: 23px 20px 19px; border-radius: 22px; }
  .card h2 { font-size: 25px; }
  .muted { margin-bottom: 17px; font-size: 14px; }
  .card label { margin-top: 13px; }
  .card input { height: 49px; font-size: 16px; }
  .primary, .secondary { min-height: 52px; }
  .actions { gap: 6px 12px; margin-top: 14px; }
  .link-button { min-height: 40px; font-size: 12px; }
  .card footer { margin-top: 14px; padding-top: 12px; font-size: 10px; }
  .account-panel { grid-column: 1; }
}
@media (max-width: 370px) {
  .shell { padding-right: 14px; padding-left: 14px; }
  .card { padding-right: 17px; padding-left: 17px; }
  .brand-panel h1 { font-size: 34px; }
  .actions { gap: 4px 9px; }
  .link-button { font-size: 11px; }
}
@media (max-height: 700px) and (min-width: 901px) {
  .shell { padding-top: 26px; padding-bottom: 26px; gap: 38px; }
  .brand-panel h1 { font-size: clamp(40px, 4.2vw, 58px); }
  .brand-panel .eyebrow { margin-top: 17px; }
  .intro { margin-top: 16px; margin-bottom: 14px; }
  .card { padding-top: 25px; padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
