/* Custom CSS System for QrGeni */

/* 1. Base Variables & Theme (Light/Dark) */
:root {
  --primary: #3D95D9;
  --primary-hover: #4ca3e6;
  --primary-light: #72b6e6;

  --bg-body: #f8fafc;
  --bg-grid: rgba(148, 163, 184, 0.2);
  --bg-nav: rgba(255, 255, 255, 0.8);
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-input: rgba(241, 245, 249, 0.5);
  --bg-input-focus: rgba(241, 245, 249, 0.8);
  --bg-hover: rgba(241, 245, 249, 0.8);

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-main: rgba(0, 0, 0, 0.1);
  --border-input: rgba(0, 0, 0, 0.15);
  --focus-ring: 0 0 0 3px rgba(61, 149, 217, 0.4);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.02);

  --error-bg: #fef2f2;
  --error-text: #e11d48;
  --error-border: #fecdd3;
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --success-border: #a7f3d0;
}

html.dark {
  --bg-body: #3a3c3f;
  --bg-grid: rgba(255, 255, 255, 0.08);
  --bg-nav: rgba(64, 65, 68, 0.8);
  --bg-sidebar: #2b2c2e;
  --bg-card: rgba(59, 60, 62, 0.6);
  --bg-input: rgba(65, 67, 71, 0.5);
  --bg-input-focus: rgb(122, 128, 133);
  --bg-hover: rgba(255, 255, 255, 0.05);

  --text-main: #f8fafc;
  --text-muted: #a5afbd;

  --border-main: rgba(255, 255, 255, 0.08);
  --border-input: rgba(255, 255, 255, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-inset: inset 0 2px 8px rgba(0, 0, 0, 0.2);

  --error-bg: rgba(225, 29, 72, 0.1);
  --error-text: #fda4af;
  --error-border: rgba(225, 29, 72, 0.3);
  --success-bg: rgba(6, 95, 70, 0.2);
  --success-text: #6ee7b7;
  --success-border: rgba(6, 95, 70, 0.4);
}

/* 2. Resets & Typography */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  background-image: radial-gradient(var(--bg-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* 3. Layout Utilities */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-1 {
  flex: 1;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.w-full {
  width: 100%;
}

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

/* 4. Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  transition: background 0.3s, border-color 0.3s;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  position: relative;
  height: 100%;
}

.nav-logo-icon {
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  z-index: 10;
  transition: transform 0.3s;
}

.nav-logo-link:hover .nav-logo-icon {
  transform: translateY(-50%) scale(1.1);
}

.nav-logo-text {
  margin-left: 48px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  transition: color 0.2s;
}

.nav-logo-link:hover .nav-logo-text {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: none;
  gap: 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-left: 1px solid var(--border-main);
  padding-left: 1.25rem;
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-links a.active {
  color: var(--primary);
}

.mobile-menu-btn {
  display: flex;
  padding: 0.5rem;
  color: var(--text-muted);
  border-radius: 6px;
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.mobile-menu-wrapper {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-main);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.mobile-menu-link {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  color: var(--text-muted);
}

.mobile-menu-link:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.mobile-menu-link.active {
  background: rgba(61, 149, 217, 0.1);
  color: var(--primary);
}

/* Theme Toggles */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.theme-switch {
  position: relative;
  width: 32px;
  height: 16px;
  background: var(--border-input);
  border-radius: 16px;
  transition: 0.3s;
}

.theme-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: var(--shadow-sm);
}

input:checked+.theme-switch {
  background: var(--primary);
}

input:checked+.theme-switch::after {
  transform: translateX(16px);
}

/* 5. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.3s;
}

.btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.btn-primary {
  background: linear-gradient(90deg,
      var(--primary-hover) 0%,
      var(--primary) 45%,
      color-mix(in srgb, var(--primary) 30%, transparent) 80%,
      transparent 100%);
  color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.dark .btn-primary {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(61, 149, 217, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  border: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-icon {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* 6. Forms & Inputs */
.ui-input {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.75rem;
  width: 100%;
}

.ui-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  background: var(--bg-input-focus);
}

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

.segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-main);
  padding: 2px;
  border-radius: 6px;
}

.segmented-control input {
  display: none;
}

.segmented-control label {
  flex: 1;
  text-align: center;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-muted);
  transition: 0.2s;
}

.segmented-control input:checked+label {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.toggle-switch-ui {
  appearance: none;
  width: 34px;
  height: 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: 0.2s;
}

.toggle-switch-ui::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch-ui:checked {
  background: rgba(61, 149, 217, 0.2);
  border-color: var(--primary);
}

.toggle-switch-ui:checked::after {
  transform: translateX(16px);
  background: var(--primary);
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--border-main);
  border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  margin-top: -5px;
  transition: 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type=color] {
  padding: 0;
  cursor: pointer;
  height: 32px;
  width: 32px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--border-main);
}

