/* APEX UNICUT — unified design system */
:root {
  --apex-bg: #08070a;
  --apex-bg-2: #16121e;
  --apex-bg-3: #1c1726;
  --apex-bg-4: #221c2e;
  --apex-card: #16121e;
  --apex-border: #2e2640;
  --apex-border-light: #3d3354;
  --apex-text: #ece8f4;
  --apex-muted: #8b82a0;
  --apex-accent: #c084fc;
  --apex-accent-hover: #a855f7;
  --apex-accent-light: #e9d5ff;
  --apex-accent-soft: rgba(192, 132, 252, 0.12);
  --apex-accent-glow: rgba(192, 132, 252, 0.28);
  --apex-accent-border: rgba(192, 132, 252, 0.3);
  --apex-danger: #f472b6;
  --apex-success: #34d399;
  --apex-admin-warn: #e6a817;
  --apex-warn-bg: rgba(244, 114, 182, 0.1);
  --apex-warn-border: rgba(244, 114, 182, 0.32);
  --apex-warn-text: #e8b4d0;
  --apex-grid: radial-gradient(circle, #1e1828 1px, transparent 1px);
  --apex-font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --apex-btn-on-accent: #08070a;
  --apex-radius: 12px;
  --apex-radius-sm: 8px;
  --apex-radius-lg: 16px;
  --apex-shadow-glow: 0 0 40px rgba(192, 132, 252, 0.15);
  --apex-shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --apex-shadow-modal: 0 0 40px rgba(192, 132, 252, 0.12);
  --apex-shadow-faq-open: 0 0 24px rgba(192, 132, 252, 0.08);
  --apex-shadow-outline-hover: 0 0 20px rgba(192, 132, 252, 0.18);
  --apex-header-bg: rgba(8, 7, 10, 0.82);
  --apex-topnav-bg: #1e1e26;
  --apex-link-accent: #f06292;
  --apex-overlay: rgba(8, 7, 10, 0.92);
  --apex-glow-1: rgba(192, 132, 252, 0.18);
  --apex-glow-2: rgba(168, 85, 247, 0.08);
  --apex-glow-3: rgba(192, 132, 252, 0.06);
  --apex-hero-glow: rgba(192, 132, 252, 0.12);
  --apex-surface-highlight: rgba(192, 132, 252, 0.08);
  --apex-surface-highlight-strong: rgba(192, 132, 252, 0.14);
  --apex-surface-subtle: rgba(192, 132, 252, 0.07);
  --apex-surface-subtle-hover: rgba(192, 132, 252, 0.14);
  --apex-surface-inset: rgba(192, 132, 252, 0.06);
  --apex-surface-inset-strong: rgba(192, 132, 252, 0.1);
  --apex-feature-text: rgba(236, 232, 244, 0.78);
  --apex-nav-mobile-bg: rgba(22, 18, 30, 0.94);
  --apex-nav-mobile-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 20px var(--apex-accent-glow);
  --apex-logo-text: #ece8f4;
  --apex-logo-subtext: #8b82a0;
  --apex-job-log-bg: rgba(0, 0, 0, 0.25);
  --apex-btn-primary-shadow: 0 0 24px var(--apex-accent-glow);
  --apex-btn-primary-shadow-hover: 0 0 32px var(--apex-accent-glow);
}

[data-theme="light"] {
  --apex-bg: #f7f5fb;
  --apex-bg-2: #ffffff;
  --apex-bg-3: #f0edf5;
  --apex-bg-4: #ebe8f2;
  --apex-card: #ffffff;
  --apex-border: #e4deee;
  --apex-border-light: #d4cfe0;
  --apex-text: #141018;
  --apex-muted: #756b88;
  --apex-accent: #a855f7;
  --apex-accent-hover: #9333ea;
  --apex-accent-light: #ddd6fe;
  --apex-accent-soft: rgba(168, 85, 247, 0.07);
  --apex-accent-glow: rgba(168, 85, 247, 0.12);
  --apex-accent-border: rgba(168, 85, 247, 0.22);
  --apex-danger: #db2777;
  --apex-success: #059669;
  --apex-admin-warn: #d97706;
  --apex-warn-bg: rgba(219, 39, 119, 0.08);
  --apex-warn-border: rgba(219, 39, 119, 0.24);
  --apex-warn-text: #be185d;
  --apex-grid: radial-gradient(circle, #e4deee 1px, transparent 1px);
  --apex-btn-on-accent: #ffffff;
  --apex-shadow-glow: none;
  --apex-shadow-card: 0 4px 24px rgba(20, 16, 24, 0.06), 0 1px 3px rgba(20, 16, 24, 0.04);
  --apex-shadow-modal: 0 8px 40px rgba(20, 16, 24, 0.1);
  --apex-shadow-faq-open: var(--apex-shadow-card);
  --apex-shadow-outline-hover: 0 2px 12px rgba(168, 85, 247, 0.12);
  --apex-header-bg: rgba(255, 255, 255, 0.88);
  --apex-topnav-bg: #f0edf5;
  --apex-link-accent: #db2777;
  --apex-overlay: rgba(20, 16, 24, 0.45);
  --apex-glow-1: rgba(168, 85, 247, 0.05);
  --apex-glow-2: rgba(168, 85, 247, 0.03);
  --apex-glow-3: rgba(168, 85, 247, 0.04);
  --apex-hero-glow: rgba(168, 85, 247, 0.06);
  --apex-surface-highlight: rgba(168, 85, 247, 0.06);
  --apex-surface-highlight-strong: rgba(168, 85, 247, 0.1);
  --apex-surface-subtle: rgba(168, 85, 247, 0.05);
  --apex-surface-subtle-hover: rgba(168, 85, 247, 0.1);
  --apex-surface-inset: rgba(168, 85, 247, 0.04);
  --apex-surface-inset-strong: rgba(168, 85, 247, 0.08);
  --apex-feature-text: #564f66;
  --apex-nav-mobile-bg: rgba(255, 255, 255, 0.92);
  --apex-nav-mobile-shadow: 0 4px 24px rgba(20, 16, 24, 0.08), 0 1px 3px rgba(20, 16, 24, 0.04);
  --apex-logo-text: #141018;
  --apex-logo-subtext: #756b88;
  --apex-job-log-bg: rgba(20, 16, 24, 0.04);
  --apex-btn-primary-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
  --apex-btn-primary-shadow-hover: 0 4px 16px rgba(168, 85, 247, 0.25);
}

/* Smooth dark ↔ light theme switch (View Transitions + CSS fallback) */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.45s;
    animation-timing-function: ease;
  }

  html.apex-theme-animating,
  html.apex-theme-animating *,
  html.apex-theme-animating *::before,
  html.apex-theme-animating *::after {
    transition:
      background-color 0.45s ease,
      color 0.45s ease,
      border-color 0.45s ease,
      outline-color 0.45s ease,
      fill 0.45s ease,
      stroke 0.45s ease,
      box-shadow 0.45s ease !important;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.apex-body {
  font-family: var(--apex-font);
  background: var(--apex-bg);
  color: var(--apex-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }

/* Dark scrollbars — вместо стандартного белого ползунка браузера */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--apex-border-light) var(--apex-bg-2);
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: var(--apex-bg-2);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--apex-border-light);
  border-radius: 999px;
  border: 2px solid var(--apex-bg-2);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--apex-muted);
}

