/* ===========================================================================
   Sama Caisse — landing page de lancement (démo Zephyr)
   Autonome : aucune requête externe, polices système, zéro dépendance.
   =========================================================================== */

@layer reset, base, components, utils;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
  img, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; cursor: pointer; }
  ul, ol { list-style: none; padding: 0; }
  a { color: inherit; }
}

@layer base {
  :root {
    --night: #062a24;
    --night-2: #041d19;
    --mint: #35d7a1;
    --mint-deep: #17b381;
    --cream: #f3f7f4;
    --ink: #0b1a17;
    --muted: #5c6f6a;
    --line: rgba(11, 26, 23, 0.12);

    --bg: var(--cream);
    --fg: var(--ink);
    --fg-soft: var(--muted);
    --surface: #ffffff;

    --fs-hero: clamp(2.2rem, 3.4vw + 1rem, 4rem);
    --fs-h2: clamp(1.65rem, 1.6vw + 0.85rem, 2.4rem);
    --fs-lead: clamp(1.02rem, 0.3vw + 0.92rem, 1.16rem);

    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

    --shell: 1180px;
    --pad: clamp(1.1rem, 4vw, 2.25rem);
    --r: 14px;
    --r-sm: 10px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow: 0 18px 44px -24px rgba(6, 42, 36, 0.45);

    color-scheme: light dark;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #08201c;
      --fg: #e8f2ee;
      --fg-soft: #9db3ad;
      --surface: #0c2a25;
      --line: rgba(232, 242, 238, 0.14);
    }
  }

  body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
  }

  h1, h2, h3 {
    font-weight: 650;
    line-height: 1.12;
    letter-spacing: -0.025em;
    text-wrap: balance;
  }
  h1 { font-size: var(--fs-hero); }
  h2 { font-size: var(--fs-h2); }
  h3 { font-size: 1.08rem; letter-spacing: -0.015em; line-height: 1.3; }
  h1 em { font-style: normal; color: var(--mint-deep); }
  p { text-wrap: pretty; }

  :focus-visible {
    outline: 3px solid var(--mint-deep);
    outline-offset: 2px;
    border-radius: 6px;
  }
  ::selection { background: var(--mint); color: var(--night); }
}

