:root {
  color-scheme: dark;
  --bg: #0c0c0f;
  --surface: #16161c;
  --surface-hover: #1c1c24;
  --border: #2a2a33;
  --border-selected: #dc2626;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --accent-soft: rgba(220, 38, 38, 0.12);
  --error: #fca5a5;
  --success: #4ade80;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(120% 80% at 50% -10%, #2a1010 0%, var(--bg) 55%);
  color: var(--text);
}

body > main.shell ~ main.shell {
  display: none !important;
}

.shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.hero {
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

/* --- Tabs --- */

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  border-color: #3f3f46;
}

/* --- Panels --- */

.panel {
  display: none !important;
}

.panel.is-active:not([hidden]) {
  display: block !important;
}

section[hidden] {
  display: none !important;
}

/* --- Card --- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.25rem;
}

/* --- Plan selection --- */

.plan-fieldset {
  border: none;
  margin: 0 0 1.15rem;
  padding: 0;
}

.plan-fieldset .label {
  display: block;
  margin-bottom: 0.6rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.plan-card:hover {
  background: var(--surface-hover);
}

.plan-card:has(.plan-radio:checked) {
  border-color: var(--border-selected);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--border-selected);
}

.plan-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.plan-badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(220, 38, 38, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.15rem;
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.plan-price {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.plan-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.25rem;
}

/* --- Form fields --- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

input[type="email"] {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0f0f14;
  color: var(--text);
  font-size: 1rem;
}

input[type="email"]:focus {
  outline: 2px solid rgba(220, 38, 38, 0.45);
  outline-offset: 1px;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.99);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-trial {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--accent);
}

.btn-trial:hover:not(:disabled) {
  background: var(--accent-soft);
}

.btn-trial:disabled {
  opacity: 0.55;
  cursor: wait;
}

.trial-note {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-store {
  background: #27272a;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-store:hover {
  background: #3f3f46;
}

.store-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem 0 0.5rem;
}

/* --- Messages --- */

.msg {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.msg-error {
  color: var(--error);
}

.fineprint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* --- Download panel --- */

.success-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.plan-confirmed {
  margin: 0 0 0.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--success);
}

.muted {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-word;
}

.btn-danger {
  background: transparent;
  color: #fca5a5;
  border: 2px solid rgba(248, 113, 113, 0.45);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.65);
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: wait;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

.nav-link-row {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.msg-success {
  color: var(--success);
}