*::-webkit-scrollbar-corner {
  background: var(--apex-bg-2);
}

.apex-hidden { display: none !important; }

/* Background effects */
.apex-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--apex-glow-1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, var(--apex-glow-2), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, var(--apex-glow-3), transparent);
}

.apex-grid-bg {
  background-color: var(--apex-bg);
  background-image: var(--apex-grid);
  background-size: 18px 18px;
}

/* Typography */
.apex-eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--apex-muted);
  font-weight: 600;
}

.apex-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.apex-title-accent {
  background: linear-gradient(135deg, var(--apex-accent) 0%, var(--apex-accent-light) 50%, var(--apex-accent-hover) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.apex-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--apex-muted);
  max-width: 42rem;
  line-height: 1.65;
}

/* Logo */
.apex-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--apex-text);
  flex-shrink: 0;
}

.apex-logo img, .apex-logo svg { height: 28px; width: auto; display: block; }

.apex-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.apex-logo-text strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
}

.apex-logo-text span {
  font-size: 8px;
  letter-spacing: 3px;
  color: var(--apex-muted);
  font-weight: 600;
}

/* Buttons */
.apex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--apex-radius-sm);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.apex-btn:active { transform: scale(0.98); }

.apex-btn-primary {
  background: var(--apex-accent);
  color: var(--apex-btn-on-accent);
  box-shadow: var(--apex-btn-primary-shadow);
}

.apex-btn-primary:hover {
  background: var(--apex-accent-hover);
  box-shadow: var(--apex-btn-primary-shadow-hover);
}

.apex-btn-ghost {
  background: transparent;
  color: var(--apex-text);
  border: 1px solid var(--apex-border);
}

.apex-btn-ghost:hover {
  border-color: var(--apex-accent-border);
  color: var(--apex-accent);
  background: var(--apex-accent-soft);
}

.apex-btn-outline {
  background: transparent;
  color: var(--apex-accent);
  border: 1px solid var(--apex-accent-border);
}

.apex-btn-outline:hover {
  background: var(--apex-accent-soft);
  box-shadow: 0 0 20px var(--apex-accent-glow);
}

.apex-btn-lg {
  padding: 16px 32px;
  font-size: 14px;
  border-radius: var(--apex-radius);
}

.apex-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Cards */
.apex-card {
  background: var(--apex-card);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-lg);
  padding: 28px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.apex-card:hover {
  border-color: var(--apex-border-light);
}

.apex-card-featured {
  border-color: var(--apex-accent-border);
  background: linear-gradient(165deg, var(--apex-surface-highlight) 0%, var(--apex-card) 45%);
  box-shadow: var(--apex-shadow-glow), var(--apex-shadow-card);
  position: relative;
}

.apex-card-featured::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--apex-accent), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.apex-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--apex-accent-soft);
  color: var(--apex-accent);
  border: 1px solid var(--apex-accent-border);
}

/* Forms */
.apex-field { margin-bottom: 16px; text-align: left; }

.apex-field label {
  display: block;
  font-size: 11px;
  color: var(--apex-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.apex-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--apex-bg-3);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-sm);
  color: var(--apex-text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.apex-input:focus {
  border-color: var(--apex-accent);
  box-shadow: 0 0 0 3px var(--apex-accent-soft);
}

.apex-input::placeholder { color: var(--apex-muted); opacity: 0.7; }

.apex-error {
  color: var(--apex-danger);
  font-size: 12px;
  margin-top: 8px;
  min-height: 18px;
}

/* OTP code inputs */
.apex-otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.apex-otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  background: var(--apex-bg-3);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-sm);
  color: var(--apex-accent);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.apex-otp-digit:focus {
  border-color: var(--apex-accent);
  box-shadow: 0 0 0 3px var(--apex-accent-soft);
}

/* Modal */
.apex-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--apex-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.apex-modal-overlay:not(.apex-hidden) {
  display: flex;
}

.apex-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.apex-modal-wrap {
  width: min(420px, 100%);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s ease;
}

.apex-modal-overlay.is-open .apex-modal-wrap {
  transform: scale(1) translateY(0);
}

.feature-modal-wrap {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s ease;
}

.apex-modal-overlay.is-open .feature-modal-wrap {
  transform: scale(1) translateY(0);
}

.apex-modal {
  width: min(420px, 100%);
  background: var(--apex-bg-2);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-lg);
  padding: 32px;
  box-shadow: var(--apex-shadow-glow), var(--apex-shadow-card);
}

.apex-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.apex-modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--apex-accent);
  margin-top: 12px;
  text-shadow: 0 0 24px var(--apex-accent-glow);
}

.apex-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--apex-radius-sm);
  border: 1px solid var(--apex-border);
  color: var(--apex-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apex-modal-close:hover {
  color: var(--apex-danger);
  border-color: var(--apex-danger);
}

.apex-modal-wrap { position: relative; }

/* Auth tabs */
.apex-auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--apex-bg-3);
  border-radius: var(--apex-radius-sm);
  padding: 4px;
}

.apex-auth-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--apex-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.apex-auth-tab.active {
  background: var(--apex-bg-2);
  color: var(--apex-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.apex-login-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.apex-login-method {
  padding: 6px 10px;
  border: 1px solid var(--apex-border);
  border-radius: 999px;
  background: transparent;
  color: var(--apex-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.apex-login-method.active {
  border-color: var(--apex-accent);
  color: var(--apex-accent);
  background: var(--apex-accent-soft);
}

.apex-field-hint {
  font-size: 11px;
  color: var(--apex-muted);
  margin-top: 4px;
}

/* Header / Footer */
.apex-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: var(--apex-header-bg);
  border-bottom: 1px solid var(--apex-border);
}

.apex-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

/* Top navigation (inline in header row) */
.apex-topnav {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  background: transparent;
  border: none;
}

.apex-topnav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-height: 0;
  max-width: 100%;
  padding: 0 2px;
}

.apex-topnav-link,
.apex-topnav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--apex-text);
  text-decoration: none;
  opacity: 0.88;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}

.apex-topnav-link:hover,
.apex-topnav-dropdown-trigger:hover,
.apex-topnav-dropdown.is-open .apex-topnav-dropdown-trigger,
.apex-topnav-dropdown.has-active .apex-topnav-dropdown-trigger {
  opacity: 1;
  color: var(--apex-accent);
}

.apex-topnav-link.is-active {
  opacity: 1;
  color: var(--apex-accent);
}

.apex-topnav-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--apex-muted);
  transition: transform 0.2s ease, color 0.15s;
}

.apex-topnav-dropdown.is-open .apex-topnav-chevron,
.apex-topnav-dropdown.has-active .apex-topnav-chevron {
  transform: rotate(180deg);
  color: var(--apex-accent);
}

/* Resources dropdown */
.apex-topnav-dropdown {
  position: relative;
}

.apex-topnav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 200px;
  background: var(--apex-bg-2);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-sm);
  box-shadow: var(--apex-shadow-card);
  padding: 6px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.apex-topnav-dropdown.is-open .apex-topnav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.apex-topnav-dropdown-link {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--apex-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.apex-topnav-dropdown-link:hover {
  background: var(--apex-bg-3);
  color: var(--apex-accent);
}

.apex-topnav-dropdown-link.is-active {
  color: var(--apex-accent);
  background: var(--apex-accent-soft);
}

/* Burger menu button */
.apex-nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-sm);
  background: var(--apex-bg-3);
  color: var(--apex-text);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.apex-nav-burger:hover {
  border-color: var(--apex-accent-border);
  background: var(--apex-accent-soft);
}

.apex-nav-burger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.apex-nav-burger.is-open .apex-nav-burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.apex-nav-burger.is-open .apex-nav-burger-bar:nth-child(2) {
  opacity: 0;
}

.apex-nav-burger.is-open .apex-nav-burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile navigation panel */
.apex-mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.apex-mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: var(--apex-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.apex-mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 300px);
  height: 100%;
  padding: 56px 20px 24px;
  background: var(--apex-bg-2);
  border-left: 1px solid var(--apex-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.apex-mobile-nav-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-sm);
  background: var(--apex-bg-3);
  color: var(--apex-muted);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.apex-mobile-nav-close:hover {
  border-color: var(--apex-accent-border);
  color: var(--apex-text);
}

.apex-mobile-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--apex-text);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.apex-mobile-nav-link:hover,
.apex-mobile-nav-link.is-active {
  background: var(--apex-accent-soft);
  color: var(--apex-accent);
}

