:root {
  color-scheme: light;
}

body {
  transition: background 0.35s ease, color 0.35s ease;
}

body[data-theme="dark"] {
  --bg: #0f1722;
  --bg-alt: #111f2d;
  --text: #ebf3fb;
  --muted: #9cb1c5;
  --accent: #8ed5ec;
  --accent-2: #4f9db5;
  --card: #142131;
  --border: rgba(210, 227, 244, 0.12);
  --card-outline: rgba(142, 213, 236, 0.34);
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
  background:
    radial-gradient(circle at 14% 8%, rgba(79, 157, 181, 0.18) 0%, rgba(17, 31, 45, 0) 38%),
    linear-gradient(180deg, #122030 0%, #0f1722 52%, var(--bg) 100%);
}

body[data-theme="dark"] .site-header {
  background: linear-gradient(120deg, rgba(18, 29, 43, 0.94), rgba(14, 23, 34, 0.92));
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

body[data-theme="dark"] .nav-links {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .nav-links a,
body[data-theme="dark"] .nav-links .cta {
  color: #d8e5f1;
}

body[data-theme="dark"] .nav-links a:hover,
body[data-theme="dark"] .nav-links .cta:hover {
  background: rgba(142, 213, 236, 0.12);
  color: var(--accent);
}

body[data-theme="dark"] .brand-mark {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
}

.theme-toggle {
  position: relative;
  width: 124px;
  height: 58px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(223, 233, 243, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 20px rgba(20, 30, 42, 0.12);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle-nav {
  flex: 0 0 auto;
  margin-left: 4px;
}

.theme-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #262a31 0%, #11151b 50%, #e8eaee 50%, #f4f5f7 100%);
}

.theme-toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: #0d1117;
  opacity: 0.78;
  transition: opacity 0.3s ease, color 0.3s ease;
  pointer-events: none;
}

.theme-toggle-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.theme-toggle-icon.moon {
  left: 28px;
  color: #f5f7fa;
  opacity: 1;
}

.theme-toggle-icon.sun {
  right: 28px;
}

.theme-toggle-thumb {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transition: transform 0.3s ease, background 0.3s ease;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
  transform: translateX(66px);
  background: linear-gradient(180deg, #323b46 0%, #1d242d 100%);
}

.theme-toggle[aria-pressed="true"] .theme-toggle-icon.sun {
  color: #56697d;
  opacity: 0.5;
}

.theme-toggle[aria-pressed="false"] .theme-toggle-icon.sun {
  opacity: 1;
}

.theme-toggle[aria-pressed="false"] .theme-toggle-icon.moon {
  opacity: 0.68;
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .team-card,
body[data-theme="dark"] .project-card,
body[data-theme="dark"] .buy-plan-card,
body[data-theme="dark"] .cart-panel,
body[data-theme="dark"] .contact-form-card,
body[data-theme="dark"] .contact-info-card {
  background: linear-gradient(170deg, rgba(22, 35, 50, 0.96), rgba(16, 27, 39, 0.96));
  color: var(--text);
  border-color: var(--card-outline);
}

body[data-theme="dark"] .project-meta,
body[data-theme="dark"] .buy-plan-meta,
body[data-theme="dark"] .buy-plan-media,
body[data-theme="dark"] .cart-item,
body[data-theme="dark"] .cart-total,
body[data-theme="dark"] .payment-panel,
body[data-theme="dark"] .open-hours,
body[data-theme="dark"] .captcha-question {
  background: rgba(20, 32, 47, 0.94);
  color: var(--text);
}

body[data-theme="dark"] .section.alt {
  background:
    linear-gradient(145deg, rgba(17, 31, 45, 0.92), rgba(12, 22, 32, 0.94)),
    var(--bg-alt);
}

body[data-theme="dark"] select,
body[data-theme="dark"] .input,
body[data-theme="dark"] .textarea {
  background: #162230;
  color: var(--text);
  border-color: var(--border);
}

body[data-theme="dark"] .input::placeholder,
body[data-theme="dark"] .textarea::placeholder {
  color: #86a0b8;
}

body[data-theme="dark"] table {
  background: var(--card);
}

body[data-theme="dark"] th,
body[data-theme="dark"] td {
  border-bottom-color: var(--border);
}

body[data-theme="dark"] .muted,
body[data-theme="dark"] .form-note {
  color: var(--muted);
}

@media (max-width: 760px) {
  .theme-toggle {
    width: 110px;
    height: 52px;
  }

  .theme-toggle-thumb {
    width: 42px;
    height: 42px;
  }

  .theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
    transform: translateX(58px);
  }

  .theme-toggle-icon.moon {
    left: 24px;
  }

  .theme-toggle-icon.sun {
    right: 24px;
  }
}
