/* === ROOT VARIABLES & GLOBAL STYLES === */
:root {
  --brand: #6F56F9;
  --brand-hover: #5833F0;
  --blue: #A8CBF7;
  --blue-soft: #E5F0FE;
  --ink: #333333;
  --ink-muted: #666666;
  --card-border: rgba(0, 0, 0, .08);
  --nav-h: 56px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overscroll-behavior-y: contain; /* Optional: reduce browser-UI bounce-induced jiggle */
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--blue-soft);
  line-height: 1.65;
}

a {
  color: var(--brand-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
  letter-spacing: -0.02em;
}
h1 {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 16px;
}
h2 {
  font-size: clamp(24px, 3.4vw, 36px);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
p.lead {
  font-size: clamp(16px, 2vw, 18px);
  margin: 0;
}

/* === UTILITIES & SHARED COMPONENTS === */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid {
  display: grid;
  gap: 48px;
}

.two-col {
  grid-template-columns: 1.25fr 1fr;
  align-items: start;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  background: var(--brand-hover);
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--ink);
}

/* === ALL ANIMATIONS (CORRECTED) === */

/* Reveal-on-scroll animation (with bounce) */
.reveal {
  opacity: 1; /* Visible by default for non-JS users */
}
html.js .reveal {
  opacity: 0; /* Hidden by JS for animation */
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hover-to-lift animation */
.step, .reason, .faq details {
  transition: transform .25s ease, box-shadow .25s ease;
}
.step:hover, .reason:hover, .faq details:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
}

/* This new rule ensures the hover works ON TOP of the reveal animation */
html.js .reveal.is-visible:hover {
    transform: translateY(-2px);
}


.diagonal-divider {
  position: relative;
  height: 56px;
  overflow: hidden;
  line-height: 0;
}
.diagonal-divider svg {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.diagonal-divider.to-white { color: #fff; }
.diagonal-divider.to-blue-soft { color: var(--blue-soft); }
.diagonal-divider.to-blue { color: var(--blue); }

/* Accessibility Focus Styles */
:where(a, button, .btn, summary, .nav a) {
  outline: none;
}
:where(a, button, .btn, summary, .nav a):focus-visible {
  outline: 2px solid var(--brand) !important;
  outline-offset: 3px;
  border-radius: 10px;
}
.btn:focus:not(:focus-visible),
a:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
.btn:active,
a:active,
.btn:focus-visible:active,
a:focus-visible:active {
  outline: none !important;
}

/* === SECTION STYLING === */

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blue-soft);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  will-change: transform;
  transition: transform 0.35s ease-in-out;
}
.nav.scrolled {
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
}
.nav.nav--hidden {
  transform: translateY(-110%);
}
.nav .row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Hero */
.hero {
  background: var(--blue);
  padding: 64px 0;
}
.hero h1, .hero .lead, .hero .badge {
  color: #0b0b0b;
}
.badge {
  display: inline-block;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 12px;
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
}
.ticks li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hero ticks: automatically top-align icon only when text wraps (JS adds .is-wrapped) */
.hero .ticks li.is-wrapped {
  align-items: flex-start;
}
.hero .ticks li.is-wrapped .icon {
  /* small optical adjustment */
}
.hero .ticks .tick-text {
  display: inline; /* keep normal inline flow for measuring/wrapping */
}


/* How it works */
.hiw {
  background: #fff;
  padding: 72px 0;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 18px;
}
.step {
  background: var(--blue-soft);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
}
.step h3 {
  margin: 0 0 6px;
}

/* Lead Form (Mobile) */
.lead-form {
  background: var(--blue);
  padding: 16px 0 24px;
}
.lead-form #form-mobile iframe {
  width: 100% !important;
  min-height: 85vh !important;
  border: 0 !important;
  display: block;
}

