/* ============================================================
   4LABS DESIGN SYSTEM — COMPONENTS
   All components use design tokens from tokens.css.
   ============================================================ */

/* === PAGE LOADER === */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


/* === ACCESSIBILITY === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: var(--z-toast);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-sm);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-default);
}
.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible: handled in base styles below */
:focus:not(:focus-visible) {
  outline: none;
}

/* Input error state */
.input--error {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 2px var(--color-error-subtle) !important;
}
.field-error {
  color: var(--color-error);
  font-size: var(--text-caption);
  margin-top: var(--space-3xs);
  display: block;
}

/* === BASE STYLES === */
html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;  /* fallback for older iOS Safari */
  overflow-x: clip;    /* modern browsers: avoids scroll container fighting Lenis */
  transition: background-color var(--duration-slow) var(--ease-default),
              color var(--duration-slow) var(--ease-default);
}

/* Lenis smooth-scroll overrides (required by lenis v1.1+) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
html.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
html.lenis.lenis-stopped { overflow: hidden; }

/* Smooth theme transitions for key surfaces */
.navbar, .card, .section, footer, .btn,
.pricing-card, .faq-section, .accordion-trigger,
.accordion, .modal, .chip, .input, .select {
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* Character-level split for heading reveals */
.char { display: inline-block; overflow: hidden; perspective: 600px; }
.char-inner { display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  .char-inner { transform: none !important; opacity: 1 !important; }
}

/* Counter slot-machine digit tumble */
.counter-digit-col {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  height: 1.2em;
  line-height: 1.2em;
}
.counter-digit-strip { display: block; will-change: transform; }
.counter-digit {
  display: block;
  height: 1.2em;
  line-height: 1.2em;
  text-align: center;
}
.counter-affix { display: inline-block; }
.counter-particle {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  pointer-events: none;
  z-index: 100;
  will-change: transform, opacity;
}
@media (prefers-reduced-motion: reduce) {
  .counter-digit-strip { transform: none !important; }
  .counter-particle { display: none; }
}

/* Focus visible for keyboard nav */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  box-shadow: none;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition-colors);
}
a:hover:not(.btn) { color: var(--color-accent-hover); }

img { max-width: 100%; height: auto; display: block; }


/* === LAYOUT UTILITIES === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--grid-margin);
  padding-right: var(--grid-margin);
}

.container--narrow { max-width: var(--content-narrow); }
.container--wide   { max-width: var(--content-wide); }

.section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
  position: relative;
  scroll-margin-top: 80px;
  overflow-x: hidden;  /* only clip horizontal — overflow: hidden creates scroll container that blocks scrollIntoView on mobile */
}

.grid {
  display: grid;
  gap: var(--grid-gutter);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4, .grid-6 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.text-center { text-align: center; }
.text-left { text-align: left; }


/* === TYPOGRAPHY === */
.display {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
}

h1, .h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2, .h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

h3, .h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

h4, .h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.body-lg   { font-size: var(--text-body-lg); }
.body      { font-size: var(--text-body); }
.body-sm   { font-size: var(--text-body-sm); }
.caption   { font-size: var(--text-caption); font-weight: var(--weight-medium); }
.overline  {
  font-size: var(--text-overline);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
}

.mono { font-family: var(--font-mono); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary  { color: var(--color-text-tertiary); }
.text-accent    { color: var(--color-accent); }


/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  border: none;
  cursor: pointer;
  transition: var(--transition-colors), var(--transition-transform);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn:active { transform: scale(0.97) translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; box-shadow: none; }

/* Sizes */
.btn--sm {
  height: 36px;
  padding: 0 var(--space-sm);
  font-size: var(--text-body-sm);
  border-radius: var(--radius-sm);
}
.btn--md {
  height: 44px;
  padding: 0 var(--space-md);
  font-size: var(--text-body);
  border-radius: var(--radius-sm);
}
.btn--lg {
  height: 52px;
  padding: 0 var(--space-lg);
  font-size: var(--text-body-lg);
  border-radius: var(--radius-sm);
}

/* Variants */
.btn--primary {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  box-shadow: var(--shadow-glow-cta);
}
.btn--primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-text-on-accent);
  box-shadow: var(--shadow-glow-strong);
}
.btn--primary:active { transform: translateY(1px) scale(0.97); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }

