/* ============================================================
   Formulo – main.css  (mobile-first, no framework)
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: #1a1a2e;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #2563eb; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
a:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); color: #0f172a; margin-bottom: 1rem; }
h2 { font-size: clamp(1.2rem, 3.5vw, 1.75rem); color: #1e293b; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.05rem; color: #1e293b; margin: 1rem 0 0.5rem; }
p  { margin-bottom: 1rem; max-width: 72ch; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.35rem; }

/* ── Layout container ─────────────────────────────────────── */
.header-inner,
.footer-inner,
main > article,
.homepage-inner,
.hero-inner,
.section-inner {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { flex: 1; padding: 2rem 0 3rem; }
main > article { padding: 0 1.25rem; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo { display: flex; align-items: center; gap: .5rem; }
.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color:#1a1a2e; /* #2563eb; */
  letter-spacing: -.5px;
}

/* ── Nav ──────────────────────────────────────────────────── */
.site-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  background: #fff;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.25rem;
}
.site-nav.open { display: flex; }
.site-nav a {
  display: block;
  padding: .6rem 0;
  font-size: .95rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}
.site-nav a:last-child { border-bottom: none; }
.lang-toggle {
  font-size: .85rem;
  font-weight: 600;
  padding: .35rem .75rem !important;
  border: 1.5px solid #2563eb !important;
  border-radius: 4px;
  color: #2563eb !important;
  display: inline-block;
  width: fit-content;
  border-bottom: 1.5px solid #2563eb !important;
  margin-top: .25rem;
}

/* ── Hamburger ────────────────────────────────────────────── */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #334155;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero section (homepages) ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  padding: 3rem 1.25rem 2.5rem;
  text-align: center;
}
.hero h1 { font-size: clamp(1.7rem, 5.5vw, 2.6rem); color: #0f172a; margin-bottom: .75rem; }
.hero .hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: #475569;
  max-width: 600px;
  margin: 0 auto 1.75rem;
}
/* ── Homepage hero layout (hero-section) ──────────────────── */
.hero-section {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  padding: 3rem 0 2.5rem;
}
.hero-section h1 {
  text-align: center;
  margin-bottom: 0;
}
.hero-body {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-top: 1.25rem;
}
.hero-body .hero-subtitle {
  flex: 1;
  margin: 0;
  max-width: none;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: #475569;
}
.hero-store-buttons {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: stretch;
}
.hero-store-buttons .btn-store { min-width: 160px; }
@media (max-width: 640px) {
  .hero-body { flex-direction: column; gap: 1.5rem; }
  .hero-store-buttons { width: 100%; }
}

/* ── App Store tooltip ─────────────────────────────────────── */
.btn-appstore { position: relative; }
.btn-appstore[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: .72rem;
  padding: .3rem .65rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 10;
}
.btn-appstore[data-tooltip]:hover::after { opacity: 1; }
/* ── Buttons ──────────────────────────────────────────────── */
.btn-cta {
  display: inline-block;
  background: #16a34a;
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 700;
  padding: .85rem 2rem;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-cta:hover, .btn-cta:focus { background: #15803d; transform: translateY(-1px); }
.btn-cta-hero {
  font-size: 1.15rem;
  padding: 1rem 2.5rem;
}

/* ── Features list ────────────────────────────────────────── */
.features-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: .6rem;
}
.features-list li {
  padding-left: 1.6rem;
  position: relative;
  color: #1e293b;
}
.features-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}

