/* Enewe / The Curtailer — application stylesheet.
   Built on the design system's tokens (tokens.css) - this file only adds
   component classes, no new colors/spacing/type values of its own. */

/* ---------- Layout ---------- */

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--content-max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page-main {
  padding: var(--space-7) 0 var(--space-9);
}

@media (max-width: 700px) {
  .container,
  .container-narrow {
    padding: 0 var(--space-4);
  }

  .page-main {
    padding: var(--space-6) 0 var(--space-7);
  }
}

/* ---------- Spacing utilities ---------- */

.mt-2 {
  margin-top: var(--space-2);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

.mt-6 {
  margin-top: var(--space-6);
}

.ml-auto {
  margin-left: auto;
}

.text-center {
  text-align: center;
}

.table-scroll {
  overflow-x: auto;
}

.form-narrow {
  padding: 0;
  max-width: 480px;
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-3 {
  margin-bottom: var(--space-3);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-5 {
  margin-bottom: var(--space-5);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.page-title-row .page-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.is-hidden {
  display: none;
}

.section-title-flush {
  margin-top: 0;
}

.section-title-tight {
  margin-top: var(--space-5);
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.btn-link:hover {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}

.step {
  display: flex;
  flex-direction: column;
}

.step-title {
  font: var(--text-heading-sm);
  color: var(--text-primary);
  margin-top: var(--space-2);
}

.step-body {
  margin-top: var(--space-2);
}

/* ---------- Type helpers ---------- */

.eyebrow {
  font: var(--text-label);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.page-title {
  font: var(--text-heading-lg);
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}

.page-lead {
  font: var(--text-body-md);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 0 var(--space-6);
}

.section-title {
  font: var(--text-heading-md);
  color: var(--text-primary);
  margin: var(--space-7) 0 var(--space-3);
}

.text-muted {
  color: var(--text-tertiary);
}

.text-small {
  font: var(--text-body-sm);
}

/* ---------- Nav ---------- */

.site-topbar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-5);
  padding: var(--space-2) var(--space-6);
  background: var(--neutral-950);
  color: var(--neutral-300);
  font: var(--text-caption);
}

.site-topbar a {
  color: var(--neutral-100);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-nav__brand {
  font: 600 22px var(--font-display);
  color: var(--text-primary);
  flex-shrink: 0;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font: var(--text-body-sm);
  color: var(--text-secondary);
}

.site-nav__links a.is-active {
  color: var(--brand-primary);
  font-weight: 600;
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  cursor: pointer;
}

.site-nav__mobile {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font: var(--text-body-md);
  color: var(--text-primary);
}

.site-nav__mobile.is-open {
  display: flex;
}

.site-nav__mobile a {
  padding: var(--space-2) 0;
  color: var(--text-primary);
}

.site-nav__mobile-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

@media (max-width: 900px) {
  .site-nav__links,
  .site-nav__actions {
    display: none;
  }

  .site-nav__burger {
    display: flex;
  }

  .site-topbar {
    padding: var(--space-2) var(--space-4);
  }

  .site-nav {
    padding: var(--space-3) var(--space-4);
  }
}

.nav-minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-minimal__back {
  font: var(--text-body-sm);
  color: var(--text-tertiary);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: var(--space-8) var(--space-6) var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.site-footer__grid {
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-7);
}

.site-footer__brand {
  font: 600 20px var(--font-display);
  color: var(--text-primary);
}

.site-footer__blurb {
  font: var(--text-body-sm);
  color: var(--text-secondary);
  margin-top: var(--space-3);
  max-width: 320px;
}

.site-footer h3 {
  font: var(--text-label);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin: 0 0 var(--space-3);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font: var(--text-body-sm);
  color: var(--text-secondary);
}

.site-footer__bottom {
  max-width: var(--content-max-width);
  margin: var(--space-6) auto 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font: var(--text-caption);
  color: var(--text-tertiary);
}

@media (max-width: 700px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  font: var(--text-body-md);
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
  text-decoration: none;
  background: var(--brand-primary);
  color: var(--text-on-primary);
}

.btn:hover {
  background: var(--brand-primary-hover);
  color: var(--text-on-primary);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover {
  background: var(--neutral-50);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-primary);
}

.btn-ghost:hover {
  background: var(--neutral-50);
  color: var(--brand-primary);
}

.btn-accent {
  background: var(--brand-accent);
  color: var(--text-on-accent);
}

.btn-accent:hover {
  background: var(--accent-700);
  color: var(--text-on-accent);
}

.btn-danger {
  background: var(--danger-500);
  color: var(--neutral-0);
}

.btn-danger:hover {
  background: var(--danger-700);
  color: var(--neutral-0);
}

.btn:disabled {
  background: var(--neutral-100);
  color: var(--neutral-400);
  border-color: var(--neutral-200);
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 14px;
  font: var(--text-body-sm);
  font-weight: 600;
}

.btn-lg {
  padding: 13px 24px;
  font: var(--text-body-lg);
  font-weight: 600;
}

.btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.date-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font: var(--text-body-sm);
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text-primary);
  cursor: pointer;
}

.date-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* ---------- Chips (lightweight presets, e.g. example-site picks) ---------- */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-sunken);
  color: var(--text-secondary);
  font: var(--text-body-sm);
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  text-decoration: none;
}

/* ---------- Labeled groups (e.g. "Examples:" / "Learn more:") ---------- */

.label-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.label-row__label {
  font: var(--text-label);
  color: var(--text-tertiary);
  flex: 0 0 auto;
}

.stacked-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stacked-actions .btn {
  width: 100%;
}

/* ---------- Segmented toggle (e.g. chart unit switch) ---------- */

.segmented-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--bg-surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}

