/* Design tokens */
:root {
  --bg: #FAFAF7;
  --bg-alt: #F2EFE8;
  --bg-b: #F4EFE6;
  --bg-dark: #0F0E0C;
  --bg-dark-b: #1A1714;
  --ink: #0F0E0C;
  --ink-2: #3A342D;
  --muted: #6B635A;
  --line: rgba(15,14,12,0.10);
  --line-b: rgba(26,23,20,0.12);
  --orange: #E85D2A;
  --orange-hover: #D04E1E;
  --terracotta: #9C4A2C;
  --terracotta-hover: #8A3E24;
  --star: #B8772A;
  --green: #2A7A4B;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-accent: 'Instrument Serif', Georgia, serif;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --max-w: 1200px;
  --max-w-content: 960px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-ui); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none !important;
  line-height: 1.2;
}
.btn--orange { background: var(--orange); color: #fff; }
.btn--orange:hover { background: var(--orange-hover); }
.btn--terra { background: var(--terracotta); color: #fff; }
.btn--terra:hover { background: var(--terracotta-hover); }
.btn--outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--outline-dark { background: transparent; color: var(--ink); border: 1.5px solid rgba(15,14,12,0.25); }
.btn--outline-dark:hover { border-color: var(--ink); }
.btn--outline-warm { background: transparent; color: var(--ink-2); border: 1.5px solid rgba(26,23,20,0.3); }
.btn--outline-warm:hover { border-color: var(--ink-2); }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-hover); }
.btn--full { width: 100%; }
.btn--sm { padding: 9px 18px; font-size: 0.875rem; }
.btn--xs { padding: 5px 10px; font-size: 0.75rem; }

/* Check icon — replaces ✓ emoji */
.chk { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.chk::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: var(--orange);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='20 6 9 17 4 12' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='20 6 9 17 4 12' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
[data-variant="b"] .chk::before { background-color: var(--terracotta); }

/* Star row — replaces ★★★★★ emoji */
.star-row { display: inline-flex; align-items: center; gap: 1px; color: var(--star); }
.inline-star { display: inline; vertical-align: middle; color: var(--star); margin-left: 1px; }

/* Section labels */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
  display: block;
}
.section-label-b {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 12px;
  display: block;
  font-family: var(--font-ui);
}

/* Serif headlines for variant B */
.serif-h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
}
.serif-h2 em { font-style: italic; }

/* Form shared styles */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.form-group input,
.form-group textarea,
.form-group select {
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.9375rem;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--orange); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: #aaa; }
.form-group textarea { resize: vertical; min-height: 80px; }
.optional { color: var(--muted); font-weight: 400; }

.radio-tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-tile { position: relative; }
.radio-tile input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-tile > span {
  display: block;
  padding: 9px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
}
.radio-tile input[type="radio"]:checked + span { border-color: var(--orange); background: rgba(232,93,42,0.06); color: var(--orange); }
.radio-tiles--warm .radio-tile input[type="radio"]:checked + span { border-color: var(--terracotta); background: rgba(156,74,44,0.06); color: var(--terracotta); }

.file-drop { position: relative; }
.file-drop input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; }
.file-drop label {
  display: block;
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s;
}
.file-drop label:hover { border-color: var(--orange); color: var(--ink); }
.file-drop--warm label:hover { border-color: var(--terracotta); }

.form-trust { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 8px; }
.form-success {
  background: rgba(42,122,75,0.08);
  border: 1px solid rgba(42,122,75,0.3);
  color: #1a5c34;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  margin-top: 12px;
}
.form-error {
  background: rgba(220,38,38,0.07);
  border: 1px solid rgba(220,38,38,0.25);
  color: #b91c1c;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-top: 12px;
}

/* ===== Dark Mode ===== */

[data-theme="dark"] {
  --bg: #141210;
  --bg-alt: #1C1A17;
  --bg-b: #1C1A17;
  --bg-dark: #080706;
  --bg-dark-b: #0A0908;
  --ink: #F0EBE3;
  --ink-2: #C4BAB0;
  --muted: #8A8078;
  --line: rgba(240,235,227,0.10);
  --line-b: rgba(240,235,227,0.10);
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #141210;
    --bg-alt: #1C1A17;
    --bg-b: #1C1A17;
    --bg-dark: #080706;
    --bg-dark-b: #0A0908;
    --ink: #F0EBE3;
    --ink-2: #C4BAB0;
    --muted: #8A8078;
    --line: rgba(240,235,227,0.10);
    --line-b: rgba(240,235,227,0.10);
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  }
}

