.site-header .header-nav a.active {
  position: relative;
  color: var(--navy);
  font-weight: 800;
}

.site-header .header-nav a.active::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -5px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--orange);
}

.header-current-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 4px 10px;
  border: 1px solid var(--orange-tint);
  border-radius: var(--r-pill);
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.site-header .header-btn.is-current-page {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

[data-theme="dark"] .header-current-page {
  border-color: var(--orange);
  background: var(--bg-2);
  color: var(--orange-light);
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  width: 76px;
  min-width: 76px;
  height: 36px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--orange-tint);
  border-radius: var(--r-pill);
  background: var(--orange-soft);
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color var(--duration) var(--ease-in-out),
    border-color var(--duration) var(--ease-in-out);
}

.theme-toggle-option {
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: var(--ink-soft);
  transition:
    color var(--duration) var(--ease-in-out);
}

.theme-toggle:not(.is-dark) .theme-toggle-option-light,
.theme-toggle.is-dark .theme-toggle-option-dark {
  color: var(--white);
}

.theme-toggle-thumb {
  position: absolute;
  z-index: 0;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(11, 45, 83, 0.2);
  transition:
    transform var(--duration) var(--ease-in-out),
    background-color var(--duration) var(--ease-in-out);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.theme-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-toggle-thumb svg {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.theme-toggle.is-dark .theme-toggle-thumb {
  transform: translateX(40px);
}

[data-theme="dark"] .theme-toggle {
  border-color: var(--line);
  background: var(--bg-2);
}

[data-theme="dark"] .theme-toggle-option {
  color: var(--ink-soft);
}

.theme-toggle-floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] body {
  background-color: var(--bg);
  color: var(--ink);
}

[data-theme="dark"]
  :is(
    .contact-card,
    .contact-form,
    .consultant-form,
    .form-section,
    .faq-item,
    .faq-answer
  ) {
  border-color: var(--line);
  background-color: var(--bg-card);
  color: var(--ink);
}

[data-theme="dark"] :is(input, textarea, select) {
  border-color: var(--line);
  background-color: var(--bg-2);
  color: var(--ink);
  color-scheme: dark;
}

[data-theme="dark"] :is(input, textarea, select)::placeholder {
  color: var(--mute);
}

[data-theme="dark"] .progress-container {
  border-color: var(--line);
  background: var(--bg-card);
  color: var(--ink);
}

[data-theme="dark"] .progress-bar {
  background: var(--bg-2);
}

[data-theme="dark"] .site-header .header-menu-toggle {
  border-color: var(--line);
  background: var(--bg-card);
  color: var(--ink);
}

[data-theme="dark"] .logo-home-cue {
  border-color: var(--line);
  background: var(--bg-2);
  color: var(--ink-soft);
}

[data-theme="dark"] .site-header .logo:hover .logo-home-cue,
[data-theme="dark"] .site-header .logo:focus-visible .logo-home-cue,
[data-theme="dark"] .site-header .logo.is-current-page .logo-home-cue {
  border-color: var(--orange);
  background: var(--bg-card);
  color: var(--orange-light);
}

@media (max-width: 850px) {
  [data-theme="dark"] .site-header .header-nav {
    background-color: var(--bg-card);
  }

  .site-header .header-nav a.active::after {
    inset-inline-start: 14px;
    inset-inline-end: auto;
    inset-block-end: 6px;
    width: 28px;
  }

  .site-header .header-nav a.mobile-nav-contact::after {
    content: none;
  }

  .header-current-page {
    align-self: stretch;
    margin: 4px 6px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    justify-content: flex-start;
  }

  .site-header .site-header-actions {
    order: 2;
    margin-left: auto;
  }

  .site-header .header-menu-toggle {
    order: 3;
  }
}

@media (max-width: 280px) {
  .theme-toggle {
    width: 72px;
    min-width: 72px;
    height: 34px;
    padding: 3px;
  }

  .theme-toggle-option {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .theme-toggle-thumb {
    inset-block-start: 3px;
    inset-inline-start: 3px;
    width: 26px;
    height: 26px;
  }

  .theme-toggle.is-dark .theme-toggle-thumb {
    transform: translateX(38px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle {
    transition: none;
  }

  .theme-toggle-option,
  .theme-toggle-thumb {
    transition: none;
  }
}
