/* ── Phormian design tokens ─────────────────────────────────────────────── */
:root {
  /* Neutral palette — white base, soft warm alternation */
  --bg: #FFFFFF;
  --bg-2: #F7F4ED;
  --surface: #FFFFFF;
  --ink: #0F1320;
  --ink-2: #232838;
  --ink-3: #545A6B;
  --ink-4: #6F7480; /* darkened from #8A8F9C → meets WCAG AA */
  --line: rgba(15, 19, 32, 0.08);
  --line-2: rgba(15, 19, 32, 0.14);

  /* Brand — deeper indigo, less generic-fintech */
  --brand-1: #1E2A78;
  --brand-2: #4A37C9;
  --brand-grad: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);

  /* Accents — warm signature note (terracotta) sets us apart from N26/Qonto/Pennylane */
  --mint: #0FA76E;
  --mint-soft: #DFF3E6;
  --coral: #C7553F;
  --amber: #C68A2E;
  --terracotta: #C7553F;

  /* Personas — tonal camaïeu of the primary instead of competing colors */
  --persona-assureur: #1E2A78;
  --persona-drh: #4A37C9;
  --persona-marque: #C7553F;

  /* Spacing scale */
  --pad-x: clamp(20px, 4vw, 64px);
  --maxw: 1240px;

  /* Density */
  --section-y: 120px;
  --hero-y: 100px;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(15, 19, 32, .04), 0 1px 3px rgba(15, 19, 32, .04);
  --sh-md: 0 4px 12px rgba(15, 19, 32, .06), 0 1px 3px rgba(15, 19, 32, .04);
  --sh-lg: 0 24px 60px -20px rgba(30, 42, 120, .22), 0 8px 24px rgba(15, 19, 32, .08);
  --sh-card: 0 1px 0 rgba(255,255,255,.6) inset, 0 1px 2px rgba(15,19,32,.04), 0 12px 32px rgba(15,19,32,.05);
}

[data-density="compact"] {
  --section-y: 80px;
  --hero-y: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Type scale */
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.serif {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: inherit;
}

.h1 {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-size: clamp(44px, 5.8vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.012em;
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}
.h2 {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}
.h3 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0;
}
.h4 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 500;
  margin: 0;
}
.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.45;
  color: var(--ink-3);
  text-wrap: pretty;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'ss02'; }

/* Layout */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section { padding: var(--section-y) 0; }

.divider { height: 1px; background: var(--line); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(20,23,31,.18);
}
.btn-grad {
  background: var(--brand-grad);
  color: #fff;
  position: relative;
  box-shadow: 0 6px 20px rgba(30, 42, 120, 0.32);
}
.btn-grad:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(30, 42, 120, 0.40);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { background: rgba(20,23,31,.04); }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--sh-card);
}

/* Brand chip */
.gradient-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Persona pill */
.persona-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  color: var(--ink-3);
}
.persona-pill:hover { color: var(--ink); border-color: var(--line-2); }
.persona-pill[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.persona-pill:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}
.persona-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  background: color-mix(in oklab, var(--bg), transparent 25%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 450;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s ease;
}
.nav-link:hover { background: rgba(20,23,31,.04); }
.nav-link[aria-current="page"] { color: var(--ink); background: rgba(20,23,31,.05); }
.nav-link .caret { font-size: 10px; opacity: 0.5; margin-left: 2px; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  padding: 8px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  transform: translateX(-50%) translateY(-4px);
}
.nav-link:hover .nav-dropdown,
.nav-link:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.nav-dropdown a:hover { background: var(--bg-2); }
.nav-dropdown a small {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  font-weight: 400;
}

/* Hero */
.hero {
  padding: var(--hero-y) 0 calc(var(--hero-y) + 40px);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  /* When hero collapses to 1-col, the phone is centered in a wide flex
     container, so absolutely-positioned floats land in empty space. Hide. */
  .hero-grid .float { display: none !important; }
}

/* Sub-component utility */
/* Kicker reads as a label, not a button: no background, no border */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.kicker-tag {
  background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Phone mockup */
.phone {
  width: 280px;
  height: 580px;
  border-radius: 44px;
  background: #0E1018;
  padding: 8px;
  box-shadow:
    0 0 0 2px rgba(15, 19, 32, .06),
    0 30px 80px -20px rgba(30, 42, 120, .35),
    0 12px 30px rgba(15, 19, 32, .12);
  position: relative;
}
/* Subtle pulsing halo behind the phone */
.phone::before {
  content: '';
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,55,201,0.12), transparent 60%);
  z-index: -1;
  animation: phone-halo 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes phone-halo {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  background: linear-gradient(180deg, #FFFEFB 0%, #F8F4EC 100%);
  overflow: hidden;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 26px;
  background: #0E1018;
  border-radius: 14px;
  z-index: 5;
}

/* Floating elements */
.float {
  position: absolute;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--sh-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 450;
}

/* Animated stripes for placeholders */
.placeholder-img {
  background:
    repeating-linear-gradient(135deg,
      rgba(20, 23, 31, 0.04) 0,
      rgba(20, 23, 31, 0.04) 1px,
      transparent 1px,
      transparent 12px),
    var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Section headers */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 56px;
}
.section-head .left { max-width: 640px; }
.section-head .eyebrow { margin-bottom: 16px; display: block; }

/* Footer */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 40px;
  margin-top: 80px;
}
.footer h5 {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
}
.footer a { display: block; padding: 6px 0; font-size: 14px; color: rgba(255,255,255,0.65); transition: color .15s; }
.footer a:hover { color: #fff; }

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(30, 42, 120, .14);
}
.field .err {
  font-size: 12px;
  color: var(--coral);
}