/* Dark mode: replace hardcoded #fff surfaces */
[data-theme="dark"] .ia-cred-card,
[data-theme="dark"] .va-cred-card,
[data-theme="dark"] .ia-why__card,
[data-theme="dark"] .va-why__card,
[data-theme="dark"] .ia-plan,
[data-theme="dark"] .va-plan,
[data-theme="dark"] .ia-beyond__dest,
[data-theme="dark"] .va-beyond__dest,
[data-theme="dark"] .ia-form__form,
[data-theme="dark"] .va-form__form,
[data-theme="dark"] .ib-why,
[data-theme="dark"] .ib-plans,
[data-theme="dark"] .ib-reviews,
[data-theme="dark"] .ib-form,
[data-theme="dark"] .vb-why,
[data-theme="dark"] .vb-plans,
[data-theme="dark"] .vb-reviews,
[data-theme="dark"] .vb-form,
[data-theme="dark"] .contact-page__form-wrap {
  background: var(--bg-alt);
  border-color: var(--line);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .ia-cred-card,
  html:not([data-theme="light"]):not([data-theme="dark"]) .va-cred-card,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ia-why__card,
  html:not([data-theme="light"]):not([data-theme="dark"]) .va-why__card,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ia-plan,
  html:not([data-theme="light"]):not([data-theme="dark"]) .va-plan,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ia-beyond__dest,
  html:not([data-theme="light"]):not([data-theme="dark"]) .va-beyond__dest,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ia-form__form,
  html:not([data-theme="light"]):not([data-theme="dark"]) .va-form__form,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ib-why,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ib-plans,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ib-reviews,
  html:not([data-theme="light"]):not([data-theme="dark"]) .ib-form,
  html:not([data-theme="light"]):not([data-theme="dark"]) .vb-why,
  html:not([data-theme="light"]):not([data-theme="dark"]) .vb-plans,
  html:not([data-theme="light"]):not([data-theme="dark"]) .vb-reviews,
  html:not([data-theme="light"]):not([data-theme="dark"]) .vb-form,
  html:not([data-theme="light"]):not([data-theme="dark"]) .contact-page__form-wrap {
    background: var(--bg-alt);
    border-color: var(--line);
  }
}

/* Dark mode: form inputs */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .radio-tile span,
[data-theme="dark"] .file-drop label {
  background: var(--bg-alt);
  color: var(--ink);
  border-color: var(--line);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .form-group input,
  html:not([data-theme="light"]):not([data-theme="dark"]) .form-group textarea,
  html:not([data-theme="light"]):not([data-theme="dark"]) .form-group select,
  html:not([data-theme="light"]):not([data-theme="dark"]) .radio-tile span,
  html:not([data-theme="light"]):not([data-theme="dark"]) .file-drop label {
    background: var(--bg-alt);
    color: var(--ink);
    border-color: var(--line);
  }
}

/* Theme toggle icons */
.theme-sun { display: none; }
.theme-moon { display: inline; }
[data-theme="dark"] .theme-sun { display: inline; }
[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .theme-sun { display: inline; }
  html:not([data-theme="light"]):not([data-theme="dark"]) .theme-moon { display: none; }
}

/* ===== Language Toggle ===== */
.t-bg { display: none; }
html[data-lang="bg"] .t-en { display: none; }
html[data-lang="bg"] .t-bg { display: revert; }

/* Sticky CTA */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-dark);
  color: #fff;
  padding: 12px 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  gap: 12px;
}
.sticky-cta span { font-size: 0.875rem; font-weight: 600; }
.sticky-cta--warm { background: var(--bg-dark-b); }

@media (max-width: 768px) {
  .sticky-cta { display: flex; }
}

/* ===== Consent checkbox (lead forms) ===== */
.form-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 4px 0 12px;
  cursor: pointer;
}
.form-consent input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
  cursor: pointer;
}
.form-consent a { color: inherit; text-decoration: underline; }

/* ===== Visible keyboard focus (a11y) ===== */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ===== Skip-to-content link (a11y: bypass blocks) ===== */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 2000;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

/* Radio-group fieldset should not introduce a border/box or break layout */
.form-group fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-group fieldset > legend { padding: 0; margin-bottom: 8px; }

/* Placeholders are supplementary to real labels; keep them from being dimmed
   below a legible contrast by the browser's default placeholder opacity. */
::placeholder { color: var(--muted); opacity: 1; }

/* ===== Respect the OS reduced-motion setting (a11y) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
