:root {
  color-scheme: light;
  --ink: #20242c;
  --muted: #586271;
  --blue: #294bb6;
  --blue-hover: #203c93;
  --line: #dce1e8;
  --field-line: #8994a4;
  --soft: #f5f7fa;
  --error: #a02830;
  font: 400 100%/1.45 'Onest', system-ui, sans-serif;
  background: #fff;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, p { margin: 0; }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.mast { border-bottom: 1px solid var(--line); }
.mast-inner {
  max-width: 72rem;
  margin: auto;
  padding: .4rem clamp(1rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.brand, .support, .guest, .account-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.brand {
  gap: .45rem;
  color: var(--ink);
  font: 400 1.85rem/1 'Tiny5', system-ui, sans-serif;
  text-transform: uppercase;
}
.brand:hover { text-decoration: none; }
.gem {
  width: 1.25rem;
  height: 1.4rem;
  clip-path: polygon(50% 0, 100% 23%, 100% 74%, 50% 100%, 0 74%, 0 23%);
  background: conic-gradient(from 60deg, #203ba1 0 120deg, #5270ee 0 240deg, #94abff 0);
}
.support, .account-footer a { color: var(--muted); font-size: .875rem; }
.window {
  width: min(100%, 29rem);
  margin: clamp(1.5rem, 7vh, 4.5rem) auto 1rem;
  padding-inline: 1rem;
}
.controls {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  box-shadow: 0 5px 22px rgb(26 42 77 / 4%);
}
h1 {
  font-size: clamp(1.75rem, 5vw, 2rem);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.intro, .hint, .status, .field-error, #offer-state, #offer-mode-hint { font-size: .875rem; }
.intro, .hint, #offer-mode-hint { color: var(--muted); }
.intro { margin-top: .5rem; }
.hint:empty, .status:empty, .field-error:empty, #offer-state:empty { display: none; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .55rem .85rem;
  border: 1px solid var(--field-line);
  border-radius: .55rem;
  background: white;
  color: var(--ink);
  font: 600 .9375rem/1.3 'Onest', system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--soft); text-decoration: none; }
.primary { color: white; background: var(--blue); border-color: var(--blue); }
.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
button:disabled { opacity: .65; cursor: default; }
.plain {
  padding: .25rem 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: .875rem;
}
.plain:hover { background: transparent; text-decoration: underline; }
.mode-switch {
  display: flex;
  margin-top: .85rem;
  border-bottom: 1px solid var(--line);
  gap: 1.25rem;
}
.mode-switch button {
  margin-bottom: -1px;
  padding-inline: .1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}
.mode-switch button:hover, .mode-switch button[aria-pressed="true"] { color: var(--blue); }
.mode-switch button[aria-pressed="true"] { border-bottom-color: currentColor; }
#credentials, .field, #promo-form, .receipt-code { display: grid; min-width: 0; }
#credentials { margin-top: 1.15rem; gap: .9rem; }
.field, #promo-form { gap: .35rem; }
label, summary { font-size: .9375rem; font-weight: 600; }
.field-heading, .account-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: .75rem;
}
.recover-action { margin-block: -.45rem; min-height: 38px; font-weight: 400; }
.controls input, #issued-code {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .55rem .75rem;
  border: 1px solid var(--field-line);
  border-radius: .55rem;
  background: white;
  color: var(--ink);
  font: inherit;
}
.controls input:focus-visible, #issued-code:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}
.password-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--field-line);
  border-radius: .55rem;
}
.password-input input { min-height: 42px; border: 0; }
.password-input:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 1px; }
.password-input input:focus-visible { outline: none; }
#show-password, .password-toggle {
  margin-inline-end: .2rem;
  padding: .4rem .6rem;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: .8125rem;
}
#show-password:focus-visible, .password-toggle:focus-visible { outline-offset: -2px; }
#mail-form, .mail-actions { display: grid; gap: .75rem; margin-top: 1rem; }
.mail-actions .plain { justify-self: start; text-align: start; }
#email-state { margin-top: .25rem; }
#reserve-summary { min-height: 44px; padding-block: .7rem; cursor: pointer; }
#reserve-code:has(summary:not([hidden])) { margin-top: .75rem; }
#reserve-code:has(summary:not([hidden])) .receipt-code { margin-top: 0; }
.controls input[aria-invalid="true"], .password-input:has([aria-invalid="true"]) { border-color: var(--error); }
.field-error, #promo-form:has([aria-invalid="true"]) #promo-status { color: var(--error); }
#credential-submit { margin-top: .15rem; }
#cancel-link { margin-top: .5rem; }
.guest {
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin-top: .65rem;
  font-size: .875rem;
}
.status:not(:empty) { margin-top: .8rem; }
.account-footer { text-align: center; padding-top: .25rem; }
.account-footer a:hover, .support:hover, .guest:hover { text-decoration: underline; }

#logout { color: var(--muted); font-weight: 400; }
#account-profile { margin-top: .55rem; overflow-wrap: anywhere; }
#profile-name, .plan { font-weight: 600; }
.access, .receipt-code {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: var(--soft);
  border-radius: .65rem;
}
#period { margin-top: .2rem; }
.editor-link { display: flex; margin-top: .7rem; }
#promo-form {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.promo-input, .receipt-actions, .offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.promo-input input { flex: 1 1 8rem; width: auto; }
.promo-input button, .receipt-actions button, .offer-actions button { flex: 1 1 auto; }
#offers { margin-top: 1rem; border-top: 1px solid var(--line); }
#offers summary { padding-block: .7rem; min-height: 44px; cursor: pointer; }
#offers summary::marker { color: var(--muted); }
.offer-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .65rem;
  margin-top: .5rem;
  font-size: .9375rem;
}
.offer-price strong { white-space: nowrap; }
#month-interest-hint { margin-top: .4rem; }
#offer-state:not(:empty), .offer-actions:has(button:not([hidden])) { margin-top: .65rem; }
.receipt-code { gap: .65rem; }
#issued-code { resize: vertical; font: 1rem/1.5 ui-monospace, monospace; word-break: break-all; }
#code-saved { width: 100%; margin-top: 1rem; }

@media (max-width: 480px) {
  .window { margin-top: 1.5rem; padding-inline: clamp(1rem, 5vw, 1.5rem); }
  .controls { padding: 0; border: 0; box-shadow: none; }
  .account-footer { margin-top: .85rem; border-top: 1px solid var(--line); }
}