/* Theme toggle */
.apex-theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--apex-radius-sm);
  border: 1px solid var(--apex-border);
  background: var(--apex-bg-3);
  color: var(--apex-muted);
  line-height: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.apex-theme-toggle:hover {
  border-color: var(--apex-accent-border);
  background: var(--apex-accent-soft);
  color: color-mix(in srgb, var(--apex-muted) 70%, var(--apex-text) 30%);
}

[data-theme="light"] .apex-theme-toggle {
  color: #8a8199;
}

[data-theme="light"] .apex-theme-toggle:hover {
  color: #6f667a;
}

.apex-theme-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.apex-theme-toggle .theme-icon-dark,
.apex-theme-toggle .theme-icon-light {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.apex-theme-toggle .theme-icon-dark {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.apex-theme-toggle .theme-icon-light {
  position: absolute;
  opacity: 0;
  transform: scale(0.85) rotate(-20deg);
}

[data-theme="light"] .apex-theme-toggle .theme-icon-dark {
  opacity: 0;
  transform: scale(0.85) rotate(20deg);
}

[data-theme="light"] .apex-theme-toggle .theme-icon-light {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Auth: divider + Google button */
.apex-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--apex-muted);
  font-size: 12px;
}

.apex-auth-divider::before,
.apex-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--apex-border);
}

.apex-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.apex-btn-google:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.apex-btn-google:active {
  transform: scale(0.99);
}

[data-theme="light"] .apex-btn-google {
  border: 1px solid var(--apex-border);
}

.apex-btn-google svg {
  flex-shrink: 0;
}

.apex-auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--apex-muted);
}

.apex-auth-switch-link {
  color: var(--apex-link-accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.apex-auth-switch-link:hover {
  text-decoration: underline;
}

.apex-auth-terms {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--apex-border);
  border-radius: 12px;
  background: var(--apex-bg-2, rgba(255, 255, 255, 0.03));
}

.apex-auth-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.55;
  color: var(--apex-muted);
}

.apex-auth-terms-label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--apex-accent);
  cursor: pointer;
}

.apex-auth-terms-text a {
  color: var(--apex-accent);
  text-decoration: none;
}

.apex-auth-terms-text a:hover {
  text-decoration: underline;
}

.apex-auth-terms-error {
  margin: 8px 0 0 26px;
  min-height: 0;
}

.apex-auth-google-block.apex-hidden {
  display: none !important;
}

.apex-footer {
  border-top: 1px solid var(--apex-border);
  padding: 32px 24px;
  text-align: center;
  color: var(--apex-muted);
  font-size: 12px;
}

.apex-footer a {
  color: var(--apex-accent);
  text-decoration: none;
}

.apex-footer a:hover { text-decoration: underline; }

/* Section layout */
.apex-section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.apex-section-title {
  text-align: center;
  margin-bottom: 48px;
}

.apex-section-title h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  margin: 8px 0 12px;
}

.apex-section-title p {
  color: var(--apex-muted);
  font-size: 15px;
}

/* ── Pricing grid (subgrid alignment) ── */
.apex-pricing-wrap {
  position: relative;
  overflow: visible;
}

.apex-pricing-wrap .apex-pricing-grid {
  position: relative;
  z-index: 1;
}

.apex-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(6, auto);
  gap: 20px;
  align-items: stretch;
}

.apex-pricing-grid .apex-pricing-card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 6;
  height: 100%;
  padding: 28px 24px 36px;
}

.apex-pricing-grid .apex-pricing-card.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), var(--glass-shadow);
  transition:
    transform 0.55s var(--spring-bounce),
    border-color 0.4s ease,
    box-shadow 0.45s ease;
}

.apex-pricing-grid .apex-pricing-card.glass-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-inset), var(--glass-shadow-hover);
  transform: translateY(-4px) scale(1.02);
}

.apex-pricing-grid .apex-pricing-card.glass-card.apex-card-featured {
  border-color: rgba(168, 123, 234, 0.35);
  box-shadow: var(--glass-inset), var(--glass-shadow), 0 0 40px rgba(168, 123, 234, 0.1);
}

.apex-pricing-grid .apex-pricing-card.glass-card.apex-card-featured:hover {
  transform: translateY(-4px) scale(1.04);
}

/* Badge row */
.apex-pricing-grid .pricing-card-badge-row {
  display: flex;
  align-items: center;
  min-height: 28px;
}

/* Plan title */
.apex-pricing-grid .pricing-card-title {
  display: flex;
  align-items: flex-end;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--apex-muted);
  padding-top: 4px;
}

.apex-pricing-grid .pricing-card-title.featured {
  color: var(--apex-accent);
}

/* Price — shared baseline across all cards */
.apex-pricing-grid .pricing-card-price-row {
  display: flex;
  align-items: flex-end;
  padding-top: 12px;
}

.apex-pricing-grid .apex-price {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--apex-accent);
  line-height: 1;
}

/* Note sits below price; longer text only expands this row */
.apex-pricing-grid .pricing-card-note-row {
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  min-height: 20px;
}

.apex-pricing-grid .apex-price-note {
  margin: 0;
  font-size: 12px;
  color: var(--apex-muted);
  line-height: 1.4;
}

.apex-pricing-grid .pricing-unit-rate {
  margin-top: 4px;
  font-size: 11px;
  color: var(--apex-accent);
  opacity: 0.85;
}

/* Feature list */
.apex-pricing-grid .apex-feature-list {
  margin: 20px 0 0;
  padding-top: 4px;
  align-self: start;
}

.apex-pricing-grid .apex-feature-list li {
  min-height: 2.4em;
  line-height: 1.35;
  font-size: 13px;
  color: var(--apex-feature-text);
  padding: 5px 0 5px 22px;
}

.apex-pricing-grid .apex-feature-list li::before {
  content: "✓";
  color: var(--apex-accent);
  font-weight: 700;
  text-shadow: 0 0 8px var(--apex-accent-glow);
}

/* CTA buttons */
.apex-pricing-grid .apex-btn {
  width: 100%;
  margin-top: auto;
  align-self: end;
}

.apex-pricing-grid .apex-btn-outline {
  background: var(--apex-surface-subtle);
  color: var(--apex-text);
  border: 1px solid var(--apex-accent);
}

.apex-pricing-grid .apex-btn-outline:hover {
  background: var(--apex-surface-subtle-hover);
  border-color: var(--apex-accent-hover);
  color: var(--apex-text);
  box-shadow: var(--apex-shadow-outline-hover);
}

.apex-pricing-grid .apex-btn-primary {
  padding: 13px 24px;
}

@media (max-width: 1024px) {
  .apex-pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(12, auto);
  }

  .apex-pricing-grid .apex-pricing-card {
    grid-row: span 6;
  }
}

@media (max-width: 640px) {
  .apex-pricing-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .apex-pricing-grid .apex-pricing-card {
    grid-row: auto;
    grid-template-rows: auto auto auto auto 1fr auto;
  }
}

/* Fallback when subgrid is unavailable */
@supports not (grid-template-rows: subgrid) {
  .apex-pricing-grid {
    grid-template-rows: none;
  }

  .apex-pricing-grid .apex-pricing-card {
    grid-row: auto;
    grid-template-rows: auto auto auto auto 1fr auto;
  }

  .apex-pricing-grid .pricing-card-badge-row {
    min-height: 28px;
  }

  .apex-pricing-grid .pricing-card-title {
    min-height: 36px;
  }

  .apex-pricing-grid .pricing-card-price-row {
    min-height: 44px;
  }

  .apex-pricing-grid .pricing-card-note-row {
    min-height: 34px;
  }
}

.apex-price {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--apex-accent);
  line-height: 1;
  margin: 16px 0 4px;
}

.apex-price-note {
  font-size: 12px;
  color: var(--apex-muted);
  margin-bottom: 20px;
}

.apex-feature-list {
  list-style: none;
  margin: 20px 0 24px;
}

.apex-feature-list li {
  font-size: 13px;
  color: var(--apex-muted);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.apex-feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--apex-accent);
  font-weight: 700;
}

/* Feature strip */
.apex-features-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
}

@media (max-width: 768px) {
  .apex-features-strip { grid-template-columns: 1fr; }
}

.apex-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--apex-radius-sm);
  background: var(--apex-accent-soft);
  border: 1px solid var(--apex-accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

/* Hero */
.apex-hero {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.apex-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.apex-trust-line {
  font-size: 12px;
  color: var(--apex-muted);
  margin-top: 16px;
}

.apex-trust-line strong { color: var(--apex-accent); }

/* USD note */
.apex-usd-note {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--apex-warn-bg);
  border: 1px solid var(--apex-warn-border);
  border-radius: var(--apex-radius-sm);
  font-size: 12px;
  color: var(--apex-warn-text);
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

@keyframes apexFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes apexSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes apexScaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Clickable feature cards */
.apex-feature-card {
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.apex-feature-card:hover {
  border-color: var(--apex-accent-border);
  box-shadow: 0 0 28px var(--apex-accent-glow);
  transform: translateY(-4px);
}

.apex-feature-card:focus-visible {
  outline: 2px solid var(--apex-accent);
  outline-offset: 3px;
}

.apex-feature-more {
  display: block;
  font-size: 11px;
  color: var(--apex-accent);
  margin-top: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.apex-feature-card:hover .apex-feature-more {
  opacity: 1;
}

/* Feature detail modal */
.feature-modal {
  width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--apex-bg-2);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-lg);
  box-shadow: var(--apex-shadow-card);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.feature-modal-header {
  text-align: center;
  padding: 32px 32px 0;
  flex-shrink: 0;
}

.feature-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--apex-radius-sm);
  background: var(--apex-accent-soft);
  border: 1px solid var(--apex-accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 12px;
}

.feature-modal-eyebrow {
  margin-bottom: 8px;
  color: var(--apex-accent);
}

.feature-modal-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--apex-text);
  margin-bottom: 8px;
}

.feature-modal-subtitle {
  font-size: 14px;
  color: var(--apex-muted);
  line-height: 1.55;
  max-width: 420px;
  margin: 0 auto;
}

.feature-modal-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 32px;
  padding-right: 26px;
  scrollbar-color: var(--apex-border-light) var(--apex-bg-2);
}

.feature-modal-section {
  margin-bottom: 20px;
}

.feature-modal-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--apex-muted);
  margin-bottom: 10px;
}

.feature-check-list {
  list-style: none;
}

.feature-check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--apex-text);
  padding: 5px 0;
  line-height: 1.5;
}

.feature-check-list li::before {
  content: "✓";
  flex-shrink: 0;
  width: 14px;
  color: var(--apex-accent);
  font-weight: 700;
}

.feature-modal-audience {
  font-size: 13px;
  color: var(--apex-muted);
  line-height: 1.65;
}

