/* Kursvagt website — tokens mirrored from app/lib/ui/tokens/app_tokens.dart
   and Kv* widget classes from app/lib/ui/widgets.dart. Single source of truth
   is the app; this file copies the leaf values rather than importing them. */

:root {
  /* brand */
  --brand-primary: #1C6DD0;
  --brand-on-primary: #FFFFFF;
  --brand-tint: #EAF1FB;

  /* surface */
  --surface-background: #F2F2F7;
  --surface-primary: #FFFFFF;
  --surface-secondary: #F2F2F7;
  --surface-tertiary: #E5E5EA;

  /* text */
  --text-primary: #000000;
  --text-secondary: #3C3C43;
  --text-tertiary: #6B6F76;
  --text-quaternary: #8E8E93;

  /* border */
  --border-subtle: #E5E5EA;
  --border-strong: #B0B0B5;

  /* status */
  --status-success: #34C759;
  --status-success-bg: #EBFAEE;
  --status-warning: #FF9500;
  --status-warning-bg: #FFF4E5;
  --status-danger: #FF3B30;
  --status-danger-bg: #FFEEEC;
  --status-info: #1C6DD0;
  --status-info-bg: #EAF1FB;

  /* domain */
  --domain-gain: #34C759;

  /* radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-2xl: 16px;
  --r-full: 9999px;

  /* spacing */
  --s-xxs: 2px;
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 20px;
  --s-2xl: 24px;
  --s-3xl: 32px;

  /* elevation — mirrors AppElevation.e1 / e2 */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-2: 0 2px 6px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.10);

  /* layout */
  --content-max: 1080px;
  --prose-max: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-primary: #5FA0F0;
    --brand-on-primary: #001E3C;
    --brand-tint: #0E2742;
    --surface-background: #000000;
    --surface-primary: #1C1C1E;
    --surface-secondary: #2C2C2E;
    --surface-tertiary: #3A3A3C;
    --text-primary: #FFFFFF;
    --text-secondary: #EBEBF5;
    --text-tertiary: #A0A4AB;
    --text-quaternary: #8E8E93;
    --border-subtle: #38383A;
    --border-strong: #5A5A5E;
    --status-success: #30D158;
    --status-success-bg: #0E2A14;
    --status-warning: #FF9F0A;
    --status-warning-bg: #332100;
    --status-danger: #FF453A;
    --status-danger-bg: #330F0D;
    --status-info: #5FA0F0;
    --status-info-bg: #0E2742;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.30), 0 2px 8px rgba(0,0,0,0.40);
    --shadow-2: 0 2px 6px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.50);
  }
}

/* ───────── reset / base ───────── */

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

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

body {
  margin: 0;
  background: var(--surface-background);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv01";
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: opacity 120ms ease;
}
a:hover { opacity: 0.78; }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--brand-tint); color: var(--brand-primary); }

/* ───────── type scale (mirrors AppType) ───────── */

.t-display-lg { font-size: 56px; font-weight: 700; letter-spacing: -1.4px; line-height: 1.05; }
.t-display-md { font-size: 44px; font-weight: 700; letter-spacing: -1.0px; line-height: 1.08; }
.t-headline   { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; }
.t-title-lg   { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.25; }
.t-title-md   { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.3; }
.t-title-sm   { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.3; }
.t-body-lg    { font-size: 17px; font-weight: 400; line-height: 1.5; }
.t-body-md    { font-size: 15px; font-weight: 400; line-height: 1.5; }
.t-body-sm    { font-size: 14px; font-weight: 400; line-height: 1.5; }
.t-caption    { font-size: 13px; font-weight: 400; line-height: 1.4; }
.t-overline   {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; line-height: 1.3;
}
.tabular { font-variant-numeric: tabular-nums; }

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

@media (max-width: 640px) {
  .t-display-lg { font-size: 38px; letter-spacing: -1px; }
  .t-display-md { font-size: 32px; letter-spacing: -0.6px; }
  .t-headline   { font-size: 24px; }
}

/* ───────── header ───────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--surface-background) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
}
.site-header .wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg { width: 16px; height: 16px; }
.site-header nav { display: flex; gap: 22px; }
.site-header nav a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
}
@media (max-width: 520px) {
  .site-header nav { display: none; }
}

/* ───────── layout ───────── */

main { display: block; }
.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 64px 24px;
}
.section.narrow {
  max-width: var(--prose-max);
}
.section.tight { padding-top: 32px; padding-bottom: 32px; }
@media (max-width: 640px) {
  .section { padding: 44px 20px; }
}

/* ───────── Kv components (mirrors widgets.dart) ───────── */

.kv-card {
  background: var(--surface-primary);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-1);
}
.kv-card.lg { padding: 28px; }