.btn--secondary {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}
.btn--secondary:hover {
  background: var(--color-surface-3);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn--ghost:hover {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

.btn--loading {
  color: transparent !important;
  pointer-events: none;
  overflow: hidden;
}
.btn--loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Magnetic CTA (desktop only) */
@media (hover: hover) and (pointer: fine) {
  .btn--magnetic {
    transition: transform var(--duration-fast) var(--ease-spring);
  }
  .btn--magnetic > span {
    display: inline-block;
    pointer-events: none;
    position: relative;
    z-index: 1;
  }
}


/* === GLASS CARD === */
.card {
  background: rgba(var(--color-bg-rgb), 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-base) var(--ease-default),
              border-color var(--duration-base) var(--ease-default);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card--glass {
  background: var(--lg-bg-2);
  backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border-color: var(--lg-border-luminous);
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow), var(--shadow-card);
  position: relative;
}

.card--elevated {
  background: var(--lg-bg-2);
  backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow), var(--shadow-card);
}

.card--interactive {
  cursor: pointer;
}
.card--interactive:hover {
  transform: translateY(-1px);
  border-color: var(--color-border-accent);
}
/* Cards with JS tilt: skip the CSS hover transform to avoid conflict */
.card--interactive.card--glass:hover {
  transform: none;
}

.card--accent-glow:hover {
  box-shadow: var(--shadow-card-hover);
}


/* === INPUTS === */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.input-label {
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.input {
  height: 44px;
  padding: 0 var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  background: var(--lg-bg-1);
  backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border);
  border-radius: var(--radius-md);
  box-shadow: var(--lg-inset-highlight);
  transition: var(--transition-colors);
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle), 0 0 20px rgba(255, 59, 48, 0.08);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.input::placeholder {
  color: var(--color-text-tertiary);
}

/* Floating label variant */
.input-group--float {
  position: relative;
}
.input-group--float .input-label {
  position: absolute;
  top: 50%;
  left: var(--space-sm);
  transform: translateY(-50%);
  pointer-events: none;
  transition: transform var(--duration-fast) var(--ease-default),
              font-size var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
  background: transparent;
  padding: 0 var(--space-4xs);
  z-index: 1;
  color: var(--color-text-tertiary);
}
.input-group--float .input:focus ~ .input-label,
.input-group--float .input:not(:placeholder-shown) ~ .input-label {
  transform: translateY(-160%);
  font-size: var(--text-caption);
  color: var(--color-accent);
}
.input-group--float textarea.input ~ .input-label {
  top: var(--space-sm);
  transform: translateY(0);
}
.input-group--float textarea.input:focus ~ .input-label,
.input-group--float textarea.input:not(:placeholder-shown) ~ .input-label {
  transform: translateY(-130%);
  font-size: var(--text-caption);
  color: var(--color-accent);
}

.input-helper {
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
}

.input-error {
  font-size: var(--text-caption);
  color: var(--color-error);
  display: none;
}

.input-group.has-error .input-error {
  display: block;
}

.input-group.has-error .input {
  border-color: var(--color-error);
}

textarea.input {
  height: auto;
  min-height: 100px;
  padding: var(--space-xs) var(--space-sm);
  resize: vertical;
}


/* === SELECT === */
.select {
  appearance: none;
  height: 44px;
  padding: 0 var(--space-xl) 0 var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  background: var(--lg-bg-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%239898A8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border);
  border-radius: var(--radius-md);
  box-shadow: var(--lg-inset-highlight);
  cursor: pointer;
  width: 100%;
  transition: var(--transition-colors);
}
.select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}