.feature-steps {
  list-style: none;
  counter-reset: feature-step;
}

.feature-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  counter-increment: feature-step;
  font-size: 13px;
  color: var(--apex-text);
  padding: 8px 0;
  line-height: 1.5;
}

.feature-steps li::before {
  content: counter(feature-step);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--apex-accent-soft);
  border: 1px solid var(--apex-accent-border);
  color: var(--apex-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.feature-highlight {
  background: var(--apex-accent-soft);
  border: 1px solid var(--apex-accent-border);
  border-radius: var(--apex-radius);
  padding: 16px 18px;
  margin-top: 4px;
}

.feature-highlight-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--apex-accent);
  margin-bottom: 6px;
}

.feature-highlight p {
  font-size: 14px;
  font-weight: 600;
  color: var(--apex-text);
  line-height: 1.55;
}

.feature-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 32px 28px;
  flex-shrink: 0;
  border-top: 1px solid var(--apex-border);
  padding-top: 20px;
  background: var(--apex-bg-2);
}

.feature-modal-actions .apex-btn {
  width: 100%;
}

@media (max-width: 480px) {
  .feature-modal-header {
    padding: 24px 20px 0;
  }

  .feature-modal-content {
    padding: 20px;
  }

  .feature-modal-actions {
    padding: 16px 20px 20px;
  }

  .feature-modal-header h2 {
    font-size: 19px;
  }
}

/* ── FAQ accordion ── */
.apex-faq-section {
  padding-top: 0;
}

.apex-faq {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.apex-faq-item {
  background: var(--apex-card);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.apex-faq-item:hover {
  border-color: var(--apex-border-light);
}

.apex-faq-item.is-open {
  border-color: var(--apex-accent-border);
  box-shadow: var(--apex-shadow-faq-open);
}

.apex-faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  color: var(--apex-text);
  background: transparent;
  transition: color 0.15s;
}

.apex-faq-question:hover {
  color: var(--apex-accent);
}

.apex-faq-item.is-open .apex-faq-question {
  color: var(--apex-accent);
}

.apex-faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--apex-border);
  position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.25s;
}

.apex-faq-icon::before,
.apex-faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--apex-muted);
  border-radius: 1px;
  transition: background 0.2s, transform 0.25s;
}

.apex-faq-icon::before {
  width: 10px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.apex-faq-icon::after {
  width: 2px;
  height: 10px;
  transform: translate(-50%, -50%);
}

.apex-faq-item.is-open .apex-faq-icon {
  border-color: var(--apex-accent-border);
  background: var(--apex-accent-soft);
  transform: rotate(180deg);
}

.apex-faq-item.is-open .apex-faq-icon::before,
.apex-faq-item.is-open .apex-faq-icon::after {
  background: var(--apex-accent);
}

.apex-faq-item.is-open .apex-faq-icon::after {
  transform: translate(-50%, -50%) scaleY(0);
}

.apex-faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.apex-faq-item.is-open .apex-faq-answer {
  grid-template-rows: 1fr;
}

.apex-faq-answer-inner {
  overflow: hidden;
}

.apex-faq-answer-inner p {
  padding: 0 22px 18px;
  font-size: 14px;
  color: var(--apex-muted);
  line-height: 1.65;
}

.apex-faq-answer-inner p + p {
  padding-top: 10px;
}

.apex-faq-answer-inner strong {
  color: var(--apex-text);
  font-weight: 600;
}

.apex-faq-cta {
  max-width: 720px;
  margin: 40px auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.apex-faq-cta p {
  font-size: 14px;
  color: var(--apex-muted);
}

.apex-faq-cta a {
  color: var(--apex-accent);
  text-decoration: none;
}

.apex-faq-cta a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .apex-faq-question {
    padding: 16px 18px;
    font-size: 14px;
  }

  .apex-faq-answer-inner p {
    padding: 0 18px 16px;
    font-size: 13px;
  }
}

/* ── Header actions + Language selector ── */
.apex-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  padding-left: 12px;
  margin-left: 4px;
  background: var(--apex-header-bg);
  box-shadow: -14px 0 18px var(--apex-header-bg);
}