input[type=color]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

input[type=color]::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

/* 7. Components & Animations */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-main);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.anim-floaty {
  animation: floaty 4s ease-in-out infinite;
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

/* Accordion */
details>summary {
  list-style: none;
  outline: none;
}

details>summary::-webkit-details-marker {
  display: none;
}

.config-dropdown summary {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: 0.3s;
}

.config-dropdown summary:hover {
  background: var(--bg-hover);
}

.config-dropdown[open] summary {
  background: var(--bg-hover);
  color: var(--primary);
}

.config-dropdown[open] summary svg {
  transform: rotate(180deg);
}

.config-dropdown-content {
  padding: 1rem;
  background: var(--bg-input);
  box-shadow: var(--shadow-inset);
  border-top: 1px solid var(--border-main);
}

/* Horizontal Slider Utilities */
.app-swipe-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  gap: 1.5rem;
}

.app-swipe-container::-webkit-scrollbar {
  display: none;
}

.app-swipe-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.app-card-pane {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.slider-card-wrapper {
  flex: 1;
  max-width: 650px;
  width: 100%;
  min-width: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-main);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.slider-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-main);
}

.dots-container {
  display: flex;
  gap: 6px;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 4px;
  background: var(--border-input);
  transition: all 0.3s ease;
  padding: 0;
  cursor: pointer;
}

.slider-dot:hover {
  background: var(--text-muted);
}

.slider-dot.active {
  width: 20px;
  background: var(--primary);
}

/* Media Queries */
.desktop-only {
  display: none !important;
}

.mobile-only {
  display: flex !important;
}

@media (min-width: 768px) {
  .desktop-only {
    display: flex !important;
  }

  .mobile-only {
    display: none !important;
  }

  .nav-links {
    display: flex;
  }
}

/* 8. Accessibility, states & missing utilities */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 300;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

a:focus-visible,
.mobile-menu-link:focus-visible,
.slider-dot:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn-secondary:disabled {
  color: var(--text-muted);
  border-color: var(--border-main);
}

.segmented-control input:focus-visible+label {
  box-shadow: var(--focus-ring);
}

::selection {
  background: rgba(61, 149, 217, 0.25);
  color: var(--text-main);
}

html {
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .anim-floaty {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.app-swipe-container {
  align-items: stretch;
}

.app-card-pane {
  display: flex;
  flex-direction: column;
}

.app-card-pane .slide-box {
  margin-top: auto;
}

.slider-card-wrapper {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.slider-card-wrapper>.app-swipe-container {
  flex: 1;
}

@media (max-width: 480px) {
  .slider-card-wrapper {
    padding: 1.5rem 1.25rem;
    min-height: 460px;
  }
}

.hero-title {
  font-size: clamp(1.875rem, 7vw, 2.5rem) !important;
  line-height: 1.15;
  color: var(--text-main);
}

.site-footer {
  border-top: 1px solid var(--border-main);
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  padding: 2.5rem 1.5rem 1.5rem;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .site-footer-inner {
    flex-direction: row;
    align-items: center;
  }
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 420px;
}

.site-footer-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}

.site-footer-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.5;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.site-footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.site-footer-links a:hover {
  color: var(--primary);
}

.site-footer-legal {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-main);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.form-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.form-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.form-alert p {
  font-size: 14px;
  font-weight: 500;
}

.field-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media print {

  .navbar,
  .mobile-menu-wrapper,
  .site-footer,
  .skip-link,
  .slider-controls {
    display: none !important;
  }

  body {
    background: #fff !important;
  }
}

/* 9. Motion system & design tokens */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-swift: cubic-bezier(0.4, 0, 0.2, 1);

  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-medium: 400ms;
  --dur-slow: 600ms;

  --shadow-lift: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 4px 12px rgba(15, 23, 42, 0.08), 0 12px 32px rgba(15, 23, 42, 0.10);
  --shadow-glow: 0 0 0 1px rgba(61, 149, 217, 0.15), 0 8px 32px rgba(61, 149, 217, 0.20);
}

html.dark {
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.40);
  --shadow-glow: 0 0 0 1px rgba(61, 149, 217, 0.25), 0 8px 32px rgba(61, 149, 217, 0.30);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 {
  transition-delay: 60ms;
}

.stagger-2 {
  transition-delay: 120ms;
}

.stagger-3 {
  transition-delay: 180ms;
}

.stagger-4 {
  transition-delay: 240ms;
}

.stagger-5 {
  transition-delay: 300ms;
}

.stagger-6 {
  transition-delay: 360ms;
}

.anim-fade-up {
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}

.anim-fade-in {
  animation: fadeIn var(--dur-medium) var(--ease-out) both;
}

.anim-scale-in {
  animation: scaleIn var(--dur-medium) var(--ease-out-back) both;
}

.anim-slide-r {
  animation: slideRight var(--dur-medium) var(--ease-out) both;
}

.anim-pop {
  animation: popIn var(--dur-medium) var(--ease-out-back) both;
}

.anim-pulse-ring {
  animation: pulseRing 2.4s var(--ease-out) infinite;
}

.anim-shimmer {
  position: relative;
  overflow: hidden;
}

.anim-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  animation: shimmer 1.8s linear infinite;
}

