@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --ink: #141828;
  --muted: #5f6478;
  --subtle: #8a8fa3;
  --line: #e7e8f2;
  --field: #f2f3f8;
  --accent: #6c5cf6;
  --accent-ink: #5143d9;
  --grad: linear-gradient(90deg, #5b8def 0%, #7c5cff 100%);
  --glow-a: rgba(124, 92, 255, 0.16);
  --glow-b: rgba(91, 141, 239, 0.08);
  --primary-shadow: rgba(124, 92, 255, 0.65);
  --danger: #cf3f3f;
  --danger-ink: #b33131;
  --danger-line: #f1cccc;
  --danger-soft: #fdf2f2;
  --success: #1c7f4f;
  --success-soft: #eaf6ef;
  --warning: #9a5b0a;
  --warning-soft: #fff4e2;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.04), 0 16px 36px -18px rgba(70, 58, 160, 0.18);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.glow {
  position: fixed;
  inset: -30vh -20vw auto;
  height: 70vh;
  background: radial-gradient(closest-side, var(--glow-a), var(--glow-b) 55%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  --shell-top: max(40px, env(safe-area-inset-top));
  padding: var(--shell-top) max(20px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.brand { display: flex; justify-content: center; margin-bottom: 20px; }
.brand__logo { width: 64px; height: 64px; filter: drop-shadow(0 10px 22px rgba(124, 92, 255, 0.28)); }
.brand__logo--wordmark { width: auto; height: 34px; max-width: 70%; filter: none; margin: 14px 0 6px; }

/* Band header: a full-width dark strip carrying a light logo, like the top of that product's checkout. */
.brand--band {
  margin: calc(-1 * var(--shell-top)) 0 28px;
  padding: max(20px, env(safe-area-inset-top)) 0 20px;
  background: var(--band, #141828);
  /* paints edge to edge without widening the page: a border image drawn outside the box never scrolls,
     and a browser that ignores it simply shows the band at the column width */
  border-image: linear-gradient(var(--band, #141828), var(--band, #141828)) fill 0 / 0 / 0 100vmax;
}
.brand--band .brand__logo--wordmark { height: 44px; max-width: 80%; margin: 0; object-fit: contain; }
@media (max-width: 360px) { .brand--band .brand__logo--wordmark { height: 38px; } }
@media (min-width: 560px) { .brand--band .brand__logo--wordmark { height: 52px; } }

.view { animation: rise 0.28s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  outline: none;
}

.lead {
  margin: 0 auto 24px;
  max-width: 38ch;
  text-align: center;
  color: var(--muted);
  text-wrap: pretty;
}
.lead strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.form { padding: 24px; display: grid; gap: 18px; }

.field { display: grid; gap: 8px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink); }
.help { margin: 0; font-size: 13px; color: var(--subtle); }

.control { position: relative; display: flex; align-items: center; }

.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: #a3a7b8; }
.input:hover { background: #eceef5; }
.input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(207, 63, 63, 0.12); }

.control--email::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8fa3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.control--email .input { padding-left: 46px; }

.digits-mask {
  position: absolute;
  left: 16px;
  color: var(--subtle);
  font-size: 16px;
  letter-spacing: 0.06em;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.input--digits { padding-left: 148px; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; font-weight: 600; }
.input--code { text-align: center; letter-spacing: 0.5em; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 0.5em; }

.error { margin: 0; min-height: 0; color: var(--danger-ink); font-size: 14px; }
.error:empty { display: none; }
.error--block { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: default; opacity: 0.65; }
.btn--primary { color: #fff; background: var(--grad); box-shadow: 0 10px 22px -10px var(--primary-shadow); }
.btn--primary:hover:not([disabled]) { filter: brightness(1.05); }
.btn--danger { color: #fff; background: var(--danger); }
.btn--danger:hover:not([disabled]) { background: var(--danger-ink); }
.btn--outline-danger { color: var(--danger-ink); background: var(--surface); border-color: var(--danger-line); min-height: 48px; font-size: 15px; }
.btn--outline-danger:hover:not([disabled]) { background: var(--danger-soft); }
.btn--ghost { color: var(--ink); background: var(--surface); border-color: var(--line); }
.btn--ghost:hover { background: var(--field); }

.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn__label { opacity: 0.85; }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.spinner--lg { display: block; width: 28px; height: 28px; margin: 48px auto; color: var(--accent); border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.switch { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.dot { margin: 0 6px; color: var(--subtle); }

.link {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link[disabled] { color: var(--subtle); cursor: default; text-decoration: none; }
.link--muted { color: var(--muted); font-weight: 500; }

.account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}
.account__who { margin: 0; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__who [data-account-email] { color: var(--ink); font-weight: 600; }
.account .link { flex: none; white-space: nowrap; }

.notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 14px 16px; border-radius: 14px; font-size: 14px; }
.notice svg { flex: none; margin-top: 2px; }
.notice--success { background: var(--success-soft); color: #145a39; }

[data-view="subscriptions"] .title { margin-bottom: 18px; }

.subs { display: grid; gap: 14px; }

.sub { padding: 20px; }
.sub__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sub__name { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sub__detail { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--trial { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, white); }
.pill--active { color: var(--success); background: var(--success-soft); }
.pill--payment_failed, .pill--cancel_scheduled { color: var(--warning); background: var(--warning-soft); }
.pill--paused { color: #3551c4; background: #edf1ff; }
.pill--cancelled, .pill--ended, .pill--inactive { color: var(--muted); background: #eff0f5; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.sub__actions { margin-top: 18px; }

.sub__ended {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--success-soft);
  color: #145a39;
  font-size: 14px;
}
.sub__ended--neutral { background: #f2f3f7; color: var(--muted); }
.sub__ended svg { flex: none; margin-top: 2px; }

.empty { padding: 28px 24px; text-align: center; }
.empty__title { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.empty__text { margin: 0; color: var(--muted); font-size: 14px; text-wrap: pretty; }

.footer { margin-top: auto; padding-top: 36px; text-align: center; font-size: 13px; color: var(--subtle); }
.footer p { margin: 4px 0; }
.footer a { color: var(--muted); font-weight: 500; text-underline-offset: 3px; }
/* the lock rides on the first line of the text: when the sentence wraps, it does not drift to the edge */
.footer__secure svg { display: inline-block; vertical-align: -1px; margin-right: 6px; }
.footer__lang { margin-top: 10px; display: flex; justify-content: center; gap: 14px; }
/* A page whose default language is not English is translated by script: keep the English footer from flashing first. */
html:not([lang="en"]):not([data-i18n-ready]) .footer { visibility: hidden; }

.dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(20, 24, 40, 0.35);
}
.dialog::backdrop { background: rgba(20, 24, 40, 0.45); backdrop-filter: blur(2px); }
.dialog[open] { animation: rise 0.2s ease-out both; }
.dialog__body { padding: 24px; display: grid; gap: 10px; }
.dialog__title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.dialog__text { margin: 0 0 6px; color: var(--muted); }
.dialog__actions { display: grid; gap: 10px; margin-top: 6px; }

@media (min-width: 560px) {
  .shell { --shell-top: max(64px, env(safe-area-inset-top)); }
  .title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.help-card { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 16px 18px; }
.help-card__icon { flex: none; margin-top: 2px; color: var(--accent); }
.help-card__title { margin: 0 0 2px; font-weight: 600; }
.help-card__text { margin: 0; color: var(--muted); font-size: 14px; }
.help-card__text a { color: var(--accent-ink); font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }
