/* ═══════════════════════════════════════════════════════════════
   InvoisReady — shared UI polish layer (loaded on every page AFTER
   the base styles). Adds: responsive mobile nav, motion/reveal,
   accessibility focus states, and micro-interaction polish.
   Uses the same design tokens (--accent, --shadow-lg, …) defined by
   the base stylesheets, so it works on both the index and content pages.
   ═══════════════════════════════════════════════════════════════ */

/* Honeypot — visually hidden anti-bot field (must stay empty) */
.hp-field { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ── Global niceties ── */
html { scroll-behavior: smooth; }
::selection { background: var(--accent); color: #fff; }

/* Accessible keyboard focus on all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-visible,
.btn:focus-visible,
.option-item:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Micro-interaction polish ── */
.feature-card,
.source-item { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #bae6fd; }
.source-item .arrow { transition: transform .2s ease; }
.source-item:hover .arrow { transform: translate(3px, -3px); }

.price-card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.price-card:not(.popular):hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #bae6fd; }
.price-card.popular:hover { transform: translateY(-9px); }

.btn { transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.btn:active { transform: translateY(1px); }

/* ── Sticky-nav shadow once scrolled (content pages) ── */
.site-nav { transition: box-shadow .25s ease, background .25s ease; }
.site-nav.scrolled { box-shadow: 0 6px 24px rgba(15,37,68,.28); }

/* ── Desktop nav: logo (left) · links (centered) · controls (right) ── */
.nav, .site-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.nav > .nav-logo, .site-nav > .nav-logo { justify-self: start; }
.nav > .nav-links, .site-nav > .nav-links { justify-self: center; }
.nav-right { display: flex; align-items: center; gap: 16px; justify-self: end; }

/* Language switch as a compact segmented pill, visually separate from the links */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 3px;
  margin-left: 0;
}
.lang-switch a { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.72); }
.lang-switch a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.lang-switch a.active { background: var(--accent); color: #fff; }

/* ── Mobile hamburger (injected by ui.js) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav.open .nav-toggle span:nth-child(1), .site-nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2), .site-nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3), .site-nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  /* Collapse to a hamburger; revert grid → flex so items can stack */
  .nav, .site-nav { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
  .nav-toggle { display: flex; order: 2; margin-left: auto; }
  /* Links + the right-side controls drop into a panel below */
  .nav-links { display: none !important; order: 5; flex-basis: 100%; flex-direction: column; gap: 2px; padding: 10px 0 4px; }
  .nav-right { display: none !important; order: 6; flex-basis: 100%; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0 2px; border-top: 1px solid rgba(255,255,255,.12); }
  .nav.open .nav-links, .site-nav.open .nav-links { display: flex !important; }
  .nav.open .nav-right, .site-nav.open .nav-right { display: flex !important; }
  .nav-links a, .site-nav .nav-links a { padding: 11px 8px; border-radius: 8px; text-align: center; }
  .nav-links a:hover { background: rgba(255,255,255,.08); }
}

/* ── Mobile spacing refinements ── */
@media (max-width: 640px) {
  .page-hero { padding: 46px 18px 54px; }
  .container, .container-narrow { padding: 42px 18px; }
  .cta-band { padding: 46px 18px; }
  .hero-content { padding: 46px 20px 56px; }
  .hero-stats { gap: 22px 30px; }
}

/* ── Scroll-reveal (classes added by ui.js to below-the-fold blocks) ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .55s ease, transform .55s ease; will-change: opacity, transform; }
.reveal.reveal-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .feature-card:hover, .price-card:hover { transform: none; }
}