.dark .anim-shimmer::after {
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(8px);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 149, 217, 0.45);
  }

  80%,
  100% {
    box-shadow: 0 0 0 22px rgba(61, 149, 217, 0);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes spinSlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounceSoft {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-14px) rotate(1deg);
  }
}

/* 10. Button polish */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.35) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--dur-fast) linear;
  pointer-events: none;
}

.btn:hover::after {
  opacity: 0.6;
}

.dark .btn::after {
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.15) 0%, transparent 55%);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  transition-duration: 80ms;
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  pointer-events: none;
  background: rgba(255, 255, 255, 0.45);
  animation: rippleGrow 600ms var(--ease-out) forwards;
}

.dark .btn .ripple {
  background: rgba(255, 255, 255, 0.2);
}

.btn-secondary .ripple {
  background: rgba(61, 149, 217, 0.28);
}

@keyframes rippleGrow {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 11. Input, toggle & control refinements */
.ui-input {
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.ui-input:hover:not(:focus) {
  border-color: var(--text-muted);
}

.ui-input:focus {
  transform: none;
}

.toggle-switch-ui,
.toggle-switch-ui::after {
  transition: all var(--dur-base) var(--ease-out-back);
}

.toggle-switch-ui:hover {
  border-color: var(--primary);
}

.segmented-control label {
  transition: all var(--dur-base) var(--ease-out);
}

.segmented-control label:hover {
  color: var(--text-main);
}

.segmented-control input:checked+label {
  transform: none;
}

input[type=range]::-webkit-slider-thumb {
  box-shadow: 0 0 0 0 rgba(61, 149, 217, 0.4);
  transition: transform var(--dur-fast) var(--ease-out-back), box-shadow var(--dur-base);
}

input[type=range]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(61, 149, 217, 0.18);
}

input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.3);
}

input[type=color] {
  transition: transform var(--dur-fast) var(--ease-out);
}

input[type=color]:hover {
  transform: scale(1.08);
}

/* 12. Card hover polish */
.qr-card {
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
  will-change: transform;
}

.qr-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.qr-card img {
  transition: transform var(--dur-medium) var(--ease-out);
}

.qr-card:hover img {
  transform: scale(1.02);
}

.glass-card {
  transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.dev-qr-box {
  transition: transform var(--dur-base) var(--ease-out-back), box-shadow var(--dur-base) var(--ease-out);
}

.dev-qr-box:hover {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: var(--shadow-glow);
}

.nav-logo-icon {
  transition: transform var(--dur-base) var(--ease-out-back);
}

.nav-logo-link:hover .nav-logo-icon {
  transform: translateY(-50%) scale(1.12) rotate(-4deg);
}

.nav-links a {
  position: relative;
  padding: 4px 2px;
}

.nav-links a::before {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: right var(--dur-base) var(--ease-out);
}

.nav-links a:hover::before,
.nav-links a.active::before {
  right: 0;
}

.nav-links a.active {
  color: var(--primary);
}

/* 13. Loading screen — QR-cell build animation */
.qr-loader {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  width: 76px;
  height: 76px;
  padding: 8px;
  background: var(--bg-sidebar);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border-main);
}

.qr-loader span {
  background: var(--primary);
  border-radius: 2px;
  opacity: 0;
  animation: qrCellFlicker 1.8s var(--ease-in-out) infinite;
}

.qr-loader span:nth-child(1) {
  animation-delay: 0.00s;
}

.qr-loader span:nth-child(2) {
  animation-delay: 0.55s;
}

.qr-loader span:nth-child(3) {
  animation-delay: 0.15s;
}

.qr-loader span:nth-child(4) {
  animation-delay: 0.85s;
}

.qr-loader span:nth-child(5) {
  animation-delay: 0.30s;
}

