/*
  styles.css — feuille de style unique du site Sirako.

  Organisation du fichier (dans l'ordre) :
  1. Variables de marque (couleurs, etc.)
  2. Réinitialisation de base + typographie générale
  3. Navigation + sélecteur de langue
  4. Page d'accueil (hero, pile de signaux, sélecteur, cartes)
  5. Pages dédiées (hero, situation, bénéfices, exemple, bandeau CTA, formulaire)
  6. Pied de page
  7. Responsive (tablette puis mobile)
*/

/* ===================== 1. Variables de marque ===================== */
:root {
  --ink: #23224a;          /* navy — couleur de texte et de fond principal */
  --ink-light: #2c2b57;    /* navy légèrement plus clair, pour les cartes sur fond navy */
  --gold: #ffb930;         /* or — couleur d'action universelle (boutons principaux) */
  --paper: #ffffff;
  --muted: #6f7182;
  --line: #e8e8ef;
  --soft: #f7f7fb;

  /* Couleur d'accent par page dédiée. Chaque page définit ces deux
     variables sur son <body> (voir plus bas, section "page-*"). La home
     et les composants partagés lisent --wedge-accent / --wedge-tint,
     ce qui évite de dupliquer les styles trois fois. */
  --wedge-accent: var(--ink);
  --wedge-tint: var(--soft);
}