/* === TOGGLE / SWITCH === */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  border: none;
  padding: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--color-bg);
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle[aria-checked="true"],
.toggle.active {
  background: var(--color-accent);
}
.toggle[aria-checked="true"]::after,
.toggle.active::after {
  transform: translateX(20px);
}


/* === CHIP / TAG === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  height: 32px;
  padding: 0 var(--space-xs);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  background: var(--lg-bg-1);
  backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  color: var(--color-text-secondary);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-inset-highlight);
  cursor: default;
  transition: var(--transition-colors);
}

.chip--selectable {
  cursor: pointer;
}
.chip--selectable:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.chip--selectable.active,
.chip--selectable[aria-selected="true"] {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  border-color: var(--color-accent);
}
.chip--selectable.disabled,
.chip--selectable:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
}


/* === TABS === */
.tabs {
  display: flex;
  gap: var(--space-3xs);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.tab {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-colors);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.tab:hover { color: var(--color-text-primary); }
.tab.active, .tab[aria-selected="true"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Pill tabs */
.tabs--pill {
  border-bottom: none;
  background: var(--lg-bg-1);
  backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-inset-highlight);
  border-radius: var(--radius-lg);
  padding: var(--space-3xs);
  gap: 0;
}
.tabs--pill .tab {
  border-bottom: none;
  border-radius: var(--radius-md);
  padding: var(--space-2xs) var(--space-sm);
}
.tabs--pill .tab.active {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}


/* === ACCORDION (FAQ) === */
.accordion {
  background: var(--lg-bg-2);
  backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  border-radius: var(--radius-lg);
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--lg-border);
}
.accordion-item:last-child { border-bottom: none; }

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-colors);
}
.accordion-trigger:hover { color: var(--color-accent); }

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-base) var(--ease-default);
  flex-shrink: 0;
  color: var(--color-text-tertiary);
}
.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-default);
}
.accordion-item.open .accordion-content {
  max-height: 2000px;
}

.accordion-body {
  padding: 0 var(--space-md) var(--space-md);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}


/* === BADGE / STATUS === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: var(--space-3xs) var(--space-2xs);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  line-height: 1;
}
.badge--active  { background: var(--color-success-subtle); color: var(--color-success); }
.badge--error   { background: var(--color-error-subtle);   color: var(--color-error);   }
.badge--warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.badge--info    { background: var(--color-info-subtle);    color: var(--color-info);    }
.badge--neutral { background: var(--color-surface-3);      color: var(--color-text-secondary); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}


/* === TOOLTIP === */
.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: var(--space-3xs) var(--space-2xs);
  font-size: var(--text-caption);
  color: var(--color-text-primary);
  background: var(--lg-bg-1);
  backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  border-radius: var(--radius-sm);
  box-shadow: var(--lg-inset-highlight);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default);
  z-index: var(--z-tooltip);
}
.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}


/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-heavy);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-default);
  padding: var(--space-sm);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--lg-bg-3);
  backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: min(520px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow), var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--duration-base) var(--ease-spring);
  position: relative;
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.modal-body { padding: var(--space-md); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
}


/* === STEPPER === */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: var(--space-xl);
  padding: 0 var(--space-xs);
}
.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.stepper-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  color: var(--color-text-tertiary);
  transition: background var(--duration-base) var(--ease-default),
              border-color var(--duration-base) var(--ease-default),
              color var(--duration-base) var(--ease-default),
              box-shadow var(--duration-base) var(--ease-default);
}
.stepper-circle .stepper-check {
  display: none;
}
.stepper-label {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--color-text-tertiary);
  transition: color var(--duration-base) var(--ease-default);
  white-space: nowrap;
}
.stepper-step.active .stepper-circle {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-on-accent);
  box-shadow: 0 0 0 4px rgba(var(--color-accent-rgb), 0.15);
}
.stepper-step.active .stepper-label {
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
}
.stepper-step.completed .stepper-circle {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}
.stepper-step.completed .stepper-circle .stepper-icon {
  display: none;
}
.stepper-step.completed .stepper-circle .stepper-check {
  display: block;
}
.stepper-step.completed .stepper-label {
  color: var(--color-success);
}
.stepper-line {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  min-width: 20px;
  margin-top: 19px; /* center with 40px circle */
  position: relative;
  overflow: hidden;
}
.stepper-line-fill {
  position: absolute;
  inset: 0;
  background: var(--color-success);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-default);
}
.stepper-step.completed + .stepper-line .stepper-line-fill {
  transform: scaleX(1);
}