.qr-loader span:nth-child(6) {
  animation-delay: 0.90s;
}

.qr-loader span:nth-child(7) {
  animation-delay: 0.10s;
}

.qr-loader span:nth-child(8) {
  animation-delay: 0.65s;
}

.qr-loader span:nth-child(9) {
  animation-delay: 0.25s;
}

.qr-loader span:nth-child(10) {
  animation-delay: 0.75s;
}

.qr-loader span:nth-child(11) {
  animation-delay: 0.40s;
}

.qr-loader span:nth-child(12) {
  animation-delay: 0.20s;
}

.qr-loader span:nth-child(13) {
  animation-delay: 1.05s;
}

.qr-loader span:nth-child(14) {
  animation-delay: 0.50s;
}

.qr-loader span:nth-child(15) {
  animation-delay: 0.95s;
}

.qr-loader span:nth-child(16) {
  animation-delay: 0.35s;
}

.qr-loader span:nth-child(17) {
  animation-delay: 0.80s;
}

.qr-loader span:nth-child(18) {
  animation-delay: 0.05s;
}

.qr-loader span:nth-child(19) {
  animation-delay: 0.70s;
}

.qr-loader span:nth-child(20) {
  animation-delay: 0.45s;
}

.qr-loader span:nth-child(21) {
  animation-delay: 1.10s;
}

.qr-loader span:nth-child(22) {
  animation-delay: 0.60s;
}

.qr-loader span:nth-child(23) {
  animation-delay: 0.15s;
}

.qr-loader span:nth-child(24) {
  animation-delay: 1.00s;
}

.qr-loader span:nth-child(25) {
  animation-delay: 0.35s;
}

@keyframes qrCellFlicker {

  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.loader-caption {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 1.5rem;
  animation: loaderDots 1.6s var(--ease-in-out) infinite;
}

@keyframes loaderDots {

  0%,
  100% {
    opacity: 0.55;
    letter-spacing: 2px;
  }

  50% {
    opacity: 1;
    letter-spacing: 4px;
  }
}

#init-screen {
  transition: opacity var(--dur-slow) var(--ease-out), visibility var(--dur-slow) var(--ease-out);
}

#init-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 14. Progress bar */
#progress-fill {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  transition: width var(--dur-fast) var(--ease-out);
}

#progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.4s linear infinite;
}

#preview-var-text.pulse-once {
  animation: badgePulse 500ms var(--ease-out-back);
}

@keyframes badgePulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
    background: rgba(61, 149, 217, 0.25);
  }

  100% {
    transform: scale(1);
  }
}

#preview-var-text {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--dur-base);
}

#item-count {
  transition: all var(--dur-base) var(--ease-out);
}

#item-count.pulse {
  animation: itemCountPulse 400ms var(--ease-out-back);
}

@keyframes itemCountPulse {
  50% {
    transform: scale(1.05);
  }
}

/* 15. Slider polish */
.app-swipe-container {
  scroll-snap-type: x mandatory;
  scroll-padding: 1rem;
}

.app-card-pane {
  transition: opacity var(--dur-base) var(--ease-out);
}

.app-card-pane .slide-icon {
  transition: transform var(--dur-base) var(--ease-out-back);
}

.slider-card-wrapper:hover .app-card-pane .slide-icon {
  transform: rotate(-8deg) scale(1.05);
}

.slider-dot {
  transition: all var(--dur-base) var(--ease-out-back);
}

.slider-dot:hover {
  transform: scale(1.4);
}

.slider-controls button svg {
  transition: transform var(--dur-fast) var(--ease-out);
}

.slider-controls button:hover:not(:disabled) svg {
  transform: translateX(2px);
}

.slider-controls button:first-of-type:hover:not(:disabled) svg {
  transform: translateX(-2px);
}

.dots-container {
  position: relative;
  padding: 4px 0;
}

/* 16. Toast notifications (JS-driven) */
#toast-container {
  position: fixed;
  top: 72px;
  right: 1rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
}

@media (max-width: 640px) {
  #toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem 0.75rem 0.875rem;
  border-radius: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-hover);
  font-size: 0.8125rem;
  color: var(--text-main);
  min-width: 260px;
  max-width: 380px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform var(--dur-medium) var(--ease-out-back), opacity var(--dur-medium) var(--ease-out);
}

.toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
}

.toast-body {
  flex: 1;
  line-height: 1.45;
}

.toast-close {
  flex-shrink: 0;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color var(--dur-fast), background var(--dur-fast);
}

.toast-close:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.toast-success .toast-icon {
  background: var(--success-bg);
  color: var(--success-text);
}

