/*
 * Konexta marketing site (konexta.com). Same brand tokens as the app (frontend/src/index.css):
 * deep green brand, cream contrast, gold accent. Dark mode follows the visitor's system.
 */
:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --brand: #0f5f52;
  --brand-contrast: #f4f1e8;
  --gold: #d6a84a;
  --gold-text: #8a6516;
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #eef1ef;
  --border: #e3e7e4;
  --text: #16201d;
  --muted: #5d6b66;
  --primary: #0f6b5c;
  --primary-hover: #0b5a4d;
  --primary-soft: rgba(15, 107, 92, 0.1);
  --dark: #0e1f1b;
  --dark-text: #c9d6d1;
  --c1: #0f6b5c;
  --c2: #d6a84a;
  --c3: #8aa39b;
  --shadow: 0 1px 2px rgba(16, 32, 29, 0.05), 0 12px 32px rgba(16, 32, 29, 0.08);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1513;
    --surface: #13201d;
    --surface-2: #182824;
    --border: #243631;
    --text: #e8eeeb;
    --muted: #9db0a9;
    --primary: #2f9c87;
    --primary-hover: #3bb19a;
    --primary-soft: rgba(47, 156, 135, 0.16);
    --gold-text: #e4bf6f;
    --dark: #08100e;
    --c1: #2f9c87;
    --c3: #6f8a82;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-text); margin-bottom: 12px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent;
  font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { min-height: 40px; padding: 0 16px; background: var(--primary); color: #fff; }
.btn-ghost:hover { background: var(--primary-hover); }
.btn-gold { background: var(--gold); color: #1d1606; }
.btn-gold:hover { background: #e2b85c; }
.btn-on-dark { border-color: rgba(244, 241, 232, .35); color: var(--brand-contrast); }
.btn-on-dark:hover { border-color: var(--brand-contrast); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-row { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 28px; margin-left: 24px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang select {
  height: 40px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d6b66' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text); font: 600 13px var(--font); appearance: none; cursor: pointer;
}

/* Hero */
.hero {
  padding: 72px 0 80px;
  background:
    radial-gradient(900px 500px at 95% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(600px 400px at -10% 110%, rgba(214, 168, 74, .10), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 700; }
.lead { margin-top: 20px; font-size: 19px; color: var(--muted); max-width: 560px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
.hero-points li { display: flex; gap: 10px; align-items: center; }
.hero-points li::before {
  content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f6b5c' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") no-repeat center / 12px;
}

/* Product mock */
.mock { margin: 0; }
.mock-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-bar em { margin-left: 10px; font-style: normal; font-size: 12px; color: var(--muted); }
.mock-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: grid; gap: 20px;
}
.mock-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.mock-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.mock-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mock-delta { font-size: 14px; color: var(--primary); font-weight: 600; }
.mock-level { background: var(--dark); color: var(--brand-contrast); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; text-align: right; }
.mock-level .mock-label { color: var(--gold); }
.mock-chart { width: 100%; height: 90px; display: block; }
.mock-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 8px 0; gap: 2px; }
.legend { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.legend b { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.mock-alert { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.mock-alert .dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--gold); }
.mock figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* Band */
.band { background: var(--dark); color: var(--dark-text); }
.band-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-top: 36px; padding-bottom: 36px; }
.band strong { display: block; color: var(--brand-contrast); font-size: 17px; margin-bottom: 4px; }
.band span { font-size: 15px; }

/* Sections */
.section { padding: 96px 0; }
.section-soft { background: var(--surface-2); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.section-head .muted { margin-top: 14px; font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); transform: translateY(-2px); }
.card h3 { font-size: 18px; margin: 16px 0 8px; }
.card p { font-size: 15px; color: var(--muted); }
.ic {
  width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--primary-soft);
  fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.section-dark { background: var(--dark); color: var(--brand-contrast); }
.section-dark .muted { color: var(--dark-text); margin-top: 14px; font-size: 18px; }
.section-dark h2 { font-size: clamp(28px, 3.6vw, 40px); }
.section-dark .eyebrow { color: var(--gold); }
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li {
  display: grid; gap: 2px; padding: 16px 18px 16px 52px; position: relative;
  border: 1px solid rgba(244, 241, 232, .1); border-radius: 12px; background: rgba(255, 255, 255, .03);
}
.checks li::before {
  content: ''; position: absolute; left: 18px; top: 19px; width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6a84a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/%3E%3Cpath d='M8.5 12l2.5 2.5 4.5-5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.checks strong { font-size: 16px; }
.checks span { font-size: 15px; color: var(--dark-text); }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
}
.plan-featured { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.badge {
  position: absolute; top: -13px; left: 28px; background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.plan h3 { font-size: 22px; }
.plan-for { color: var(--muted); font-size: 15px; }
.price { margin: 18px 0 8px; min-height: 44px; display: flex; align-items: center; }
.placeholder {
  display: inline-block; padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--gold);
  color: var(--gold-text); font-weight: 600; font-size: 15px; background: rgba(214, 168, 74, .08);
}
.plan ul { list-style: none; padding: 0; margin: 8px 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li { padding-left: 26px; position: relative; font-size: 15px; }
.plan li::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f6b5c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.plan .btn { width: 100%; }
.fine { margin-top: 20px; font-size: 14px; color: var(--muted); text-align: center; }

/* FAQ */
details { border-bottom: 1px solid var(--border); padding: 4px 0; }
summary {
  cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative;
  font-weight: 600; font-size: 17px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; color: var(--primary);
}
details[open] summary::after { content: '−'; }
details p { padding: 0 0 20px; color: var(--muted); }

/* Final call */
.final { padding: 80px 0; }
.final-box {
  max-width: 1112px; background: radial-gradient(700px 300px at 100% 0%, rgba(214, 168, 74, .18), transparent 60%), var(--brand);
  color: var(--brand-contrast); border-radius: 24px; padding: 56px; text-align: center;
}
.final-box h2 { font-size: clamp(26px, 3.4vw, 36px); max-width: 720px; margin: 0 auto; }
.final-box p { margin: 14px auto 0; max-width: 600px; color: rgba(244, 241, 232, .82); }
.final-box .cta-row { justify-content: center; }

.foot { border-top: 1px solid var(--border); padding: 28px 0; font-size: 14px; color: var(--muted); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
  .nav { display: none; }
}
@media (max-width: 760px) {
  .plans { grid-template-columns: 1fr; }
  .band-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .top-row { gap: 10px; height: 60px; }
  .brand span { font-size: 18px; }
  .hero { padding: 40px 0 56px; }
  .lead { font-size: 17px; }
  .cta-row .btn { width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .mock-body { padding: 18px; }
  .mock-head { flex-direction: column; }
  .mock-level { text-align: left; }
  .mock-split { grid-template-columns: 1fr; gap: 14px; }
  .final-box { padding: 36px 20px; border-radius: 18px; }
  .foot-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