@layer components {
  .shell { width: min(100% - (var(--pad) * 2), var(--shell)); margin-inline: auto; }
  .section { padding-block: clamp(3.25rem, 7vw, 6rem); }
  .section.soft { background: color-mix(in srgb, var(--mint) 7%, var(--bg)); }
  .section.dark { background: var(--night); color: var(--cream); }
  .section.dark .kicker { color: var(--mint); }

  .sr {
    position: absolute; width: 1px; height: 1px;
    padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .skip {
    position: absolute; left: 50%; translate: -50% -150%; z-index: 100;
    background: var(--night); color: var(--cream); padding: 0.7rem 1.2rem;
    border-radius: var(--r-sm); font-size: 0.85rem;
    transition: translate 0.2s var(--ease);
  }
  .skip:focus-visible { translate: -50% 0.6rem; }

  .kicker {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.2em;
    color: var(--mint-deep); margin-bottom: 0.85rem; font-weight: 600;
  }
  .section-title { max-width: 22ch; margin-bottom: 2.5rem; }

  /* ---------- Bandeau d'annonce ---------- */
  .announce {
    background: var(--night); color: var(--cream);
    font-size: 0.82rem; text-align: center; padding-block: 0.6rem;
  }
  .announce b { color: var(--mint); }

  /* ---------- Barre haute ---------- */
  .topbar {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-in { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
  .brand {
    display: inline-flex; align-items: center; gap: 0.55rem;
    text-decoration: none; font-weight: 600; font-size: 1.05rem;
    letter-spacing: -0.02em; margin-inline-end: auto;
  }
  .brand b { font-weight: 650; color: var(--mint-deep); }
  .brand-mark { width: 26px; height: 26px; color: var(--mint); }

  .nav { display: none; }
  @media (min-width: 940px) {
    .nav { display: block; }
    .nav ul { display: flex; gap: 1.6rem; }
    .nav a {
      text-decoration: none; font-size: 0.88rem; color: var(--fg-soft);
      transition: color 0.2s var(--ease);
    }
    .nav a:hover { color: var(--fg); }
  }
  .topbar-cta { display: none; }
  @media (min-width: 720px) { .topbar-cta { display: inline-flex; } }

  /* ---------- Boutons ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; min-height: 46px; padding: 0.72rem 1.4rem;
    font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em;
    text-decoration: none; border-radius: 999px; border: 1.5px solid transparent;
    transition: background-color 0.22s var(--ease), color 0.22s var(--ease),
                border-color 0.22s var(--ease), translate 0.22s var(--ease),
                box-shadow 0.22s var(--ease);
  }
  .btn-mint { background: var(--mint); color: var(--night); }
  .btn-mint:hover { background: var(--mint-deep); translate: 0 -2px; box-shadow: var(--shadow); }
  .btn-outline { border-color: var(--line); color: var(--fg); }
  .btn-outline:hover { border-color: var(--mint-deep); color: var(--mint-deep); }
  .btn-full { width: 100%; }
  .btn-lg { min-height: 54px; padding-inline: 2rem; font-size: 1rem; }

  /* ---------- Hero ---------- */
  .hero { padding-block: clamp(2.5rem, 6vw, 5rem); overflow: clip; }
  .hero-in { display: grid; gap: clamp(2.5rem, 6vw, 4rem); align-items: center; }
  @media (min-width: 980px) { .hero-in { grid-template-columns: 1.05fr 0.95fr; } }

  .pill {
    display: inline-block; margin-bottom: 1.1rem;
    background: color-mix(in srgb, var(--mint) 22%, transparent);
    color: var(--mint-deep); border-radius: 999px;
    padding: 0.3rem 0.85rem; font-size: 0.74rem;
    text-transform: uppercase; letter-spacing: 0.14em; font-weight: 650;
  }
  .hero h1 { margin-bottom: 1.25rem; }
  .lead { font-size: var(--fs-lead); color: var(--fg-soft); max-width: 36rem; }
  .hero .lead { margin-bottom: 2rem; }

  .capture { max-width: 34rem; }
  .capture-row { display: grid; gap: 0.6rem; }
  @media (min-width: 560px) { .capture-row { grid-template-columns: 1fr auto; } }
  .field input {
    width: 100%; min-height: 46px; padding: 0.7rem 1rem;
    background: var(--surface); color: var(--fg);
    border: 1.5px solid var(--line); border-radius: 999px;
    transition: border-color 0.22s var(--ease);
  }
  .field input::placeholder { color: color-mix(in srgb, var(--fg-soft) 75%, transparent); }
  .field input:focus-visible { border-color: var(--mint-deep); }
  .field[data-invalid] input { border-color: #e2604a; }
  .capture-note { font-size: 0.79rem; color: var(--fg-soft); margin-top: 0.7rem; }
  .capture-note[data-state="ok"] { color: var(--mint-deep); font-weight: 600; }
  .capture-note[data-state="err"] { color: #cf4d36; }

  .hero-proof { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 1.75rem; }
  .hero-proof li {
    position: relative; padding-inline-start: 1.3rem;
    font-size: 0.85rem; color: var(--fg-soft);
  }
  .hero-proof li::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 0.42em;
    width: 8px; height: 8px; border-radius: 50%; background: var(--mint);
  }

  /* ---------- Maquette téléphone (100 % CSS) ---------- */
  .hero-visual { position: relative; display: grid; place-items: center; min-height: 420px; }
  .phone {
    position: relative; z-index: 2;
    width: min(282px, 74vw); aspect-ratio: 9 / 18.6;
    background: var(--night); border-radius: 38px;
    padding: 9px; box-shadow: var(--shadow), 0 0 0 1.5px rgba(255, 255, 255, 0.08) inset;
    animation: float 7s ease-in-out infinite alternate;
  }
  @keyframes float { to { translate: 0 -12px; rotate: -1deg; } }
  .phone-notch {
    position: absolute; top: 15px; left: 50%; translate: -50% 0;
    width: 78px; height: 5px; border-radius: 99px;
    background: rgba(255, 255, 255, 0.22); z-index: 3;
  }
  .phone-screen {
    height: 100%; border-radius: 30px; background: var(--cream);
    padding: 30px 16px 16px; display: grid; gap: 12px; align-content: start;
    color: var(--ink); overflow: hidden;
  }
  .app-top { display: flex; align-items: center; justify-content: space-between; }
  .app-title { font-size: 0.78rem; font-weight: 650; }
  .app-badge {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em;
    background: color-mix(in srgb, var(--mint) 30%, transparent);
    color: var(--mint-deep); padding: 0.16rem 0.5rem; border-radius: 999px; font-weight: 700;
  }
  .app-total {
    background: var(--night); color: var(--cream);
    border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px;
  }
  .app-total span { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.65; }
  .app-total b { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; }
  .app-total i { font-style: normal; font-size: 0.68rem; color: var(--mint); }
  .app-lines { display: grid; gap: 7px; }
  .app-lines li {
    display: flex; justify-content: space-between; gap: 10px;
    font-size: 0.7rem; padding-bottom: 6px;
    border-bottom: 1px solid rgba(11, 26, 23, 0.08);
  }
  .app-lines b { font-weight: 650; font-variant-numeric: tabular-nums; }
  .app-cta {
    margin-top: 4px; background: var(--mint); color: var(--night);
    border-radius: 999px; text-align: center; padding: 10px;
    font-size: 0.8rem; font-weight: 700;
  }

  /* Décor du hero : deux formes franches, dessinées. Pas de halo flouté. */
  .visual-plate {
    position: absolute; z-index: 1;
    width: min(240px, 62vw); aspect-ratio: 3 / 4.4;
    background: var(--mint);
    border-radius: 30px;
    top: 14%; inset-inline-end: 8%;
    rotate: 6deg;
  }
  .visual-dots {
    position: absolute; z-index: 0;
    width: min(190px, 48vw); aspect-ratio: 1;
    bottom: 4%; inset-inline-start: 0;
    background-image: radial-gradient(currentColor 1.6px, transparent 1.7px);
    background-size: 15px 15px;
    color: color-mix(in srgb, var(--night) 32%, transparent);
  }
  @media (prefers-color-scheme: dark) {
    .visual-dots { color: color-mix(in srgb, var(--mint) 38%, transparent); }
  }

  /* ---------- Bandeau villes ---------- */
  .logos { border-block: 1px solid var(--line); padding-block: 1.25rem; }
  .logos-in { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.5rem; }
  .logos p {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em;
    color: var(--fg-soft);
  }
  .logos ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
  .logos li { font-weight: 650; font-size: 0.95rem; color: var(--fg); opacity: 0.75; }

  /* ---------- Avant / après ---------- */
  .compare { display: grid; gap: 1rem; }
  @media (min-width: 820px) { .compare { grid-template-columns: 1fr 1fr; } }
  .compare-col {
    border: 1.5px solid var(--line); border-radius: var(--r);
    padding: clamp(1.35rem, 3vw, 2rem); background: var(--surface);
  }
  .compare-col h3 { margin-bottom: 1rem; }
  .compare-col ul { display: grid; gap: 0.75rem; }
  .compare-col li {
    position: relative; padding-inline-start: 1.7rem;
    font-size: 0.95rem; color: var(--fg-soft);
  }
  .compare-col li::before {
    position: absolute; inset-inline-start: 0; top: 0;
    font-weight: 700; font-size: 1rem;
  }
  .before li::before { content: "×"; color: #cf4d36; }
  .after { border-color: color-mix(in srgb, var(--mint) 55%, transparent); }
  .after li::before { content: "✓"; color: var(--mint-deep); }

  /* ---------- Fonctionnalités ---------- */
  .feats { display: grid; gap: 1rem; }
  @media (min-width: 700px) { .feats { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1040px) { .feats { grid-template-columns: repeat(3, 1fr); } }
  .feat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r); padding: 1.5rem;
    display: grid; gap: 0.6rem; align-content: start;
    transition: background-color 0.3s var(--ease), translate 0.3s var(--ease);
  }
  .feat:hover { background: rgba(255, 255, 255, 0.09); translate: 0 -3px; }
  .feat svg {
    width: 26px; height: 26px; fill: none; stroke: var(--mint);
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  }
  .feat p { font-size: 0.92rem; color: rgba(243, 247, 244, 0.68); }

  /* ---------- Étapes ---------- */
  .steps { display: grid; gap: 1.25rem; counter-reset: s; }
  @media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
  .steps li { display: grid; gap: 0.55rem; align-content: start; }
  .step-n {
    display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: 50%; background: var(--night); color: var(--mint);
    font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3rem;
  }
  .steps p { color: var(--fg-soft); font-size: 0.95rem; }

  /* ---------- Tarifs ---------- */
  .toggle-wrap { display: flex; justify-content: center; margin-bottom: 2.25rem; }
  .toggle {
    display: inline-flex; gap: 2px; padding: 4px;
    background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  }
  .toggle-btn {
    min-height: 40px; padding: 0.4rem 1.15rem; border-radius: 999px;
    font-size: 0.87rem; font-weight: 600; color: var(--fg-soft);
    transition: background-color 0.22s var(--ease), color 0.22s var(--ease);
  }
  .toggle-btn span { font-size: 0.72rem; opacity: 0.85; }
  .toggle-btn.is-on { background: var(--night); color: var(--cream); }

  .plans { display: grid; gap: 1rem; align-items: start; }
  @media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); } }
  .plan {
    position: relative; background: var(--surface);
    border: 1.5px solid var(--line); border-radius: var(--r);
    padding: clamp(1.4rem, 3vw, 2rem); display: grid; gap: 0.65rem;
  }
  .plan.is-featured {
    border-color: var(--mint-deep);
    box-shadow: var(--shadow);
  }
  .plan-tag {
    position: absolute; top: -11px; inset-inline-start: clamp(1.4rem, 3vw, 2rem);
    background: var(--mint); color: var(--night);
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; padding: 0.22rem 0.7rem; border-radius: 999px;
  }
  .plan-for { font-size: 0.87rem; color: var(--fg-soft); }
  .plan-price { display: grid; gap: 0.1rem; margin-block: 0.5rem; }
  .plan-price b {
    font-size: clamp(1.85rem, 2vw + 1rem, 2.4rem); font-weight: 650;
    letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  }
  .plan-unit { font-size: 0.8rem; color: var(--fg-soft); }
  .plan ul { display: grid; gap: 0.55rem; margin-block: 0.6rem 1rem; }
  .plan li {
    position: relative; padding-inline-start: 1.4rem;
    font-size: 0.9rem; color: var(--fg-soft);
  }
  .plan li::before {
    content: "✓"; position: absolute; inset-inline-start: 0;
    color: var(--mint-deep); font-weight: 700;
  }
  .plans-note {
    text-align: center; margin-top: 1.25rem;
    font-size: 0.78rem; color: var(--fg-soft);
  }

  /* ---------- FAQ ---------- */
  .faq-shell { max-width: 46rem; }
  .faq { display: grid; gap: 0.5rem; }
  .faq details {
    background: var(--surface); border: 1.5px solid var(--line);
    border-radius: var(--r-sm); overflow: hidden;
  }
  .faq details[open] { border-color: color-mix(in srgb, var(--mint) 50%, transparent); }
  .faq summary {
    cursor: pointer; list-style: none; padding: 1rem 1.2rem;
    font-weight: 600; font-size: 0.98rem; min-height: 44px;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after {
    content: "+"; font-size: 1.3rem; font-weight: 400; color: var(--mint-deep);
    transition: rotate 0.25s var(--ease); line-height: 1;
  }
  .faq details[open] summary::after { rotate: 45deg; }
  .faq p { padding: 0 1.2rem 1.15rem; color: var(--fg-soft); font-size: 0.94rem; }

  /* ---------- CTA final ---------- */
  .final {
    background: var(--night); color: var(--cream);
    padding-block: clamp(3.5rem, 8vw, 6rem); text-align: center;
  }
  .final-in { display: grid; gap: 1.1rem; justify-items: center; }
  .final h2 { max-width: 22ch; }
  .final p { color: rgba(243, 247, 244, 0.7); }
  .final .btn { margin-top: 0.75rem; }

  /* ---------- Pied de page ---------- */
  .footer { padding-block: 2.75rem 1.5rem; border-top: 1px solid var(--line); }
  .footer-in { display: grid; gap: 1.5rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
  @media (min-width: 760px) { .footer-in { grid-template-columns: 1fr auto; align-items: start; } }
  .footer-brand { font-size: 1.15rem; margin-bottom: 0.4rem; }
  .footer-in p { color: var(--fg-soft); font-size: 0.9rem; max-width: 40ch; }
  .footer nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
  .footer nav a { font-size: 0.86rem; text-decoration: none; color: var(--fg-soft); }
  .footer nav a:hover { color: var(--mint-deep); }
  .demo-note { padding-top: 1.4rem; padding-bottom: 4.5rem; }
  @media (min-width: 720px) { .demo-note { padding-bottom: 0; } }
  .demo-note p { font-size: 0.78rem; line-height: 1.6; color: var(--fg-soft); }
  .demo-note b { color: var(--fg); }
  .demo-note a { color: var(--mint-deep); }

  /* ---------- CTA collant mobile ---------- */
  .sticky-cta {
    position: fixed; inset-inline: var(--pad); bottom: 0.85rem; z-index: 45;
    display: flex; align-items: center; justify-content: center;
    min-height: 50px; border-radius: 999px;
    background: var(--mint); color: var(--night);
    font-weight: 700; font-size: 0.95rem; text-decoration: none;
    box-shadow: var(--shadow);
    translate: 0 140%; transition: translate 0.35s var(--ease);
  }
  .sticky-cta.is-in { translate: 0 0; }
  @media (min-width: 720px) { .sticky-cta { display: none; } }
}

@layer utils {
  .obs { opacity: 0; translate: 0 22px; transition: opacity 0.65s var(--ease), translate 0.65s var(--ease); }
  .obs.seen { opacity: 1; translate: 0 0; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    .obs { opacity: 1; translate: none; }
    .sticky-cta { transition: none; }
  }
}

/* ===========================================================================
   Fonctionnalités : trois blocs alternés plutôt qu'une grille d'icônes.
   Six tuiles identiques alignées en 3x2, c'est la signature d'un gabarit.
   =========================================================================== */
@layer components {
  .fonc {
    display: grid; gap: clamp(1rem, 3vw, 2.5rem);
    padding-block: clamp(1.75rem, 4vw, 3rem);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    align-items: start;
  }
  @media (min-width: 820px) {
    .fonc { grid-template-columns: 1.4fr 1fr; }
    /* Une ligne sur deux inverse l'ordre : le regard ne retombe jamais au
       même endroit. */
    .fonc-inverse .fonc-texte { order: 2; }
    .fonc-inverse .fonc-liste { order: 1; }
  }
  .fonc-texte h3 {
    font-size: clamp(1.25rem, 1vw + 0.95rem, 1.6rem);
    margin-bottom: 0.7rem;
  }
  .fonc-texte p { color: rgba(243, 247, 244, 0.68); max-width: 54ch; }
  .fonc-liste { display: grid; gap: 0.55rem; align-content: start; }
  .fonc-liste li {
    position: relative; padding-inline-start: 1.4rem;
    font-size: 0.92rem; color: rgba(243, 247, 244, 0.82);
  }
  .fonc-liste li::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 0.62em;
    width: 10px; height: 1.5px; background: var(--mint);
  }

  .comment { display: grid; gap: 1.25rem; }
  @media (min-width: 900px) {
    .comment { grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
  }
  .comment h2 { max-width: 18ch; }
  .comment p { color: var(--fg-soft); font-size: var(--fs-lead); line-height: 1.7; }
}