/* Animations */
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.7; }
  70% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.fade-in { animation: slide-in-up .5s ease both; }

/* Reveal-on-scroll: starts hidden, IntersectionObserver adds .is-visible */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 960px) {
  .white-label-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* ── /go page responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .go-brands-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (max-width: 960px) {
  .go-bonus-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    text-align: left;
  }
  .go-bonus-medal {
    width: 110px !important;
    height: 110px !important;
  }
  .go-bonus-medal > div:first-child {
    font-size: 36px !important;
  }
  .go-bonus-card {
    padding: 40px 32px !important;
  }
  .go-final-cta {
    padding: 56px 32px !important;
  }
}
@media (max-width: 720px) {
  .go-brands-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .go-bonus-card {
    padding: 32px 20px !important;
  }
  .go-bonus-medal {
    width: 96px !important;
    height: 96px !important;
  }
  .go-bonus-medal > div:first-child {
    font-size: 30px !important;
  }
  .go-final-cta {
    padding: 44px 20px !important;
  }
  .go-final-cta .btn {
    flex: 1;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .go-brands-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --section-y: 80px;
    --hero-y: 56px;
  }
  /* 4-col → 2-col */
  .section .container > div[style*="repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* 3-col → 2-col */
  .section .container > div[style*="repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* 2-col asymmetric grids → 1-col */
  .section .container > div[style*="grid-template-columns: 1.4fr 1fr"],
  .section .container > div[style*="grid-template-columns: '1.4fr 1fr'"],
  .section .container > div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 80px"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  /* Fonctionnement step rows: drop the visual, keep number + text */
  .step-card {
    grid-template-columns: 88px 1fr !important;
    gap: 28px !important;
  }
  .step-card > div:last-child {
    display: none !important;
  }
  /* Numbers section dark card */
  .section .container > div[style*="padding: 56px 48px"] > div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* ROI simulator */
  .card[style*="grid-template-columns: 1.2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .card[style*="grid-template-columns: 1.2fr 1fr"] > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
  }
  /* Footer */
  .footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 32px !important;
  }
}

@media (max-width: 720px) {
  :root {
    --section-y: 56px;
    --hero-y: 32px;
    --pad-x: 20px;
  }
  body { font-size: 15px; }

  /* Nav: hide center links on mobile, keep logo + CTA */
  .nav-inner { height: 60px; }
  .nav-links { display: none !important; }
  .nav-inner > div:last-child > .nav-link { display: none !important; }
  .nav-inner > div:last-child > .btn { padding: 10px 14px; font-size: 13px; }

  /* All multi-col grids → single col */
  .hero-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .section .container > div[style*="repeat(4, 1fr)"],
  .section .container > div[style*="repeat(3, 1fr)"],
  .section .container > div[style*="repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Section heads stack */
  .section-head {
    flex-direction: column !important;
    align-items: start !important;
    gap: 16px !important;
    margin-bottom: 32px !important;
  }

  /* Numbers card */
  .section .container > div[style*="padding: 56px 48px"] {
    padding: 40px 24px !important;
  }
  .section .container > div[style*="padding: 56px 48px"] > div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
    margin-top: 32px !important;
  }
  .section .container > div[style*="padding: 56px 48px"] > div > div[style*="grid-template-columns: repeat(4, 1fr)"] > div {
    border-top: none !important;
    padding-top: 0 !important;
  }
  .section .container > div[style*="padding: 56px 48px"] > div > div[style*="grid-template-columns: repeat(4, 1fr)"] div[style*="font-size: 56px"] {
    font-size: 40px !important;
  }

  /* CTA section card */
  .section .container > div[style*="padding: 80px 48px"] {
    padding: 48px 24px !important;
  }

  /* Cards */
  .card {
    padding: 24px !important;
  }
  .card[style*="padding: 36px"], .card[style*="padding: 32px"], .card[style*="padding: 40px"] {
    padding: 24px !important;
  }

  /* Hero phone — scale down. Floats already hidden via 768px rule. */
  .hero-grid > div:last-child {
    min-height: auto !important;
    transform: scale(0.85);
    transform-origin: top center;
  }

  /* Fonctionnement steps stack: number row on top, text below */
  .step-card {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 24px !important;
    align-items: start !important;
  }
  .step-card > div:first-child {
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 12px !important;
  }
  .step-card > div:first-child > div:last-child {
    font-size: 32px !important;
  }

  /* ROI simulator inner padding */
  .card[style*="grid-template-columns: 1.2fr 1fr"] > div { padding: 28px 24px !important; }

  /* Pourquoi grid: 2-col → 1-col, kill the gridColumn 1/-1 stretch */
  .section .container > div[style*="repeat(2, 1fr)"] > div[style*="gridColumn"],
  .section .container > div[style*="repeat(2, 1fr)"] > div[style*="grid-column"] {
    grid-column: auto !important;
  }

  /* Demo form 2-col rows → 1-col */
  form .field + .field { margin-top: 0; }
  form > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer single col */
  .footer { padding: 56px 0 32px !important; margin-top: 48px !important; }
  .footer .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .footer .container > div[style*="border-top"] {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }

  /* Buttons full-width */
  .btn { padding: 12px 18px; }
  .hero .btn-grad, .hero .btn-ghost {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .phone { width: 240px; height: 500px; }
  .hero-grid > div:last-child > div:first-child { transform: scale(0.95); }
}