.segmented-toggle__option {
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: var(--text-body-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.segmented-toggle__option:hover:not(.is-active) {
  color: var(--text-primary);
}

.segmented-toggle__option.is-active {
  background: var(--brand-primary);
  color: var(--text-on-primary);
}

/* ---------- Positive-highlight inline text ---------- */

.text-positive {
  color: var(--success-500);
}

.btn.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
}

/* ---------- Cards ---------- */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.card-flush {
  padding: 0;
  overflow: hidden;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.panel-title {
  font: var(--text-heading-sm);
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
}

/* ---------- Modal (native <dialog>) ---------- */

dialog.modal {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  background: var(--bg-surface);
  color: var(--text-primary);
  max-width: 680px;
  width: calc(100% - var(--space-8));
  max-height: calc(100% - var(--space-8));
  overflow-y: auto;
}

dialog.modal::backdrop {
  background: oklch(0% 0 0 / 0.5);
}

@media (max-width: 700px) {
  /* The daily-stats modal holds a two-axis chart, which needs
     every spare pixel of width it can get on a narrow screen -
     the default modal gutter/padding (sized for form modals)
     leaves it too cramped to read. */
  #daily-stats-modal {
    width: calc(100% - var(--space-4));
    padding: var(--space-3);
  }
}

/* ---------- Badges & tags ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font: var(--text-caption);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  background: var(--neutral-100);
  color: var(--text-secondary);
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-accent {
  background: var(--accent-100);
  color: var(--accent-700);
}

.badge-success {
  background: oklch(92% 0.05 150);
  color: var(--success-700);
}

.badge-danger {
  background: oklch(93% 0.06 25);
  color: var(--danger-700);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font: var(--text-body-sm);
  color: var(--text-primary);
}

/* ---------- Alerts / messages ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-sunken);
  color: var(--text-primary);
  font: var(--text-body-sm);
  margin-bottom: var(--space-3);
}

.alert-error,
.alert-danger {
  background: oklch(96% 0.03 25);
  border-color: oklch(85% 0.08 25);
  color: var(--danger-700);
}

.alert-success {
  background: oklch(95% 0.03 150);
  border-color: oklch(85% 0.07 150);
  color: var(--success-700);
}

.alert-warning {
  background: var(--accent-100);
  border-color: var(--accent-300);
  color: var(--accent-900);
}

.alert-info,
.alert-debug {
  background: var(--bg-surface-sunken);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.alert__close {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
}

.alert__close:hover {
  opacity: 1;
}

/* ---------- Forms ---------- */

form {
  font-family: var(--font-body);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.field label {
  font: var(--text-label);
  color: var(--text-secondary);
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.field select,
.field textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font: var(--text-body-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  width: 100%;
  max-width: 420px;
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.field textarea {
  max-width: 100%;
  min-height: 100px;
}

.field select {
  max-width: 260px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger-500);
}

.field-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font: var(--text-body-md);
  color: var(--text-primary);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
}

input[type="range"].slider-input {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: var(--space-2);
  accent-color: var(--brand-primary);
}

.field-help {
  font: var(--text-caption);
  color: var(--text-tertiary);
  margin: 0;
  max-width: 480px;
}

.field-error {
  font: var(--text-caption);
  color: var(--danger-500);
  margin: 0;
}

.field-warning {
  font: var(--text-caption);
  color: var(--accent-700);
  margin: var(--space-1) 0 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-end;
}

.form-row .field {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
}

.string-form {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
  margin-bottom: var(--space-3);
}

.form-section-intro {
  margin-bottom: var(--space-4);
}

/* ---------- Tables ---------- */

table.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  font: var(--text-body-sm);
}

table.table th,
table.table td {
  padding: 12px 16px;
  text-align: left;
  border-top: 1px solid var(--border-subtle);
}

table.table thead th {
  border-top: none;
  font: var(--text-label);
  color: var(--text-tertiary);
  background: var(--bg-surface-sunken);
}

table.table tbody td {
  color: var(--text-primary);
  font-feature-settings: "tnum" 1;
}

table.table tfoot th,
table.table tfoot td {
  font-weight: 600;
  background: var(--bg-surface-sunken);
  font-feature-settings: "tnum" 1;
}

/* ---------- Definition lists (key/value rows) ---------- */

.kv-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
  margin: 0 0 var(--space-5);
}