.toast-error .toast-icon {
  background: var(--error-bg);
  color: var(--error-text);
}

.toast-info .toast-icon {
  background: rgba(61, 149, 217, 0.1);
  color: var(--primary);
}

.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--primary);
  border-bottom-left-radius: 10px;
  animation: toastCountdown linear forwards;
}

.toast-success::after {
  background: var(--success-text);
}

.toast-error::after {
  background: var(--error-text);
}

.toast {
  position: relative;
  overflow: hidden;
}

@keyframes toastCountdown {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* 17. Config accordion polish */
.config-dropdown summary svg {
  transition: transform var(--dur-medium) var(--ease-out-back);
}

.config-dropdown[open] summary svg {
  transform: rotate(180deg);
}

.config-dropdown[open]>.config-dropdown-content {
  animation: accordionOpen var(--dur-medium) var(--ease-out) both;
}

@keyframes accordionOpen {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 18. Preview canvas: subtle idle breath */
#preview-canvas-container img {
  animation: previewFade var(--dur-medium) var(--ease-out) both;
}

@keyframes previewFade {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 19. Empty state — floating orbs behind the mascot */
.empty-stage {
  position: relative;
}

.empty-stage::before,
.empty-stage::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  animation: orbDrift 12s var(--ease-in-out) infinite;
}

.empty-stage::before {
  width: 260px;
  height: 260px;
  background: rgba(61, 149, 217, 0.18);
  top: -30px;
  left: 10%;
}

.empty-stage::after {
  width: 200px;
  height: 200px;
  background: rgba(114, 182, 230, 0.14);
  bottom: -20px;
  right: 12%;
  animation-delay: -6s;
}

.empty-stage>* {
  position: relative;
  z-index: 1;
}

@keyframes orbDrift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -20px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 25px) scale(0.95);
  }
}

.dark .empty-stage::before {
  background: rgba(61, 149, 217, 0.14);
}

.dark .empty-stage::after {
  background: rgba(72, 155, 219, 0.10);
}

/* 20. Suggestion form success */
.form-alert.form-alert--success .toast-icon {
  animation: checkPop 500ms var(--ease-out-back);
}

@keyframes checkPop {
  0% {
    transform: scale(0) rotate(-30deg);
  }

  60% {
    transform: scale(1.15) rotate(5deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

#char-count.warn {
  color: var(--error-text);
  font-weight: 700;
}

/* 21. Mobile menu entrance */
.mobile-menu-wrapper:not(.hidden) {
  animation: menuSlideDown var(--dur-medium) var(--ease-out) both;
}

@keyframes menuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-menu-link {
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
}

/* 22. Utility hover helpers */
.hover-lift {
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* 23. Focus ring */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 149, 217, 0.35);
  border-radius: 6px;
  transition: box-shadow var(--dur-fast) var(--ease-out);
}

input:focus-visible.ui-input,
textarea:focus-visible.ui-input {
  box-shadow: 0 0 0 3px rgba(61, 149, 217, 0.35), inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.skip-link {
  transition: top var(--dur-base) var(--ease-out-back), background var(--dur-fast);
}

.skip-link:hover,
.skip-link:focus {
  background: var(--primary-hover);
}

@media (prefers-reduced-motion: reduce) {

  .anim-shimmer::after,
  #progress-fill::after,
  .qr-loader span,
  .empty-stage::before,
  .empty-stage::after,
  .loader-caption {
    animation: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}


  .site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-main);
    margin-top: 4rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
  }

  .site-footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  @media (min-width: 768px) {
    .site-footer-container {
      grid-template-columns: 2fr 1fr 1fr;
      gap: 3rem;
    }
  }

  .footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer-logo-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .footer-logo-row img {
    border-radius: 6px;
  }

  .footer-brand-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
  }

  .footer-brand-desc {
    font-size: 0.775rem;
    line-height: 1.6;
    max-width: 32ch;
    color: var(--text-muted);
  }

  .footer-heading {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-main);
    margin-bottom: 0.875rem;
  }

  .footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-nav-list a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
  }

  .footer-nav-list a:hover {
    color: var(--primary);
    transform: translateX(3px);
  }

  .footer-bottom-bar {
    border-top: 1px solid var(--border-main);
    padding: 1.25rem 1.5rem;
    background: var(--bg-body);
  }

  .footer-bottom-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.75rem;
  }

  @media (min-width: 640px) {
    .footer-bottom-container {
      flex-direction: row;
    }
  }

  .footer-security-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-main);
  }

  .security-dot {
    width: 6px;
    height: 6px;
    background-color: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  }