/* === PROGRESS BAR === */
.progress {
  height: 6px;
  background: var(--lg-bg-1);
  backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-1)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}


/* === SKELETON === */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-2) 25%,
    var(--color-surface-3) 50%,
    var(--color-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 16px; width: 80%; }
.skeleton-title { height: 24px; width: 60%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 200px; border-radius: var(--radius-lg); }


/* === TOAST === */
.toast-container {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--lg-bg-3);
  backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  border-radius: var(--radius-lg);
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow), var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  animation: toast-in var(--duration-base) var(--ease-spring);
}
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-error); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info    { border-left: 3px solid var(--color-info); }


/* === COOKIE CONSENT === */
.cookie-banner {
  position: fixed;
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  left: var(--space-md);
  right: var(--space-md);
  max-width: 480px;
  background: var(--lg-bg-3);
  backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  z-index: var(--z-modal);
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow), var(--shadow-xl);
  transform: translateY(120%);
  pointer-events: none;
  transition: transform var(--duration-slow) var(--ease-spring);
}
.cookie-banner.visible {
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 767px) {
  .cookie-banner {
    left: var(--space-xs);
    right: var(--space-xs);
    bottom: var(--space-xs);
    max-width: 100%;
  }
}

/* === COOKIE SETTINGS MODAL === */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 1);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-default);
}
.cookie-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.cookie-modal {
  background: var(--lg-bg-3);
  backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-3)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow), var(--shadow-xl);
  transform: translateY(16px);
  transition: transform var(--duration-base) var(--ease-spring);
}
.cookie-modal-overlay.visible .cookie-modal {
  transform: translateY(0);
}
.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-md) var(--space-sm);
}
.cookie-modal-header h3 {
  font-size: var(--text-h4);
  font-weight: 600;
}
.cookie-modal-body {
  padding: 0 var(--space-md);
}
.cookie-modal-footer {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  display: flex;
  justify-content: flex-end;
}
.cookie-category {
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-border-subtle);
}
.cookie-category:first-child {
  border-top: none;
}
.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3xs);
}
.cookie-badge {
  display: inline-block;
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
  background: var(--color-surface-2);
  padding: var(--space-4xs) var(--space-2xs);
  border-radius: var(--radius-full);
  margin-left: var(--space-2xs);
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cookie-toggle-track {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  transition: background var(--duration-fast) var(--ease-default);
}
.cookie-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--color-bg);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.cookie-toggle input:checked + .cookie-toggle-track {
  background: var(--color-accent);
}
.cookie-toggle input:checked + .cookie-toggle-track::after {
  transform: translateX(20px);
}
.cookie-toggle input:disabled + .cookie-toggle-track {
  opacity: 0.6;
  cursor: not-allowed;
}


/* === COUNTER / METRIC === */
.metric {
  text-align: left;
  border-left: 2px solid var(--color-accent);
  padding-left: var(--space-sm);
}
.metric-value {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-3xs);
}


/* === SLIDER / RANGE === */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  outline: none;
  transition: background var(--duration-base) ease;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent), var(--shadow-glow);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent);
}


/* === SCROLL REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* Reduced motion: skip all reveal animations */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .text-gradient-animate { animation: none; }
  .overline-shimmer::after { animation: none; }
  .card--gradient-border::before { animation: none; }
}