.kv-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.kv-row:first-child {
  border-top: none;
}

.kv-row dt {
  font: var(--text-label);
  color: var(--text-tertiary);
}

.kv-row dd {
  margin: 0;
  font: var(--text-body-md);
  color: var(--text-primary);
  font-feature-settings: "tnum" 1;
}

@media (max-width: 600px) {
  .kv-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

/* ---------- Lists (device list, claim candidates) ---------- */

.list-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
}

.list-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font: var(--text-body-md);
}

.list-group-item:first-child {
  border-top: none;
}

a.list-group-item:hover {
  background: var(--bg-surface-sunken);
  text-decoration: none;
}

/* ---------- Marketing sections ---------- */

.hero {
  padding: var(--space-9) var(--space-6) var(--space-7);
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero__title {
  font: var(--text-display-2xl);
  color: var(--text-primary);
  letter-spacing: var(--letter-spacing-tight);
  margin: var(--space-5) 0 0;
}

.hero__lead {
  font: var(--text-body-lg);
  color: var(--text-secondary);
  margin: var(--space-5) auto 0;
  max-width: 600px;
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .hero {
    padding: var(--space-7) var(--space-4) var(--space-6);
  }

  .hero__title {
    font: var(--text-display-lg);
  }
}

.stat-bar__value {
  font: var(--text-display-lg);
  color: var(--brand-primary);
  font-feature-settings: "tnum" 1;
}

.stat-bar__label {
  font: var(--text-body-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ---------- Simulation profit widget ---------- */

.simulation-widget {
  display: grid;
  grid-template-columns: 1.15fr 1fr; /* chart side gets slightly more room */
  align-items: stretch;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.simulation-widget__chart {
  padding: var(--space-5);
}

.simulation-widget__summary {
  padding: var(--space-5);
  background: var(--bg-surface-sunken);
  border-left: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
  .simulation-widget {
    grid-template-columns: 1fr;
  }

  .simulation-widget__summary {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

.profit-figure {
  font: var(--text-display-xl);
  color: var(--brand-primary);
  font-feature-settings: "tnum" 1;
  margin: var(--space-2) 0 var(--space-4);
}

.assumptions-list {
  display: flex;
  flex-direction: column;
  margin: var(--space-3) 0 var(--space-5);
}

.assumptions-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-subtle);
}

.assumptions-row:first-child {
  border-top: none;
}

.assumptions-row__label {
  color: var(--text-tertiary);
  font: var(--text-label);
  flex: 1 1 auto;
}

.assumptions-row__value {
  font: var(--text-body-md);
  color: var(--text-primary);
  font-feature-settings: "tnum" 1;
  text-align: right;
}

.pencil-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}

.pencil-btn:hover {
  color: var(--brand-primary);
}

.section {
  padding: var(--space-8) var(--space-6);
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.section-sunken {
  background: var(--bg-surface-sunken);
}

.section-sunken > .section {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.section-dark {
  background: var(--neutral-950);
  color: var(--neutral-0);
  text-align: center;
}

.section-dark .section-title,
.section-dark .page-title {
  color: var(--neutral-0);
}

.section-dark p {
  color: var(--neutral-400);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.step-number {
  font: var(--text-display-lg);
  color: var(--primary-200);
}

/* ---------- Feature split (big claim + real data, side by side) ---------- */

.feature-split {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.feature-split__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

.feature-split__title {
  font: var(--text-display-lg);
  color: var(--text-primary);
  letter-spacing: var(--letter-spacing-tight);
  margin: 0;
}

.feature-split__note {
  font: var(--text-body-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.feature-split__pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  font: var(--text-body-sm);
  font-weight: 600;
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}

.feature-split__pill:hover {
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.feature-split__pill svg {
  flex-shrink: 0;
  color: var(--brand-primary);
}

.feature-split__visual {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
}

.feature-split__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  font: var(--text-caption);
  color: var(--text-tertiary);
}

.feature-split__hint svg {
  flex-shrink: 0;
}

.feature-split__next {
  display: block;
  margin: var(--space-5) 0 0;
}

@media (max-width: 900px) {
  .feature-split__grid {
    grid-template-columns: 1fr;
  }
}

/* A "pop" on the text block and the chart card whenever the featured
   example changes (Next example button) - a small overshoot (past 100%
   scale, past 0 on the way up) reads as more alive than a flat fade, and
   draws the eye to the new numbers instead of them just silently
   swapping. */
@keyframes feature-split-pop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  55% {
    opacity: 1;
    transform: translateY(-4px) scale(1.015);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feature-split--pop {
  animation: feature-split-pop 750ms var(--ease-standard) both;
}

/* The profit figure itself gets an extra glow pulse on top of the
   block-level pop, timed to land as the pop settles. */
@keyframes feature-split-glow {
  0%,
  100% {
    text-shadow: 0 0 0 transparent;
  }

  55% {
    text-shadow: 0 0 20px currentColor;
  }
}

.feature-split--pop .feature-split__profit {
  animation: feature-split-glow 1100ms ease-out;
}

/* ---------- Scroll-triggered reveal ---------- */

@keyframes reveal-in {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }

  60% {
    opacity: 1;
    transform: translateY(-6px) scale(1.008);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reveal-on-scroll {
  opacity: 0;
}

.reveal-on-scroll.is-visible {
  animation: reveal-in 900ms var(--ease-standard) both;
}

/* Grid cards inside a revealed section cascade in one after another
   rather than all popping at once - each column waits a little longer
   than the last (capped at 4, the widest grid on this page). */
.reveal-on-scroll .grid-2 > *,
.reveal-on-scroll .grid-3 > *,
.reveal-on-scroll .grid-4 > * {
  opacity: 0;
}

.reveal-on-scroll.is-visible .grid-2 > *,
.reveal-on-scroll.is-visible .grid-3 > *,
.reveal-on-scroll.is-visible .grid-4 > * {
  animation: reveal-in 700ms var(--ease-standard) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.reveal-on-scroll.is-visible .grid-2 > *:nth-child(2),
.reveal-on-scroll.is-visible .grid-3 > *:nth-child(2),
.reveal-on-scroll.is-visible .grid-4 > *:nth-child(2) {
  --reveal-delay: 120ms;
}

.reveal-on-scroll.is-visible .grid-3 > *:nth-child(3),
.reveal-on-scroll.is-visible .grid-4 > *:nth-child(3) {
  --reveal-delay: 240ms;
}

.reveal-on-scroll.is-visible .grid-4 > *:nth-child(4) {
  --reveal-delay: 360ms;
}

/* ---------- Hero entrance ---------- */

/* The hero is already in view at page load, so there's nothing for the
   scroll IntersectionObserver to trigger on - this plays once,
   unconditionally, as soon as the page renders, each of the hero's 4
   direct children (badge, title, lead, actions) cascading in after the
   last. */
.hero > * {
  opacity: 0;
  animation: reveal-in 800ms var(--ease-standard) both;
}

.hero > *:nth-child(2) {
  animation-delay: 120ms;
}

.hero > *:nth-child(3) {
  animation-delay: 240ms;
}

.hero > *:nth-child(4) {
  animation-delay: 360ms;
}

/* "today" is the headline's whole point (immediacy, not just "someday")
   - color + italic sets it apart from the rest of the title on its own,
   and a glow pulse (reusing the same sweep as the featured-example
   profit figure) lands just as the title's own entrance settles. */
.hero__today {
  color: var(--brand-primary);
  font-style: italic;
  animation: feature-split-glow 1200ms ease-out 950ms both;
}

@media (prefers-reduced-motion: reduce) {
  .feature-split--pop,
  .feature-split--pop .feature-split__profit,
  .hero__today {
    animation: none;
  }

  .reveal-on-scroll,
  .reveal-on-scroll .grid-2 > *,
  .reveal-on-scroll .grid-3 > *,
  .reveal-on-scroll .grid-4 > *,
  .hero > * {
    opacity: 1;
    animation: none;
    transform: none;
  }
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-100);
  color: var(--brand-primary);
  margin-bottom: var(--space-3);
}

.pricing-table {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
}

.pricing-row {
  display: grid;
  grid-template-columns: 1.4fr 2fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.pricing-row__title {
  font: var(--text-heading-sm);
  color: var(--text-primary);
}

.section-narrow {
  max-width: 720px;
  text-align: center;
}

.prose {
  max-width: 760px;
}

.pricing-row:first-child {
  border-top: none;
}

@media (max-width: 700px) {
  .pricing-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Auth pages (login/signup/etc.) ---------- */

.auth-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: var(--space-7) 0;
}

.auth-wrap h1 {
  font: var(--text-heading-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.auth-wrap p {
  color: var(--text-secondary);
}

.auth-wrap table.table {
  font: var(--text-body-sm);
}

/* ---------- FAQ (native details/summary, no JS) ---------- */

.faq-item {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-4) 0;
}

.faq-item:first-child {
  border-top: none;
}

.faq-item summary {
  cursor: pointer;
  font: var(--text-heading-sm);
  color: var(--text-primary);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--text-tertiary);
  font-weight: 400;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  color: var(--text-secondary);
  margin-top: var(--space-3);
  max-width: 680px;
}

/* ---------- Checkout wizard ---------- */

.wizard-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-9);
}

.wizard-header {
  text-align: center;
  margin-bottom: var(--space-3);
}

.wizard-header__title {
  font: var(--text-display-lg);
  color: var(--text-primary);
}

.wizard-header__step {
  font: var(--text-body-md);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.step-dots {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-6);
}

.step-dots__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--neutral-200);
  transition: width var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard);
}

.step-dots__dot.is-done {
  background: var(--brand-primary);
}

.step-dots__dot.is-current {
  width: 22px;
  background: var(--brand-primary);
}

.option-card {
  display: block;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--bg-surface);
  margin-bottom: var(--space-4);
}

/* Selected/detail state keys off the card's OWN main radio only (a direct
   descendant of .option-card__radio-label), not any nested term/tier
   toggle radios living inside .option-card__detail - those are a
   separate child of .option-card, so this selector can't see them. */
.option-card:has(> .option-card__radio-label > .option-card__radio > input:checked) {
  border: 2px solid var(--brand-primary);
  padding: calc(var(--space-5) - 1px);
}

.option-card__radio-label {
  display: block;
  cursor: pointer;
}

.option-card__radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}

.option-card__title {
  font: var(--text-heading-sm);
  color: var(--text-primary);
}

.option-card__price {
  font: var(--text-heading-sm);
  color: var(--brand-primary);
  white-space: nowrap;
  font-feature-settings: "tnum" 1;
}

.option-card__subtitle {
  font: var(--text-body-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.option-card__detail {
  display: none;
  margin-top: var(--space-3);
}

.option-card:has(> .option-card__radio-label > .option-card__radio > input:checked) .option-card__detail {
  display: block;
}

.toggle-group {
  display: flex;
  gap: var(--space-2);
}

.toggle-group label {
  flex: 1;
  text-align: center;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  cursor: pointer;
  font: 600 13px var(--font-body);
  color: var(--text-primary);
}

.toggle-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-group label:has(input:checked) {
  border: 2px solid var(--brand-primary);
  padding: calc(var(--space-2) - 1px);
}

.price-recap {
  padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  margin-top: var(--space-4);
}

.price-recap__title {
  font: 600 14px var(--font-body);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.price-recap__row {
  display: flex;
  justify-content: space-between;
  font: var(--text-body-sm);
  color: var(--text-secondary);
  padding: 2px 0;
  font-feature-settings: "tnum" 1;
}

.price-recap__row--discount {
  color: var(--accent-700);
}

.price-recap__total {
  display: flex;
  justify-content: space-between;
  font: var(--text-heading-sm);
  color: var(--brand-primary);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
  font-feature-settings: "tnum" 1;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-6);
}

.wizard-status {
  text-align: center;
}

.wizard-status p {
  margin: var(--space-4) auto 0;
}

/* ---------- Pricing page: view toggle, info tips, image slots ---------- */

.view-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.view-toggle button {
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font: 600 14px var(--font-body);
  text-transform: capitalize;
  background: transparent;
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-standard);
}

.view-toggle button.is-active {
  background: var(--brand-primary);
  color: var(--text-on-primary);
}

.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--bg-surface-sunken);
  color: var(--text-tertiary);
  font: 600 10px var(--font-body);
  vertical-align: middle;
  cursor: help;
}

.dashed-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  padding: var(--space-5) var(--space-6);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
}

.dashed-cta p {
  max-width: 520px;
  margin: 0;
}

.cta-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  padding: var(--space-6);
  background: var(--brand-primary);
  border-radius: var(--radius-lg);
}

.cta-box__title {
  font: var(--text-heading-sm);
  color: var(--text-on-primary);
  margin: 0 0 var(--space-1);
}

.cta-box__body {
  font: var(--text-body-md);
  color: var(--text-on-primary);
  margin: 0;
  max-width: 480px;
}

.cta-box .btn {
  background: var(--bg-surface);
  color: var(--brand-primary);
  flex-shrink: 0;
}

.cta-box .btn:hover {
  background: var(--neutral-50);
  color: var(--brand-primary);
}

.image-slot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-sunken);
  color: var(--text-tertiary);
  font: var(--text-caption);
  text-align: center;
  padding: var(--space-2);
}