.apex-header-utilities {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apex-header-utilities .apex-theme-toggle,
.apex-header-utilities .lang-trigger {
  height: 38px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(28, 26, 36, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.apex-header-utilities .apex-theme-toggle {
  width: 38px;
}

.apex-header-utilities .lang-trigger {
  padding: 0 12px;
}

.apex-header-utilities .apex-theme-toggle:hover,
.apex-header-utilities .lang-trigger:hover,
.apex-header-utilities .lang-selector.open .lang-trigger {
  border-color: rgba(168, 123, 234, 0.28);
  background: rgba(36, 32, 48, 0.96);
}

.apex-header-quicklinks {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 14px;
  margin-left: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.apex-header-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.015em;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.apex-header-link:hover {
  color: rgba(255, 255, 255, 0.78);
}

.apex-header-link.is-active {
  color: rgba(255, 255, 255, 0.96);
  font-weight: 600;
}

.apex-header-link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 1px;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 1px;
}

.apex-btn-header-cta {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0c0814;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(
    145deg,
    #d8b4fe 0%,
    #c084fc 38%,
    #a855f7 72%,
    #9333ea 100%
  );
  box-shadow:
    0 0 22px rgba(168, 85, 247, 0.38),
    0 4px 16px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.12s ease,
    border-color 0.22s ease;
}

.apex-btn-header-cta:hover {
  background: linear-gradient(
    145deg,
    #e9d5ff 0%,
    #d8b4fe 38%,
    #c084fc 72%,
    #a855f7 100%
  );
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 0 30px rgba(168, 85, 247, 0.48),
    0 6px 20px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

[data-theme="light"] .apex-header-utilities .apex-theme-toggle,
[data-theme="light"] .apex-header-utilities .lang-trigger {
  border-color: rgba(168, 85, 247, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .apex-header-quicklinks {
  border-left-color: rgba(20, 16, 24, 0.1);
}

[data-theme="light"] .apex-header-link {
  color: rgba(20, 16, 24, 0.48);
}

[data-theme="light"] .apex-header-link:hover {
  color: rgba(20, 16, 24, 0.78);
}

[data-theme="light"] .apex-header-link.is-active {
  color: rgba(20, 16, 24, 0.92);
}

[data-theme="light"] .apex-header-link.is-active::after {
  background: rgba(124, 58, 237, 0.45);
}

[data-theme="light"] .apex-btn-header-cta {
  color: #1a1028;
  box-shadow:
    0 0 18px rgba(168, 85, 247, 0.28),
    0 4px 14px rgba(20, 16, 24, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.lang-selector {
  position: relative;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--apex-bg-3);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--apex-text);
  transition: border-color 0.15s, background 0.15s;
}

.lang-trigger:hover,
.lang-selector.open .lang-trigger {
  border-color: var(--apex-accent-border);
  background: var(--apex-accent-soft);
}

.lang-globe { font-size: 14px; opacity: 0.85; }
.lang-chev { font-size: 9px; color: var(--apex-muted); transition: transform 0.2s; }
.lang-selector.open .lang-chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--apex-bg-2);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius-sm);
  box-shadow: var(--apex-shadow-card);
  padding: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.lang-selector.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  color: var(--apex-text);
  transition: background 0.12s;
  flex-shrink: 0;
}

.lang-option:hover { background: var(--apex-bg-3); }

.lang-option.active {
  background: var(--apex-accent);
  color: var(--apex-btn-on-accent);
  font-weight: 600;
}

.lang-check { font-size: 14px; font-weight: 700; }

/* ── Referral program (vertical timeline) ── */
.ref-program {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.ref-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 52px;
}

.ref-steps::before {
  content: '';
  position: absolute;
  left: 25px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--apex-accent-border), var(--apex-border));
  border-radius: 1px;
  z-index: 0;
}

.ref-step {
  background: var(--apex-card);
  border: 1px solid var(--apex-border);
  border-radius: var(--apex-radius);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.ref-step:last-child { margin-bottom: 0; }

.ref-step-marker {
  position: absolute;
  left: -52px;
  top: 20px;
  z-index: 2;
}

.ref-step-clickable { cursor: pointer; transition: border-color 0.15s; }
.ref-step-clickable:hover { border-color: var(--apex-accent-border); }

.ref-step-done { border-color: var(--apex-accent-border); }
.ref-step-done .ref-step-num { background: var(--apex-accent); color: var(--apex-btn-on-accent); }

.ref-step-num {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--apex-bg-3);
  border: 2px solid var(--apex-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--apex-accent);
  box-shadow: 0 0 0 4px var(--apex-bg);
}

.ref-step-body {
  min-width: 0;
  position: relative;
  z-index: 2;
}

.ref-step-body h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.ref-step-body p { font-size: 13px; color: var(--apex-muted); line-height: 1.5; margin: 0; }

.ref-link-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--apex-bg-3);
  border: 1px dashed var(--apex-border);
  border-radius: 8px;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
  color: var(--apex-text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ref-copy-btn { margin-top: 12px; width: 100%; }

.ref-balance {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--apex-accent-soft);
  border: 1px solid var(--apex-accent-border);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.ref-balance-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ref-balance strong {
  font-size: 20px;
  color: var(--apex-accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.ref-usdt-note {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--apex-muted);
}

.ref-history { margin-top: 16px; }

.ref-history-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--apex-muted);
  margin-bottom: 10px;
}

.ref-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ref-history-list li {
  display: grid;
  grid-template-columns: 92px minmax(44px, auto) minmax(112px, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--apex-border);
  font-size: 12px;
  color: var(--apex-muted);
  align-items: center;
}

.ref-history-list li:last-child { border-bottom: none; }

.ref-h-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ref-h-user { text-align: center; font-weight: 600; color: var(--apex-text); }
.ref-h-amount {
  text-align: right;
  color: var(--apex-success);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ref-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--apex-accent);
  color: var(--apex-btn-on-accent);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 8px 24px var(--apex-accent-glow);
}

.ref-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ref-paywall {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--apex-accent-border);
  border-radius: 12px;
  background: var(--apex-bg-2);
  text-align: center;
}

.ref-paywall p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--apex-muted);
  line-height: 1.5;
}

.ref-program.ref-grace-blocked .ref-steps {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.ref-wallet-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.ref-wallet-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--apex-border);
  background: var(--apex-bg);
  color: var(--apex-text);
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.ref-h-empty {
  justify-content: center;
  color: var(--apex-muted);
  font-size: 13px;
}

.referral-page-main {
  padding: 0 20px 64px;
  max-width: 920px;
  margin: 0 auto;
}