/* === DIVIDER === */
.divider {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-xl) 0;
}


/* === AVATAR === */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-sm);
  flex-shrink: 0;
}
.avatar--sm { width: 32px; height: 32px; font-size: var(--text-caption); }
.avatar--lg { width: 56px; height: 56px; font-size: var(--text-h4); }


/* ============================================================
   PREMIUM VISUAL LAYER
   Custom cursor, 3D tilt, gradient borders, text gradients,
   noise overlay, scroll progress, section indicator, pricing.
   ============================================================ */

/* === CUSTOM CURSOR === */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1001;
  will-change: transform;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.4);
  transition: width 0.2s var(--ease-spring),
              height 0.2s var(--ease-spring),
              background 0.2s,
              box-shadow 0.2s;
}
.custom-cursor-dot.hovering {
  width: 5px;
  height: 5px;
  background: var(--color-accent);
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.5);
}
.custom-cursor-dot.clicking {
  width: 4px;
  height: 4px;
  background: var(--color-text-primary);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.35;
  will-change: transform;
  transition: width 0.3s var(--ease-spring),
              height 0.3s var(--ease-spring),
              border-color 0.3s,
              opacity 0.3s,
              background 0.3s;
}
.custom-cursor-ring.hovering {
  width: 50px;
  height: 50px;
  border-color: var(--color-accent);
  background: rgba(255, 59, 48, 0.05);
  opacity: 0.6;
}
.custom-cursor-ring.input-hover {
  width: 4px;
  height: 32px;
  border-radius: 2px;
  border-color: var(--color-accent);
  opacity: 0.5;
}
.custom-cursor-ring.clicking {
  opacity: 0.2;
}

@media (hover: hover) and (pointer: fine) {
  .custom-cursor-active,
  .custom-cursor-active * {
    cursor: none !important;
  }
}


/* === 3D TILT + GLARE === */
@media (hover: hover) and (pointer: fine) {
  .card--glass {
    transform-style: preserve-3d;
    perspective: 1000px;
  }
  .card--glass .card-glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background:
      radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255,255,255,0.10),
        transparent 50%
      ),
      radial-gradient(
        ellipse 120% 80% at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255,255,255,0.04),
        transparent 70%
      );
    transition: opacity 0.3s;
    z-index: 2;
  }
  .card--glass:hover .card-glare {
    opacity: 1;
  }
  .card--glass:hover {
    box-shadow:
      var(--shadow-md),
      0 0 30px rgba(255, 255, 255, 0.03);
  }
}


/* === ANIMATED GRADIENT BORDERS === */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.card--gradient-border {
  position: relative;
  background-clip: padding-box;
}
.card--gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--border-angle),
    var(--color-accent) 0%,
    transparent 25%,
    transparent 75%,
    var(--color-accent) 100%
  );
  -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;
  opacity: 0.3;
  transition: opacity 0.4s;
  animation: rotate-border 4s linear infinite;
  pointer-events: none;
}
.card--gradient-border:hover::before {
  opacity: 0.8;
}
@keyframes rotate-border {
  to { --border-angle: 360deg; }
}
/* Fallback for browsers without @property support (Safari < 16.4) */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .card--gradient-border::before {
    background: var(--color-accent);
    opacity: 0.12;
    animation: none;
  }
  .card--gradient-border:hover::before {
    opacity: 0.25;
  }
}


/* === TEXT GRADIENT ANIMATION === */
.text-gradient-animate {
  color: var(--color-accent); /* fallback for browsers without background-clip */
  background: linear-gradient(90deg, var(--color-accent), var(--color-warning), var(--color-accent));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 3s ease infinite;
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.overline-shimmer {
  position: relative;
  overflow: hidden;
  display: inline-block;
}
.overline-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 20%,
    rgba(255, 59, 48, 0.12) 35%,
    rgba(255, 59, 48, 0.18) 50%,
    rgba(255, 59, 48, 0.12) 65%,
    transparent 80%,
    transparent 100%
  );
  transform: translateX(-120%);
  animation: shimmer 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0%    { transform: translateX(-120%); opacity: 0; }
  5%    { opacity: 1; }
  45%   { transform: translateX(320%); opacity: 1; }
  50%   { transform: translateX(320%); opacity: 0; }
  100%  { transform: translateX(-120%); opacity: 0; }
}