/* ---------- Pricing tiers ---------- */

.tier-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
}

.tier-card--highlight {
  border: 2px solid var(--brand-primary);
}

.tier-card__badge-slot {
  height: 24px;
}

.tier-card__name {
  font: var(--text-heading-sm);
  color: var(--text-primary);
  margin-top: var(--space-2);
}

.tier-card__price {
  font: var(--text-display-lg);
  color: var(--brand-primary);
  font-feature-settings: "tnum" 1;
  margin-top: var(--space-4);
}

.tier-card__price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font: var(--text-heading-md);
  color: var(--brand-primary);
  font-feature-settings: "tnum" 1;
}

.tier-card__price-row-label {
  font: var(--text-body-sm);
  color: var(--text-tertiary);
}

.tier-card__period {
  font: var(--text-caption);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

.tier-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.tier-feature {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font: 600 14px var(--font-body);
  color: var(--text-primary);
}

.tier-feature svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.addon-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.addon-row:first-child {
  border-top: none;
}

.addon-row--header {
  border-top: none;
  background: var(--bg-surface-sunken);
}

.addon-row__title {
  font: 600 14px var(--font-body);
  color: var(--text-primary);
}

.addon-row__note {
  font: var(--text-body-sm);
  color: var(--text-tertiary);
  font-style: italic;
}

@media (max-width: 700px) {
  .addon-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Use case cards ---------- */

.usecase-gain {
  font: var(--text-heading-md);
  color: var(--accent-700);
  font-feature-settings: "tnum" 1;
}

.usecase-link {
  display: inline-block;
  font: 600 13px var(--font-body);
  color: var(--brand-primary);
}

/* ---------- Threshold chart (brand motif) ---------- */

.threshold-chart {
  display: block;
  max-width: 100%;
  height: auto;
}
