:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #171a23;
  --panel-2: #0d1017;
  --line: #ffffff20;
  --text: #f1eff7;
  --muted: #a3a6b5;
  --accent: #c8b6ff;
  --good: #75dab0;
  --warn: #edc078;
  --bad: #ffa1ad;
}

* { box-sizing: border-box; }
html { scroll-padding-block:24px; }
input, textarea, select { scroll-margin-block:24px; }
html[data-keyboard-open] dialog[open], html[data-keyboard-open] #billing-confirm[open] { position:fixed; inset:auto 0 auto; top:calc(var(--visible-top) + 8px); margin:0 auto; max-height:calc(var(--visible-height) - 16px); overflow:auto; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

.auth-shell { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 12px; }
.auth-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; margin-bottom: 36px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: -.6px; text-decoration: none; }
.auth-brand img { display: block; width: 48px; height: 30px; object-fit: contain; }
.auth-header nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 20px; grid-column: 2; grid-row: 1; min-width: 0; }
.auth-header nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.auth-header nav a:hover, .auth-header nav a:focus-visible { color: var(--text); }
.auth-studio-link { grid-column: 3; grid-row: 1; white-space: nowrap; font-size: 13px; }
.auth-panel { width: 100%; max-width: 480px; margin: 0 auto; padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); }
.auth-shell--account .auth-panel { max-width: 760px; }
.auth-shell--contact .auth-panel { max-width: 720px; }
.auth-shell--billing .auth-panel { max-width: 940px; }
h1 { margin: 0 0 24px; font-size: clamp(25px, 3vw, 30px); line-height: 1.2; font-weight: 650; letter-spacing: -.7px; overflow-wrap: anywhere; }
.auth-intro { margin: -8px 0 24px; color: var(--muted); }
.auth-form { display: grid; gap: 18px; }
.field { display: grid; min-width: 0; gap: 8px; color: var(--text); font-size: 14px; font-weight: 500; }
input, textarea, select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #ffffff28; border-radius: 11px; background: var(--panel-2); color: var(--text); padding: 11px 13px; font-size: 16px; font-weight: 400; line-height: 1.5; }
textarea { resize: vertical; }
select { text-overflow: ellipsis; }
input::placeholder, textarea::placeholder { color: #8d92a3; opacity: 1; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.password-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.password-toggle, .primary-action, .button-link { min-height: 44px; max-width: 100%; border: 1px solid #ffffff28; border-radius: 11px; background: #222631; color: var(--text); padding: 10px 16px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.password-toggle { min-width: 62px; padding-inline: 12px; font-size: 13px; }
.primary-action { min-height: 48px; border-color: var(--accent); background: var(--accent); color: #1c152b; }
.button-link { width: fit-content; }
.primary-action:hover:not(:disabled) { background: #d6c8ff; }
.button-link:hover, .password-toggle:hover { border-color: #c8b6ff70; background: #2b2a3a; }
button:disabled { cursor: not-allowed; opacity: .55; }
.notice, .errors { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 20px; background: #10131b; font-size: 14px; overflow-wrap: anywhere; }
.notice-success { border-color: #75dab050; }
.notice-warning, .errors { border-color: #edc07860; }
.errors { color: #f7d29a; padding-left: 32px; }
.errors li + li { margin-top: 6px; }
.help, .auth-link, .password-match { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.65; }
.auth-link { margin-top: 12px; font-size: 14px; }
.auth-form + .auth-link { margin-top: 22px; }
.password-match:empty { display: none; }
.password-match.is-ok { color: var(--good); }
.password-match.is-error { color: var(--bad); }
.account-list { display: grid; gap: 0; margin: 24px 0; }
.account-list div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.account-list dt { color: var(--muted); font-size: 14px; }
.account-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.product-launcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.launch-card { display: grid; align-content: start; gap: 12px; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: #10131b; color: var(--text); padding: 20px; text-decoration: none; }
.launch-card-primary { border-color: #c8b6ff60; background: linear-gradient(145deg, #29233a, #141720); }
.launch-card span { color: var(--accent); font-size: 13px; font-weight: 600; }
.launch-card strong { font-size: 18px; line-height: 1.4; font-weight: 600; letter-spacing: -.3px; }
.launch-card:hover, .launch-card:focus-visible { border-color: var(--accent); }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-panel details { margin: 24px 0 0; }
.auth-panel summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 14px; font-weight: 500; }
.auth-panel details p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.auth-panel details li { padding: 6px 0; }
.account-extras { border-top: 1px solid var(--line); padding-top: 12px; }
.account-extras summary { color: var(--muted); }
.auth-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 22px; padding: 24px 0 8px; font-size: 12px; }
.auth-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.auth-footer a:hover { color: var(--text); }

.billing-consent { display: block; font-size: 13px; line-height: 1.7; color: var(--muted); margin: 18px 0; }
.billing-consent input[type=checkbox] { width: 19px; height: 19px; min-height: 19px; margin: 3px 8px 0 0; padding: 0; vertical-align: top; accent-color: var(--accent); }
.billing-plan-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border: 0; margin: 22px 0; padding: 0; min-width: 0; }
.billing-plan-picker legend { font-size: 19px; font-weight: 600; line-height: 1.4; margin-bottom: 14px; }
.billing-plan-option { min-width: 0; padding: 18px 14px; border: 1px solid #ffffff26; background: #10131b; border-radius: 16px; cursor: pointer; }
.billing-plan-option:has(input:checked) { border-color: var(--accent); background: #c8b6ff12; }
.billing-plan-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.billing-plan-option input[type=radio] { width: 18px; height: 18px; min-height: 18px; padding: 0; accent-color: var(--accent); vertical-align: middle; margin: 0 6px 3px 0; }
.billing-plan-option strong { display: block; font-size: 26px; line-height: 1.3; font-weight: 650; margin: 12px 0 8px; }
.billing-plan-option small { display: block; color: var(--muted); font-size: 12px; line-height: 1.65; }
.billing-plan-option > span { display: block; font-size: 14px; font-weight: 600; }
.billing-checkout { margin: 22px 0; }
.billing-checkout > button { width: 100%; }
.billing-checkout > .help { font-size: 13px; }

@media (max-width: 760px) {
  .auth-header { grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 24px; }
  .auth-studio-link { grid-column: 2; }
  .auth-header nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 0 12px; }
}
@media (max-width: 600px) {
  .auth-shell { width: calc(100% - 32px); padding-top: 20px; }
  .auth-header { margin-bottom: 18px; gap: 10px; }
  .auth-header nav { gap: 0 8px; }
  .auth-header nav a { font-size: 13px; }
  .auth-panel { padding: 24px 20px; border-radius: 20px; }
  h1 { margin-bottom: 22px; }
  .auth-footer { gap: 0 18px; padding-top: 18px; }
  .product-launcher { grid-template-columns: 1fr; }
  .launch-card { padding: 18px; gap: 8px; }
  .account-list div { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 12px 0; }
  .action-row > .button-link { flex: 1 1 140px; }
  .billing-plan-picker { grid-template-columns: 1fr; }
}
@media (max-width: 359px) {
  .auth-panel { padding: 22px 16px; }
  .auth-brand { gap: 7px; font-size: 18px; }
  .auth-studio-link { padding-inline: 12px; }
  .auth-header nav { gap: 0 6px; }
}

/* Keep common account actions ahead of secondary information. */
.product-launcher + .action-row { margin-top: 18px; }
.auth-assistance { border-top: 1px solid var(--line); padding-top: 6px; }
.auth-panel .auth-assistance { margin-top: 18px; }
.auth-assistance p a { display: inline-flex; align-items: center; min-height: 44px; }
.account-extras .account-list { margin: 0; }
.account-extras .account-list div:last-child { border: 0; }