.referral-teaser-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.referral-teaser-balance {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.referral-teaser-balance span {
  font-size: 12px;
  color: var(--apex-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.referral-teaser-balance strong {
  font-size: 28px;
  font-weight: 800;
  color: var(--apex-accent);
}

/* ── All formats card ── */
.formats-card { max-width: 720px; margin: 0 auto; padding: 24px; }

.fmt-group { margin-bottom: 16px; }
.fmt-group-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--apex-muted); margin-bottom: 8px; }

.fmt-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.fmt-chip {
  padding: 4px 10px;
  background: var(--apex-bg-3);
  border: 1px solid var(--apex-border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--apex-text);
}

.formats-drop {
  margin-top: 20px;
  padding: 28px 20px;
  border: 1.5px dashed var(--apex-border);
  border-radius: var(--apex-radius);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.formats-drop:hover,
.formats-drop.dragover {
  border-color: var(--apex-accent);
  background: var(--apex-accent-soft);
}

.formats-drop-icon { font-size: 28px; margin-bottom: 8px; opacity: 0.7; }
.formats-filename { font-size: 12px; color: var(--apex-text); margin-top: 8px; word-break: break-all; }

.formats-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--apex-border);
  border-top-color: var(--apex-accent);
  border-radius: 50%;
  margin: 12px auto 0;
  animation: spin 0.8s linear infinite;
  display: none;
}

.formats-spinner.visible { display: block; }

.formats-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--apex-muted);
}

.formats-status.ready { color: var(--apex-success); }
.formats-status.error { color: var(--apex-danger); }
.formats-status.converting { color: var(--apex-accent); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1023px) {
  .apex-topnav {
    display: none;
  }

  .apex-nav-burger {
    display: inline-flex;
  }
}

@media (max-width: 1024px) {
  #btn-open-auth,
  #btn-auth,
  .apex-btn-header-cta {
    padding: 8px 14px;
    font-size: 12px;
  }

  .apex-header-quicklinks {
    display: none;
  }
}

@media (max-width: 768px) {
  .ref-steps { padding-left: 44px; }
  .ref-step-marker { left: -44px; }
  .ref-steps::before { left: 21px; }
  .ref-history-list li { grid-template-columns: 76px 40px minmax(100px, 1fr); gap: 8px; }
  .ref-balance { flex-wrap: wrap; }
  .ref-balance strong { font-size: 18px; }
  .apex-header-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  .apex-header-actions { gap: 6px; }
  .lang-trigger { padding: 6px 10px; font-size: 11px; }
  #btn-open-auth,
  #btn-auth,
  .apex-btn-header-cta {
    padding: 7px 10px;
    font-size: 11px;
    white-space: nowrap;
  }
  .apex-logo-img--dark,
  .apex-logo-img--light {
    width: 96px;
    height: auto;
  }
}

/* ── Scroll reveal ── */
.apex-reveal,
.apex-reveal-stagger {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.apex-reveal.is-visible,
.apex-reveal-stagger.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.apex-features-strip .apex-reveal-stagger:nth-child(1) { transition-delay: 0ms; }
.apex-features-strip .apex-reveal-stagger:nth-child(2) { transition-delay: 80ms; }
.apex-features-strip .apex-reveal-stagger:nth-child(3) { transition-delay: 160ms; }

/* ── Section dividers ── */
.apex-section-divider {
  position: relative;
}

.apex-section-divider::before {
  content: '';
  display: block;
  height: 1px;
  max-width: 720px;
  margin: 0 auto 48px;
  background: linear-gradient(90deg, transparent, var(--apex-accent-border), transparent);
  opacity: 0.6;
}

/* ── Hero glow ring ── */
.hero-glow-ring {
  position: absolute;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, var(--apex-hero-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  pointer-events: none;
  z-index: 0;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--apex-border);
  width: 100%;
  max-width: 640px;
}

.hero-stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--apex-accent);
}

.hero-stat-lbl {
  font-size: 11px;
  color: var(--apex-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ── Hero glow pulse ── */
@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -60%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -60%) scale(1.04); }
}

.apex-hero .hero-glow-ring {
  animation: heroGlowPulse 4s ease-in-out infinite;
}

/* ── Logo theme switch ── */
.apex-logo-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.apex-logo-switch img {
  height: 28px;
  width: auto;
  display: block;
  transition: opacity 0.35s ease;
}

.apex-logo-switch .apex-logo-img--light {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
}

[data-theme="light"] .apex-logo-switch .apex-logo-img--dark {
  opacity: 0;
}

[data-theme="light"] .apex-logo-switch .apex-logo-img--light {
  opacity: 1;
}

.brand-logo .apex-logo-switch img {
  height: 26px;
}

.apex-logo-switch--center {
  margin: 0 auto;
}

.apex-logo-switch--sm img {
  height: 28px;
}

/* ── Light theme component overrides ── */
[data-theme="light"] .apex-card-featured {
  box-shadow: var(--apex-shadow-card);
}

[data-theme="light"] .apex-pricing-grid .apex-feature-list li::before {
  text-shadow: none;
}

/* ── Shared legal links block ── */
.apex-legal-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.apex-legal-links a {
  color: var(--apex-muted);
  font-size: 13px;
  text-decoration: none;
}

.apex-legal-links a:hover {
  color: var(--apex-accent);
  text-decoration: underline;
}