/* Why Online */
.why-online {
  background: var(--blue-soft);
  padding: 72px 0;
}
.why-online h2 {
  margin-bottom: 18px;
}
.reasons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.reason {
  background: #fff;
  border: 1px solid var(--card-border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .04);
  border-radius: 16px;
  padding: 18px;
}
.reason h3 {
  margin: 0 0 6px;
}
@media (min-width: 1120px) {
  .why-online .reasons {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* About Us */
.about-us {
  background: #fff;
  padding: 72px 0;
}
.about-us h2 {
  margin-bottom: 18px;
}
.about-us p {
  max-width: 720px;
  margin-bottom: 16px;
}

/* FAQ */
.faq {
  background: var(--blue);
  padding: 72px 0;
}
details {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
}
details + details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
details summary:hover {
  color: var(--brand-hover);
}
details summary:focus-visible {
  outline-offset: 3px;
  border-radius: 8px;
}

/* Footnotes: match FAQ background only */
.footnotes {
  background: var(--blue);   /* same darker blue as FAQ */
  padding: 72px 0;           /* optional: match FAQ vertical spacing */
}

/* Footer */
footer {
  background: #fff;
  padding: 32px 0;
  color: var(--ink-muted);
  text-align: center;
}
footer .brand {
  font-size: 22px;
}
footer p {
  font-size: 14px;
  margin: 4px 0 12px;
}
.footer-legal {
  font-size: 12px;
}
.footer-legal a {
  color: var(--ink-muted);
  margin: 0 8px;
}

/* Jotform iFrame */
#form-desktop, #form-mobile {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
#form-desktop iframe, #form-mobile iframe {
  display: block;
  margin: 0;
  width: 1px;
  min-width: 100% !important;
  border: 0;
  background: transparent;
}
#form-desktop {
  margin-top: 6px;
}
#form-desktop iframe {
    height: 520px;
}

/* === VISIBILITY LOGIC (Desktop vs Mobile) === */
.only-desktop { display: block; }
.only-mobile { display: none; }


/* === RESPONSIVE STYLES (Tablet & Mobile) === */
@media (max-width: 991.98px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: block !important; }

  .two-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hero {
    padding: 28px 0 64px !important; /* Extend blue for CTA */
  }
  .hero-cta {
    margin-top: 36px !important;
    margin-bottom: 36px !important;
  }
  .btn.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 520px;
    color: #fff;
    border-radius: 18px !important;
    box-shadow: 0 8px 18px rgba(111, 86, 249, .18);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Balanced font & padding */
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    padding: 18px 24px !important;
  }

  body.form-open .nav {
    transform: translateY(-110%) !important;
  }
  body.nav-lock .nav {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav, .reveal, .step, .reason, .faq details {
    transition: none !important;
  }
}

/* === SMALL MOBILE STYLES === */
@media (max-width: 768px) {
  /* Layout adjustments */
  .steps, .reasons {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Mobile Header */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
  }
  /* Reserve space for fixed header to prevent content jump */
  body {
    padding-top: var(--nav-h) !important;
  }
}

/* === LEGAL & CONTACT PAGE STYLES === */
.legal-page {
    background: var(--blue);
    padding: 64px 0;
}
.legal-page .container {
    max-width: 800px;
}
.legal-card {
    background: #fff;
    padding: clamp(24px, 5vw, 48px);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
}
.legal-card h1 {
    margin-bottom: 8px;
}
.legal-card h2 {
    margin-top: 48px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 8px;
}
.legal-card .last-updated {
    font-size: 14px;
    color: var(--ink-muted);
    margin-bottom: 32px;
}
.legal-card p, .legal-card li {
    line-height: 1.7;
}
.legal-card ul {
    padding-left: 24px;
}
.contact-details {
    background: var(--blue-soft);
    border: 1px solid var(--card-border);
    padding: 24px;
    border-radius: 12px;
    margin-top: 32px;
    text-align: center;
}\n\n
/* --- Mobile form spacing to match older version feel --- */
@media (max-width: 991.98px){
  #form-mobile { scroll-margin-top: var(--nav-h, 72px); }
  #form-mobile iframe { min-height: 80vh !important; }
}
\n

/* === Hero ticks: top-align icon only when text wraps (JS-controlled) === */
.hero .ticks li.is-wrapped {
  align-items: flex-start;
}
.hero .ticks li.is-wrapped .icon {
  margin-top: var(--icon-top-adjust, 0px); /* computed per-item in JS */
}