/* Couleur propre à chaque page dédiée */
body.page-reliability   { --wedge-accent: #3c5fc4; --wedge-tint: #eef1fb; }
body.page-intelligence  { --wedge-accent: #b5780f; --wedge-tint: #fdf1e2; }
body.page-operations    { --wedge-accent: #1d8f6d; --wedge-tint: #e9f5ef; }

/* ===================== 2. Base ===================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.container { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.accent { color: var(--gold); }

/* ===================== 3. Navigation ===================== */
nav {
  height: 68px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 22px; width: auto; display: block; }
.back-link { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }

/* Icônes (sprite SVG inline, voir en haut de chaque page HTML) */
.icon { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }

/* Sélecteur de langue : trois boutons texte, celui actif est souligné */
.lang-switch { display: flex; align-items: center; gap: 14px; }
.lang-btn {
  background: none;
  border: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  cursor: pointer;
  /* Zone tactile élargie pour rester confortable au doigt sur mobile,
     sans agrandir visuellement le texte lui-même. */
  padding: 12px 8px;
  border-bottom: 2px solid transparent;
}
.lang-btn.active { color: var(--ink); border-bottom-color: var(--gold); }

/* Variante du sélecteur de langue sur fond navy (dans les hero) */
.hero .lang-switch .lang-btn, .wedge-hero .lang-switch .lang-btn { color: rgba(255, 255, 255, 0.55); }
.hero .lang-switch .lang-btn.active, .wedge-hero .lang-switch .lang-btn.active { color: #fff; border-bottom-color: var(--gold); }

/* ===================== 4. Page d'accueil ===================== */
.hero { background: var(--ink); padding: 24px 0 44px; }
.hero .nav-inner { margin-bottom: 32px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}
.hero-line {
  color: #fff;
  font-weight: 500;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.35;
  margin: 0 0 6px;
}
.hero-subtitle {
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
  line-height: 1.6;
  max-width: 46ch;
  margin: 16px 0 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: var(--gold);
  color: var(--ink);
}
.btn.on-wedge { background: #fff; color: var(--wedge-accent); }
.btn.solid-wedge { background: var(--wedge-accent); color: #fff; }

/* Pile de signaux animée, avec le nœud "vos paiements" au-dessus */
.signal-node { display: flex; flex-direction: column; align-items: center; margin-bottom: 6px; }
.signal-node-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.signal-node-dot .icon { width: 16px; height: 16px; }
.signal-node-label { color: rgba(255, 255, 255, 0.5); font-size: 10.5px; margin-top: 5px; }
.signal-node-line { width: 0; height: 16px; border-left: 1px dashed rgba(255, 255, 255, 0.32); margin-top: 6px; }

.signal-stack { position: relative; height: 140px; }
.signal-card {
  position: absolute; left: 0; right: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ink-light);
  border-left: 3px solid var(--gold);
  transition: top 0.6s ease, transform 0.6s ease, opacity 0.6s ease;
}
.signal-card.pos-0 { top: 0;   transform: scale(1)    translateX(0);   opacity: 1;    z-index: 3; }
.signal-card.pos-1 { top: 20px; transform: scale(0.95) translateX(6px); opacity: 0.5;  z-index: 2; }
.signal-card.pos-2 { top: 40px; transform: scale(0.9)  translateX(12px); opacity: 0.22; z-index: 1; }
.signal-head { display: flex; align-items: center; gap: 8px; margin: 0 0 3px; }
.signal-card .signal-title { color: #fff; font-size: 12px; font-weight: 500; margin: 0; }
.signal-card .signal-sub { color: rgba(255, 255, 255, 0.6); font-size: 10.5px; margin: 0; padding-left: 24px; }
.signal-card.pos-1 .signal-sub,
.signal-card.pos-2 .signal-sub { display: none; } /* cartes non actives : titre seul, pour éviter la superposition */

/* Sélecteur "Qu'aimeriez-vous améliorer ?" */
.selector { background: var(--soft); padding: 40px 0; }
.selector-heading { text-align: center; margin-bottom: 26px; }
.kicker { color: #8a89a3; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.selector-heading h2 { font-size: 20px; font-weight: 500; margin: 0; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wedge-card {
  border-radius: 12px;
  padding: 26px 22px 22px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.15s ease;
}
.wedge-card:hover { transform: translateY(-3px); }
.wedge-card.tint-reliability  { background: #eef1fb; }
.wedge-card.tint-intelligence { background: #fdf1e2; }
.wedge-card.tint-operations   { background: #e9f5ef; }
.wedge-card .wedge-card-kicker { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 12px; }
.wedge-card.tint-reliability  .wedge-card-kicker, .wedge-card.tint-reliability  .wedge-card-link { color: #3c5fc4; }
.wedge-card.tint-intelligence .wedge-card-kicker, .wedge-card.tint-intelligence .wedge-card-link { color: #b5780f; }
.wedge-card.tint-operations   .wedge-card-kicker, .wedge-card.tint-operations   .wedge-card-link { color: #1d8f6d; }
.wedge-card .wedge-card-phrase { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.5; margin: 0 0 16px; }
.wedge-card .wedge-card-link { font-size: 12.5px; font-weight: 600; margin-top: auto; }

.dashboard-line {
  text-align: center;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 48ch;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ===================== 5. Pages dédiées ===================== */
.wedge-hero { background: var(--ink); padding: 22px 0 34px; }
.wedge-hero .nav-inner { margin-bottom: 26px; }
.wedge-hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.wedge-hero-kicker { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 10px; }
.wedge-headline { color: #fff; font-weight: 500; font-size: clamp(21px, 2.8vw, 27px); line-height: 1.4; margin: 0 0 12px; }
.wedge-subtitle { color: rgba(255, 255, 255, 0.65); font-size: 13.5px; line-height: 1.6; max-width: 42ch; margin: 0 0 20px; }

.wedge-preview {
  background: var(--ink-light);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 15px 16px;
}
.wedge-preview .signal-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.wedge-preview .signal-title { color: #fff; font-size: 12.5px; font-weight: 500; margin: 0; }
.wedge-preview .signal-sub { color: rgba(255, 255, 255, 0.6); font-size: 11px; margin: 0 0 10px; padding-left: 30px; }
.wedge-preview .signal-tag {
  display: inline-block; background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6); font-size: 10.5px; padding: 3px 9px; border-radius: 5px;
  margin-left: 30px;
}

/* Couleur d'icône (plus claire, pour rester lisible sur le fond navy des cartes) */
body.page-reliability  .wedge-preview .icon { color: #f0997b; }
body.page-intelligence .wedge-preview .icon { color: #f0c775; }
body.page-operations   .wedge-preview .icon { color: #9fe1cb; }

.section { padding: 44px 0; }
.section.soft { background: var(--soft); }
.section-text { color: #3a3960; font-size: 14.5px; line-height: 1.7; max-width: 64ch; }
.section-text p { margin: 0 0 8px; }
.section-text p:last-child { margin-bottom: 0; }

.benefit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.benefit { border-left: 3px solid var(--wedge-accent); padding-left: 14px; }
.benefit .icon { color: var(--wedge-accent); margin-bottom: 10px; }
.benefit p { color: var(--ink); font-size: 13.5px; font-weight: 500; line-height: 1.5; margin: 0; }

.example-card {
  background: var(--wedge-tint);
  border-radius: 12px;
  padding: 20px 22px;
  max-width: 460px;
}
.example-card .example-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.example-card .icon { color: var(--wedge-accent); }
.example-card h3 { font-size: 14px; font-weight: 600; margin: 0; color: var(--ink); }
.example-card p { color: #5b5a78; font-size: 13px; line-height: 1.6; margin: 0; padding-left: 30px; }
.example-card .example-note { color: var(--wedge-accent); font-size: 12px; font-weight: 600; margin-top: 10px; padding-left: 30px; display: block; }

.cta-band { background: var(--wedge-accent); padding: 40px 0; text-align: center; }
.cta-band h2 { color: #fff; font-size: 18px; font-weight: 500; margin: 0 0 20px; }

.form-section { padding: 40px 0 56px; }
.form-reassurance { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }
.form-card { background: var(--soft); border-radius: 14px; padding: 26px 28px; box-sizing: border-box; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea, .other-input {
  width: 100%; padding: 11px 12px; border: 1px solid #d9d9e3; border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff; box-sizing: border-box;
  /* 16px : en-dessous, Safari iOS zoome automatiquement la page au focus
     du champ — un désagrément classique et facile à éviter. */
  font-size: 16px;
}
.field textarea { min-height: 90px; resize: vertical; }
.other-input { margin-top: 2px; }
.field-check { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--muted); }
.field-check input { width: auto; margin-top: 3px; }
.form-submit { background: var(--wedge-accent); color: #fff; }
.form-message { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--wedge-accent); display: none; }

/* Visible seulement par les lecteurs d'écran — pour donner un nom
   accessible à un champ sans alourdir visuellement la page (ex. le
   champ "Autre", qui a déjà un placeholder explicite à l'écran). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Menu déroulant personnalisé, à la place du <select> natif dont le
   rendu diffère trop d'un navigateur à l'autre. Le <select> d'origine
   reste dans la page (voir app.js) : s'il n'était pas remplacé pour une
   raison ou une autre, le formulaire resterait pleinement utilisable. */
.custom-select-wrapper { position: relative; }
.custom-select-wrapper select {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.custom-select-trigger {
  width: 100%; padding: 11px 36px 11px 12px; border: 1px solid #d9d9e3; border-radius: 8px;
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; box-sizing: border-box;
  display: flex; align-items: center; text-align: left; cursor: pointer; position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.custom-select-trigger.placeholder { color: var(--muted); }
.custom-select-trigger:focus, .custom-select-trigger.open {
  outline: none; border-color: var(--wedge-accent); box-shadow: 0 0 0 3px rgba(60, 95, 196, 0.12);
}
.custom-select-trigger::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 10px; height: 7px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2323224A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: contain; transform: translateY(-50%);
  transition: transform 0.2s ease;
}
.custom-select-trigger.open::after { transform: translateY(-50%) rotate(180deg); }
.custom-select-options {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff;
  border: 1px solid #d9d9e3; border-radius: 8px; box-shadow: 0 8px 24px rgba(35, 34, 74, 0.14);
  max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  z-index: 100; display: none; padding: 4px 0;
}
.custom-select-options.open { display: block; }
.custom-select-option { padding: 10px 14px; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.custom-select-option.focused { background: var(--soft); }
.custom-select-option.selected { background: var(--wedge-tint); color: var(--wedge-accent); font-weight: 600; }

/* Champ anti-spam invisible : un vrai visiteur ne le voit jamais et ne
   peut pas y accéder au clavier ; seuls les robots de formulaire, qui
   remplissent tous les champs sans distinction, s'y font piéger. */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ===================== 6. Pied de page ===================== */
.footer { padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Toast : confirmation temporaire après l'envoi d'un formulaire, en plus
   du message fixe sous le bouton (qui reste utile pour les lecteurs
   d'écran et pour quiconque revient sur la page plus tard). */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background: var(--wedge-accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  max-width: calc(100% - 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Bannière de suggestion de langue, en haut de page (pas de redirection
   automatique, uniquement une proposition discrète et fermable). */
.lang-suggest {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12.5px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  text-align: center;
}
.lang-suggest a { color: var(--ink); font-weight: 600; text-decoration: underline; }
.lang-suggest button {
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--muted); line-height: 1; padding: 0 4px;
}

/* ===================== 7. Responsive ===================== */

/* Tablette : les mises en page à deux colonnes passent en une colonne */
@media (max-width: 900px) {
  .hero-grid, .wedge-hero-grid, .card-grid, .benefit-grid, .form-grid {
    grid-template-columns: 1fr;
  }
  .signal-stack { margin-top: 20px; }
}

/* Mobile : on resserre les espacements et on laisse les titres du hero
   revenir à la ligne librement (sur desktop ils tiennent sur une seule
   ligne grâce à la place disponible ; ce n'est plus garanti ni nécessaire
   sur un petit écran). */
@media (max-width: 600px) {
  .container { width: calc(100% - 28px); }
  .hero, .wedge-hero { padding-top: 18px; }
  .hero-line { font-size: 24px; white-space: normal; }
  .wedge-headline { font-size: 20px; }
  .section, .form-section { padding: 32px 0; }
  .cta-band { padding: 30px 0; }
  .form-card { padding: 20px; }
  .footer-inner { flex-direction: column; gap: 6px; }

  /* Une seule carte de signal visible à la fois sur mobile : l'effet de
     pile avec décalage/échelle perd son sens sur un petit écran, un
     simple fondu enchaîné reste lisible et moins encombré. */
  .signal-stack { height: 90px; }
  .signal-card.pos-0 { top: 0; transform: none; opacity: 1; z-index: 3; }
  .signal-card.pos-1, .signal-card.pos-2 { top: 0; transform: none; opacity: 0; z-index: 1; }
}

/* Sur les écrans assez larges seulement : verrouiller chaque ligne du
   hero de la home sur une seule ligne, y compris traduite en EN/ES. */
@media (min-width: 601px) {
  .hero-line { white-space: nowrap; }
}
