:root {
  --auth-yellow: #ffca28;
  --auth-bg: #08090a;
  --auth-surface: #111214;
  --auth-border: rgba(255, 255, 255, 0.12);
  --auth-muted: #9c9da1;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--auth-bg);
  color: #f8f8f8;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
select { font: inherit; }

.standalone-only { display: none; }
html.standalone-mode .browser-install-only { display: none !important; }
html.standalone-mode .standalone-only { display: inline; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(420px, 0.92fr);
  min-height: 100dvh;
}

.auth-visual {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,202,40,.2), transparent 24%),
    radial-gradient(circle at 74% 68%, rgba(255,202,40,.07), transparent 30%),
    linear-gradient(145deg, #171717 0%, #08090a 72%);
}

.auth-visual::before,
.auth-visual::after { content: ''; position: absolute; width: 78%; height: 18%; border: 1px solid rgba(255,202,40,.13); border-radius: 999px; transform: rotate(-28deg); }
.auth-visual::before { left: -18%; top: 21%; }
.auth-visual::after { right: -24%; bottom: 24%; border-color: rgba(255,255,255,.07); }

.auth-visual-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 35%, rgba(0,0,0,.88) 100%);
}

.auth-visual-copy {
  position: absolute;
  left: clamp(32px, 5vw, 76px);
  right: clamp(32px, 5vw, 76px);
  bottom: clamp(42px, 8vh, 90px);
}

.auth-visual-copy span,
.auth-kicker {
  margin: 0 0 13px;
  color: var(--auth-yellow);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-visual-copy h2 {
  margin: 0;
  font-size: clamp(37px, 4.3vw, 68px);
  line-height: .98;
  letter-spacing: -.055em;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: max(30px, env(safe-area-inset-top)) clamp(28px, 6vw, 92px) max(32px, env(safe-area-inset-bottom));
}

.auth-panel-inner { width: min(100%, 470px); }

.auth-brand {
  display: inline-block;
  width: 196px;
  margin-bottom: clamp(52px, 9vh, 104px);
  text-decoration: none;
}
.auth-brand-mark { width: 100%; }

.auth-heading h1 {
  margin: 0 0 13px;
  font-size: clamp(35px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -.055em;
}

.auth-heading > p:last-child {
  max-width: 430px;
  margin: 0;
  color: #a9aaae;
  font-size: 17px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 18px 0 22px;
  padding: 5px;
  border: 1px solid var(--auth-border);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
}

.auth-gate-note { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: center; margin: 24px 0 0; padding: 14px; border: 1px solid rgba(255,202,40,.2); border-radius: 14px; background: rgba(255,202,40,.065); }
.auth-gate-note > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #0a0a0b; background: var(--auth-yellow); font-size: 19px; }
.auth-gate-note span { min-width: 0; }
.auth-gate-note strong,
.auth-gate-note small { display: block; }
.auth-gate-note strong { font-size: 13px; }
.auth-gate-note small { margin-top: 4px; color: var(--auth-muted); font-size: 11px; line-height: 1.4; }

.auth-journey {
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  list-style: none;
}

.auth-journey li {
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--auth-border);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}

.auth-journey li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  z-index: 1;
  width: 8px;
  height: 1px;
  background: rgba(255,255,255,.16);
}