/* === NOISE / GRAIN OVERLAY === */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: overlay;
}
[data-theme="light"] body::after {
  opacity: 0.02;
}
/* Disable noise overlay on mobile/tablet for performance */
@media (max-width: 1023px) {
  body::after { display: none; }
}


/* === SCROLL PROGRESS BAR === */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 202;
  opacity: 0;
  transition: opacity 0.4s;
}
.scroll-progress-container.visible {
  opacity: 1;
}
#scroll-progress {
  height: 100%;
  background: var(--color-accent);
  transform-origin: left;
  transform: scaleX(0);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.4);
}


/* === SECTION INDICATOR === */
.section-indicator {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  z-index: 201;
  opacity: 0;
  transition: opacity 0.4s;
}
.section-indicator.visible {
  opacity: 1;
}
.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--color-text-tertiary);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s var(--ease-spring),
              border-color 0.3s var(--ease-spring),
              transform 0.3s var(--ease-spring);
  position: relative;
  padding: 0;
}
/* 44px touch target without changing visual size */
.section-dot::after {
  content: '';
  position: absolute;
  inset: -17px;
}
.section-dot.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.4);
}
.section-dot::before {
  content: attr(data-label);
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: var(--space-xs);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.section-dot:hover::before {
  opacity: 1;
}

@media (max-width: 1023px) {
  .section-indicator { display: none; }
}


/* Hero layout (desktop) */
@media (min-width: 1024px) {
  .hero-content {
    position: relative;
  }
}


/* === PRICING SECTION === */
.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-3xs) var(--space-xs);
  margin-bottom: var(--space-xl);
}
.pricing-toggle-label {
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-colors);
}
.pricing-toggle-label.active {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}
.pricing-discount {
  font-size: var(--text-caption);
  color: var(--color-success);
  font-weight: var(--weight-semibold);
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  align-items: start;
}
@media (max-width: 767px) {
  .pricing-cards { grid-template-columns: 1fr; }
  .pricing-card--popular {
    transform: none;
  }
  .pricing-card--popular:hover {
    transform: translateY(-2px);
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .pricing-cards { grid-template-columns: 1fr 1fr; }
}

.pricing-card {
  background: var(--lg-bg-2);
  backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lg-blur-2)) saturate(var(--lg-saturate)) brightness(var(--lg-brightness));
  border: 1px solid var(--lg-border-luminous);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  text-align: center;
  position: relative;
  box-shadow: var(--lg-inset-highlight), var(--lg-edge-glow);
  transition: transform var(--duration-base) var(--ease-default),
              box-shadow var(--duration-base) var(--ease-default),
              border-color var(--duration-base) var(--ease-default);
}
.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.pricing-card--popular {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
  transform: scale(1.05);
  z-index: 2;
}
.pricing-card--popular:hover {
  transform: scale(1.05) translateY(-2px);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  padding: var(--space-3xs) var(--space-sm);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.pricing-plan-name {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-xs);
}
.pricing-price {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pricing-period {
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-3xs);
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0;
  text-align: left;
}
.pricing-features li {
  padding: var(--space-2xs) 0;
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  border-bottom: 1px solid var(--color-border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features .check {
  color: var(--color-success);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.pricing-features .dash {
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.pricing-card .btn {
  width: 100%;
  margin-top: var(--space-sm);
}


/* === LIQUID GLASS — GRADIENT BORDER PRESERVE === */
/* Cards with gradient-border keep their animated border ::before */
.card--gradient-border::before {
  background: conic-gradient(
    from var(--border-angle),
    var(--color-accent) 0%,
    transparent 25%,
    transparent 75%,
    var(--color-accent) 100%
  );
}

/* === LIQUID GLASS — FALLBACK (no backdrop-filter) === */
@supports not (backdrop-filter: blur(1px)) {
  .card--glass,
  .card--elevated,
  .accordion,
  .modal,
  .toast,
  .cookie-banner,
  .cookie-modal,
  .pricing-card {
    background: var(--color-surface-1);
    box-shadow: var(--shadow-card);
  }
  .chip,
  .tabs--pill,
  .input,
  .select,
  .tooltip::after,
  .stepper-circle,
  .progress {
    background: var(--color-surface-1);
  }
}

/* === BUTTON RIPPLE === */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: btn-ripple-anim 0.6s ease-out forwards;
  pointer-events: none;
  z-index: -1;
}

@keyframes btn-ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}


/* === EXIT INTENT MODAL === */
.exit-intent-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.exit-intent-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.exit-intent-overlay.visible,
.exit-intent-overlay.visible * {
  cursor: auto !important;
}

.exit-intent-modal {
  position: relative;
  max-width: min(440px, calc(100vw - 32px));
  width: 90%;
  padding: clamp(var(--space-md), 5vw, var(--space-xl));
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid var(--glass-border);
  text-align: center;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.exit-intent-overlay.visible .exit-intent-modal {
  transform: translateY(0) scale(1);
}

.exit-intent-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2xs);
  line-height: 1;
}

.exit-intent-title {
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-sm);
}

