/* Page vitrine de Carnet NEWIPAY. Ni police ni script à télécharger : la page doit
   s'afficher vite sur un téléphone en 3G. Le motif du carnet reprend la réglure Seyès
   des cahiers d'écolier, celle du carnet papier que le service remplace. */

:root {
  --paper: #ffffff;
  --night: #141b34;
  --ink: #1d3fa3;
  --muted: #545d7a;
  --rule: #c9d0f0;
  --rule-strong: #9aa6de;
  --margin-red: #e05a63;
  --band: #f3f5fc;
  --wall: #efeae2;
  --wa-green: #008069;
  --wa-green-deep: #00695a;
  --font:
    system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--night);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
figure {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* En-tête */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--night);
  font-size: 1.125rem;
  text-decoration: none;
}

.wordmark svg {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
}

.wordmark strong {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.site-header nav a {
  font-weight: 600;
}

/* Ouverture : le titre, et le carnet qui passe dans WhatsApp */

.hero {
  display: grid;
  gap: 3rem;
  align-items: center;
  padding-block: clamp(1.5rem, 5vw, 4.5rem) clamp(3rem, 8vw, 6rem);
}

.hero h1 {
  max-width: 14ch;
  color: var(--ink);
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.04;
  text-wrap: balance;
}

.lead {
  max-width: 36rem;
  margin-top: 1.5rem;
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
}

/* Bouton d'essai, au vert de WhatsApp où il mène. Sur téléphone, il prend
   toute la largeur, sous le pouce. */
.cta {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--wa-green);
  box-shadow: 0 12px 24px -14px rgb(0 128 105 / 80%);
  color: var(--paper);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  text-wrap: balance;
}

.cta-button:hover {
  background: var(--wa-green-deep);
}

.cta-note {
  max-width: 30rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.scene {
  --s: 8px;
  --row: calc(var(--s) * 4);
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 28rem;
  padding-bottom: 7rem;
}

/* Réglure Seyès : une ligne fine tous les 2 mm, une ligne forte tous les 8 mm,
   des verticales tous les 8 mm et la marge rouge, posée sur une verticale.
   Une rangée du carnet vaut 8 mm ; les trois dernières restent vides. */
.carnet {
  --marge: calc(var(--row) * 2);
  padding: var(--row) 1.25rem calc(var(--row) * 3) calc(var(--marge) + 0.9rem);
  border-radius: 3px;
  background-color: var(--paper);
  background-image:
    linear-gradient(
      90deg,
      transparent calc(var(--marge) - 1px),
      var(--margin-red) calc(var(--marge) - 1px) calc(var(--marge) + 1px),
      transparent calc(var(--marge) + 1px)
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0 calc(var(--row) - 1px),
      var(--rule-strong) calc(var(--row) - 1px) var(--row)
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0 calc(var(--s) - 1px),
      var(--rule) calc(var(--s) - 1px) var(--s)
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(var(--row) - 1px),
      var(--rule) calc(var(--row) - 1px) var(--row)
    );
  box-shadow:
    0 1px 1px rgb(20 27 52 / 6%),
    0 18px 40px -18px rgb(20 27 52 / 35%);
  color: var(--ink);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: var(--row);
}

.carnet-title {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.carnet ol {
  padding: 0;
  list-style: none;
}

.carnet li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.carnet .date {
  position: absolute;
  right: calc(100% + 1.3rem);
  font-size: 0.8125rem;
}

.carnet .amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Vente réglée : barrée d'un trait de stylo, comme sur le carnet papier. */
.carnet .paid::after {
  content: '';
  position: absolute;
  top: 56%;
  right: -0.35rem;
  left: -0.35rem;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transform: rotate(-1.2deg);
}

/* La bulle arrive sous la dernière vente notée, sur les rangées vides. */
.chat {
  position: absolute;
  top: calc(var(--row) * 6 + 0.5rem);
  right: -1rem;
  width: min(18.5rem, 88%);
  padding: 0.6rem;
  border-radius: 14px;
  background: var(--wall);
  box-shadow:
    0 1px 1px rgb(20 27 52 / 8%),
    0 22px 44px -20px rgb(20 27 52 / 45%);
  animation: arrive 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both;
}

.bubble {
  position: relative;
  padding: 0.45rem 0.6rem 0.35rem;
  border-radius: 0 8px 8px;
  background: var(--paper);
  box-shadow: 0 1px 0.5px rgb(11 20 26 / 13%);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  border-right: 8px solid var(--paper);
  border-bottom: 8px solid transparent;
}

.bubble .time {
  display: block;
  margin-top: 0.1rem;
  color: #667781;
  font-size: 0.6875rem;
  text-align: right;
}

.replies {
  display: grid;
  gap: 3px;
  margin-top: 3px;
}

.replies span {
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 0.5px rgb(11 20 26 / 13%);
  color: var(--wa-green);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

/* Sections : le titre dans la colonne de gauche, comme une note dans la marge */

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section h2 {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.split > :last-child {
  margin-top: 1.5rem;
}

.promise {
  background: var(--band);
}

.promise p {
  max-width: 40rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.55;
}

/* Étapes numérotées dans la marge rouge du cahier */
.steps {
  --numbers: 3rem;
  display: grid;
  gap: 2rem;
  max-width: 44rem;
  margin-left: var(--numbers);
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 2px solid var(--margin-red);
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: -0.3rem;
  right: calc(100% + 1.5rem + 2px + 0.8rem);
  color: var(--ink);
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

.steps h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}

.steps p {
  max-width: 38rem;
  margin-top: 0.35rem;
}

.facts {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
  padding-left: 1.25rem;
}

.facts li::marker {
  color: var(--ink);
}

.contact {
  display: grid;
  gap: 0.35rem;
  font-size: 1.125rem;
}

.contact a {
  font-weight: 600;
}

.legal dl {
  display: grid;
  gap: 0.2rem 1.5rem;
}

.legal dt {
  color: var(--muted);
  font-size: 0.9375rem;
}

.legal dd {
  margin: 0 0 0.75rem;
}

.legal .note {
  max-width: 44rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.privacy {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
}

.site-footer p {
  padding-block: 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

@media (min-width: 40rem) {
  .cta {
    justify-items: start;
  }

  .cta-button {
    padding-inline: 1.75rem;
  }

  .legal dl {
    grid-template-columns: 13rem minmax(0, 1fr);
  }

  .legal dt,
  .legal dd {
    padding-block: 0.3rem;
  }

  .legal dd {
    margin-bottom: 0;
  }
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 4.5rem;
  }

  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    align-items: start;
  }

  .split > :last-child {
    margin-top: 0;
  }
}

@media (max-width: 30rem) {
  .chat {
    right: -0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .chat {
    animation: none;
  }
}