.auth-journey li.active { border-color: rgba(255,202,40,.32); background: rgba(255,202,40,.075); }
.auth-journey i { flex: 0 0 auto; color: var(--auth-yellow); font-size: 19px; }
.auth-journey span,
.auth-journey strong,
.auth-journey small { display: block; min-width: 0; }
.auth-journey strong { font-size: 11px; }
.auth-journey small { margin-top: 2px; overflow: hidden; color: var(--auth-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.auth-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--auth-muted);
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button.active { background: #292a2d; color: #fff; }

.auth-form { display: grid; gap: 16px; }
.auth-form[hidden] { display: none; }

.auth-form label { display: grid; gap: 8px; }
.auth-form label > span { color: #dedee0; font-size: 14px; font-weight: 700; }

.auth-form input,
.auth-form select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--auth-border);
  border-radius: 13px;
  outline: 0;
  background: var(--auth-surface);
  color: #fff;
  font-size: 17px;
  transition: border-color .18s, box-shadow .18s;
}

.auth-form select {
  appearance: none;
  padding: 0 44px;
  cursor: pointer;
}

.auth-form input:focus {
  border-color: var(--auth-yellow);
  box-shadow: 0 0 0 3px rgba(255,202,40,.13);
}

.auth-invite-only-note { padding: 14px; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 11px; align-items: center; border: 1px solid rgba(255,202,40,.35); border-radius: 15px; background: rgba(255,202,40,.08); }
.auth-invite-only-note > i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--auth-yellow); color: #111; font-size: 20px; }
.auth-invite-only-note strong,.auth-invite-only-note small { display: block; }
.auth-invite-only-note strong { font-size: 13px; }
.auth-invite-only-note small { margin-top: 4px; color: #b8b3aa; font-size: 10px; line-height: 1.4; }
.invite-code-input { position: relative; }
.invite-code-input > i { position: absolute; z-index: 1; left: 15px; top: 17px; color: var(--auth-yellow); font-size: 19px; }
.invite-code-input input { padding-left: 45px; text-transform: uppercase; letter-spacing: 1px; }

.auth-form select:focus { border-color: var(--auth-yellow); box-shadow: 0 0 0 3px rgba(255,202,40,.13); }
.country-select-wrap { position: relative; }
.country-select-wrap > i { position: absolute; top: 50%; z-index: 1; transform: translateY(-50%); pointer-events: none; }
.country-select-wrap > i:first-child { left: 15px; color: var(--auth-yellow); font-size: 18px; }
.country-select-wrap > i:last-child { right: 15px; color: var(--auth-muted); font-size: 14px; }

.handle-input { display: grid; grid-template-columns: auto 1fr; align-items: center; height: 54px; padding-left: 16px; border: 1px solid var(--auth-border); border-radius: 13px; background: var(--auth-surface); transition: border-color .18s, box-shadow .18s; }
.handle-input:focus-within { border-color: var(--auth-yellow); box-shadow: 0 0 0 3px rgba(255,202,40,.13); }
.handle-input b { color: var(--auth-yellow); font-size: 17px; }
.auth-form .handle-input input { height: 52px; padding-left: 3px; border: 0; background: transparent; box-shadow: none; }
.field-hint { margin-top: -2px; color: #76777b; font-size: 11px; line-height: 1.35; }

.auth-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  min-height: 56px;
  margin-top: 2px;
  border: 0;
  border-radius: 14px;
  background: var(--auth-yellow);
  color: #090909;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}

.auth-primary:active { transform: scale(.985); }
.auth-primary:disabled { opacity: .58; cursor: wait; }
.auth-primary i { font-size: 23px; }

.passkey-note {
  display: flex;
  gap: 13px;
  margin-top: 24px;
  padding: 17px;
  border: 1px solid var(--auth-border);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
}

.passkey-note > i { flex: 0 0 auto; color: var(--auth-yellow); font-size: 24px; }
.passkey-note div { display: grid; gap: 4px; }
.passkey-note strong { font-size: 14px; }
.passkey-note span { color: var(--auth-muted); font-size: 13px; line-height: 1.45; }

.auth-status,
.auth-unsupported {
  min-height: 22px;
  margin: 17px 0 0;
  color: #c9c9cb;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.auth-status.error,
.auth-unsupported { color: #ff8c84; }
.auth-status.success { color: var(--auth-yellow); }

.auth-terms {
  margin: 25px auto 0;
  color: #6f7074;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 780px) {
  .auth-shell { display: block; }
  .auth-visual { display: none; }
  .auth-panel {
    min-height: 100dvh;
    place-items: start center;
    padding: max(31px, env(safe-area-inset-top)) 22px max(27px, env(safe-area-inset-bottom));
  }
  .auth-brand { width: 182px; margin-bottom: clamp(34px, 6vh, 56px); }
  .auth-heading h1 { font-size: 39px; }
  .auth-heading > p:last-child { font-size: 16px; }
  .auth-journey li { min-height: 56px; padding: 8px; }
}

@media (max-height: 720px) and (max-width: 780px) {
  .auth-brand { margin-bottom: 26px; }
  .auth-tabs { margin-top: 24px; }
}