.exit-intent-text {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}




/* === SUCCESS CELEBRATION — SVG checkmark draw === */
.success-check-svg {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-md);
}

.success-check-svg .check-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke: var(--color-success);
  fill: none;
  animation: check-circle-draw 0.6s ease forwards;
}

.success-check-svg .check-mark {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: var(--color-success);
  fill: none;
  animation: check-mark-draw 0.3s 0.4s ease forwards;
}

@keyframes check-circle-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes check-mark-draw {
  to { stroke-dashoffset: 0; }
}

.confetti-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
}


/* === LIQUID GLASS — MOBILE: reduce blur for performance === */
@media (max-width: 1023px) {
  .card--glass,
  .card--elevated,
  .accordion,
  .pricing-card {
    backdrop-filter: blur(6px) saturate(1.2) brightness(1.08);
    -webkit-backdrop-filter: blur(6px) saturate(1.2) brightness(1.08);
  }
  .modal,
  .toast,
  .cookie-banner,
  .cookie-modal {
    backdrop-filter: blur(8px) saturate(1.3) brightness(1.08);
    -webkit-backdrop-filter: blur(8px) saturate(1.3) brightness(1.08);
  }
}

/* === LOTTIE CONTAINERS === */
.timeline-lottie {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-xs);
}
.lottie-accent {
  width: 48px;
  height: 48px;
  display: inline-block;
  vertical-align: middle;
}


/* ============================================================
   RESPONSIVE COMPONENT FIXES — All Device Sizes
   ============================================================ */

/* Text overflow protection on constrained labels */
.nav-link,
.wf-node-label,
.chip,
.stepper-label,
.marquee-badge {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Small phones: chip and button sizing */
@media (max-width: 389px) {
  .chip {
    padding: var(--space-3xs) var(--space-xs);
    font-size: var(--text-caption);
  }
  .btn--md {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-body-sm);
  }
  .btn--lg {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-body);
  }
  /* Exit intent modal tighter on tiny screens */
  .exit-intent-modal {
    width: 95%;
  }
  .exit-intent-modal h3 {
    font-size: var(--text-h4);
  }
  /* Pricing card details */
  .pricing-card .feature-list li {
    font-size: var(--text-body-sm);
  }
}

/* Chat panel: ensure it doesn't overflow on any screen */
@media (max-width: 389px) {
  .chat-panel {
    width: calc(100vw - 16px);
    max-height: 65vh;
    right: 8px;
  }
}