/* ── Examples grid ────────────────────────────────────────── */
.examples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.example-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}
.example-card h3 { font-size: .95rem; color: #2563eb; margin-bottom: .5rem; }
.example-card ul { padding-left: 1rem; font-size: .9rem; margin: 0; }
.example-card li { margin-bottom: .25rem; }
.example-card a { color: #1e293b; }
.example-card a:hover { color: #2563eb; }

/* ── Calculator widget placeholder ───────────────────────── */
.calculator-widget {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  color: #94a3b8;
  font-size: .9rem;
  font-style: italic;
}
.calculator-widget::before { content: "⚙ Calculateur interactif – à venir"; }

/* ── CTA section ──────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  margin: 2.5rem 0;
  text-align: center;
}
.cta-section h2 { margin-top: 0; }
.cta-section p { max-width: 540px; margin: 0 auto 1.25rem; color: #334155; }
.cta-note { font-size: .85rem; color: #64748b; margin-top: .75rem !important; }

/* ── FAQ ──────────────────────────────────────────────────── */
#faq { margin-top: 2rem; }
.faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: .85rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .1rem 0;
  user-select: none;
}
.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: #2563eb;
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item.open .faq-question::after { content: "−"; }
.faq-answer {
  margin-top: .5rem;
  color: #475569;
  font-size: .95rem;
  display: none;
}
.faq-answer.visible { display: block; }
/* No-JS fallback */
.no-js .faq-answer { display: block; }

/* ── Internal links ───────────────────────────────────────── */
.internal-links { margin: 2rem 0; }
.internal-links ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.internal-links li::before { content: none; }
.internal-links a {
  display: inline-block;
  padding: .4rem .9rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: .875rem;
  color: #1d4ed8;
}
.internal-links a:hover { background: #dbeafe; text-decoration: none; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2rem 1.25rem;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.footer-logo a {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; justify-content: center; }
.footer-nav a { color: #94a3b8; font-size: .875rem; }
.footer-nav a:hover { color: #fff; }
.footer-copy { font-size: .8rem; color: #64748b; }

/* ── Sections (SEO pages) ─────────────────────────────────── */
#intro, #how-it-works, #example { margin-bottom: 1.5rem; }
#how-it-works ul { margin-top: .5rem; }
#how-it-works li { max-width: 66ch; }

/* ── Very small screens < 480px ──────────────────────────── */
@media (max-width: 479px) {
  .examples-grid { grid-template-columns: 1fr; }
  .btn-cta { width: 100%; text-align: center; }
  .btn-cta-hero { padding: .9rem 1.5rem; }
}

/* ── Tablet ≥ 768px ───────────────────────────────────────── */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    position: static;
    background: none;
    border: none;
    padding: 0;
  }
  .site-nav a { padding: 0; border: none; }
  .lang-toggle { border-bottom: 1.5px solid #2563eb !important; margin-top: 0; }

  .examples-grid { grid-template-columns: repeat(2, 1fr); }

  .hero { padding: 4rem 2rem 3.5rem; }
}

/* ── Desktop ≥ 1024px ─────────────────────────────────────── */
@media (min-width: 1024px) {
  .examples-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 5rem 2rem 4rem; }
  h1 { font-size: 2.4rem; }
}

/* ── Logo icon ───────────────────────────────────────────── */
.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
  flex-shrink: 0;
}

/* ── Store buttons ────────────────────────────────────────── */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-top: 1.5rem;
  justify-content: flex-start;
}
.hero-section .store-buttons,
.cta-section .store-buttons { justify-content: center; }
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1.2rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  font-family: inherit;
  min-width: 155px;
  transition: background .15s, transform .1s;
}
.btn-store svg { flex-shrink: 0; }
.btn-store-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
  color: inherit;
}
.btn-store-text small {
  font-size: .62rem;
  font-weight: 400;
  display: block;
  opacity: .85;
}
.btn-store-text strong {
  font-size: .95rem;
  font-weight: 700;
}
.btn-playstore {
  background: #1a1a2e;
  color: #fff !important;
}
.btn-playstore:hover, .btn-playstore:focus {
  background: #16213e;
  transform: translateY(-1px);
  text-decoration: none !important;
}
.btn-appstore {
  background: #94a3b8;
  color: #fff !important;
  cursor: not-allowed;
  opacity: .7;
}

/* ── Screenshots ────────────────────────────────────────── */
.screenshots-section {
  background: #f1f5f9;
  padding: 2.5rem 0;
}
.screenshots-section h2 { text-align: center; }
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: end;
}
.screenshot-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.screenshot-item img {
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
  max-width: 160px;
  width: 100%;
  height: auto;
  display: block;
}
.screenshot-item figcaption {
  margin-top: .6rem;
  font-size: .8rem;
  color: #64748b;
  font-style: italic;
}
/* Mobile : 3 colonnes même sur petit écran */
@media (max-width: 480px) {
  .screenshots-grid {
    gap: .5rem;
  }
  .screenshot-item img {
    max-width: 100%;
    border-radius: 12px;
  }
  .screenshot-item figcaption {
    font-size: .7rem;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .cta-section, .calculator-widget, .nav-toggle { display: none; }
  body { color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  h1, h2, h3 { page-break-after: avoid; }
}