.kv-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.kv-badge.info    { background: var(--status-info-bg);    color: var(--status-info); }
.kv-badge.success { background: var(--status-success-bg); color: var(--status-success); }
.kv-badge.warning { background: var(--status-warning-bg); color: var(--status-warning); }
.kv-badge.danger  { background: var(--status-danger-bg);  color: var(--status-danger); }
.kv-badge.neutral { background: var(--surface-secondary); color: var(--text-primary); }

.kv-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: var(--r-md);
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.kv-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-quaternary);
  margin: 0 0 10px;
}

.kv-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-lg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  border: none;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
  white-space: nowrap;
}
.kv-button.filled  { background: var(--brand-primary);    color: var(--brand-on-primary); }
.kv-button.tonal   { background: var(--brand-tint);       color: var(--brand-primary); }
.kv-button.ghost   { background: transparent;             color: var(--brand-primary); }
.kv-button:hover { opacity: 0.92; transform: translateY(-1px); }
.kv-button:active { transform: translateY(0); opacity: 0.85; }

/* ───────── hero ───────── */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  padding: 64px 24px 72px;
  max-width: var(--content-max);
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--brand-tint);
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero-eyebrow .pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-primary);
  position: relative;
}
.hero-eyebrow .pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--brand-primary);
  opacity: 0.35;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2.1); opacity: 0;   }
}
.hero h1 {
  margin: 0 0 18px;
}
.hero h1 .accent { color: var(--brand-primary); }
.hero .lede {
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: 560px;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-meta {
  display: flex;
  gap: 18px;
  margin-top: 22px;
  color: var(--text-tertiary);
  font-size: 13px;
  flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .check {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--status-success-bg);
  color: var(--status-success);
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-bottom: 56px; }
  .hero-visual { order: -1; max-width: 440px; margin: 0 auto; }
}

/* ───────── hero visual mock ───────── */

.hero-visual { position: relative; }
.hero-illustration {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin: 0 auto;
}
.notification-mock {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 6%;
  background: var(--surface-primary);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 14px 16px;
  box-shadow: var(--shadow-2);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notification-mock .icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  display: flex; align-items: center; justify-content: center;
}
.notification-mock .body { flex: 1; min-width: 0; }
.notification-mock .row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}
.notification-mock .app  { font-weight: 600; font-size: 13px; }
.notification-mock .time { font-size: 12px; color: var(--text-quaternary); }
.notification-mock .title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.notification-mock .msg { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

/* ───────── feature grid ───────── */

.section-head {
  text-align: center;
  margin: 0 auto 40px;
  max-width: 640px;
}
.section-head h2 { margin: 0 0 10px; }
.section-head p { color: var(--text-secondary); margin: 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.step {
  background: var(--surface-primary);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step .step-num {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand-tint);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { margin: 0; }
.step p { margin: 0; color: var(--text-secondary); font-size: 15px; }

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

/* ───────── feature row with check icons ───────── */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.feature {
  background: var(--surface-primary);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-1);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.feature .check-icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--status-success-bg);
  color: var(--status-success);
  display: flex; align-items: center; justify-content: center;
}
.feature h3 { margin: 0 0 4px; font-size: 16px; }
.feature p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }

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

/* ───────── pricing card ───────── */

.pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}
.pricing .kv-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pricing .price {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.6px;
}
.pricing .price small {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 4px;
}
.pricing .price-alt {
  margin: -6px 0 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pricing .price-alt strong { color: var(--text-primary); font-weight: 600; }
.pricing .card-header-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.pricing ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pricing li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.pricing li::before {
  content: "✓";
  color: var(--status-success);
  font-weight: 700;
}
.pricing .kv-card.featured {
  border-color: var(--brand-primary);
  background: linear-gradient(180deg, var(--brand-tint) 0%, var(--surface-primary) 60%);
}
@media (max-width: 640px) {
  .pricing { grid-template-columns: 1fr; }
}

/* ───────── callout (compliance disclaimer) ───────── */

.callout {
  background: var(--surface-primary);
  border: 0.5px solid var(--border-subtle);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--r-xl);
  padding: 18px 22px;
  box-shadow: var(--shadow-1);
}
.callout p { margin: 0; color: var(--text-secondary); font-size: 15px; }
.callout strong { color: var(--text-primary); }

/* ───────── legal pages ───────── */

.legal {
  max-width: var(--prose-max);
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.legal h1 {
  font-size: 34px;
  letter-spacing: -0.6px;
  margin: 0 0 6px;
  line-height: 1.15;
}
.legal .updated {
  color: var(--text-tertiary);
  font-size: 14px;
  margin: 0 0 32px;
}
.legal h2 {
  font-size: 20px;
  letter-spacing: -0.3px;
  margin: 36px 0 10px;
}
.legal h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 6px;
}
.legal p, .legal li {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}
.legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal .lede {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  line-height: 1.55;
}

/* ───────── footer ───────── */

footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
  background: var(--surface-background);
}
footer .wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 14px;
}
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--text-tertiary); }
footer a:hover { color: var(--text-secondary); }
