/* Palette et typographie reprises de la page de présentation (marketing) de
   Devisti, pour que l'application ait le même look — voir aussi le logo en
   dégradé violet repris dans base.html. */
:root {
  --ink: #0f172a;
  --ink-soft: #64748b;
  --paper: #faf9fc;
  --panel: #ffffff;
  --violet: #6d28d9;
  --violet-bright: #7c3aed;
  --violet-soft: #a78bfa;
  --violet-tint: #f1ecfc;
  --verified: #166b4e;
  --vert: #166b4e;
  --vert-tint: #dcfce7;
  --rouge: #b91c1c;
  --rouge-tint: #fee2e2;
  --jaune-tint: #fef3c7;
  --jaune-texte: #92400e;
  --line: #e6e1f5;
  --lien: #6d28d9;
  --violet-texte: #6d28d9;
  --sans: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f0fa; --ink-soft: #b7b0cc; --paper: #150f26; --panel: #1e1836;
    --violet-tint: #2b2147; --line: #332a52;
    --vert-tint: #133b2c; --rouge-tint: #3a1414; --jaune-tint: #3a2e0f; --jaune-texte: #f5d38a;
    --rouge: #fca5a5; --vert: #86efac; --lien: #c4b5fd; --violet-texte: #c4b5fd;
  }
}

/* Rétro-compatibilité : anciens noms de variables utilisés ailleurs. */
:root { --texte: var(--ink); --gris: var(--ink-soft); --bordure: var(--line); --fond: var(--paper); --violet-clair: var(--violet-tint); }

* { box-sizing: border-box; }
/* Ancres (#logo, #suppression...) : ne pas passer sous la barre de navigation fixe. */
html { scroll-padding-top: 96px; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo { font-family: var(--display); letter-spacing: -0.01em; }

/* Liens du contenu : violet lisible sur les deux thèmes (le bleu par défaut
   du navigateur était quasi invisible sur fond sombre). */
a { color: var(--lien); }
a:hover { color: var(--violet-bright); }

header {
  position: sticky; top: 0; z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  min-height: 72px;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

header .logo {
  display: flex; align-items: center; gap: 11px;
  font-weight: 700; font-size: 1.4rem; color: var(--ink); text-decoration: none;
}
header .logo .mark { width: 30px; height: 32px; flex-shrink: 0; display: block; }
header .logo .mark svg { width: 100%; height: 100%; display: block; }

header nav { display: flex; align-items: center; gap: 32px; }
header nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 1rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
header nav a:hover { color: var(--ink); }
/* Page en cours : repère discret sous le lien. */
header nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--violet-soft); }
header nav a.bouton { padding: 9px 18px; border-bottom: none; color: #fff; margin-top: 0; }
header nav .court { display: none; }

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
main.large { max-width: 1080px; }

h1 { font-size: 1.7rem; font-weight: 600; margin-bottom: 8px; }
h2 { font-size: 1.25rem; font-weight: 600; margin-top: 32px; }
p.sous-titre { color: var(--ink-soft); margin-top: 0; }

.carte {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  margin-bottom: 20px;
}

label { display: block; font-size: 0.9rem; font-weight: 600; margin: 14px 0 4px; }
label .optionnel { font-weight: 400; color: var(--ink-soft); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=url], input[type=tel], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--panel);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--violet-bright); outline-offset: 1px; }
textarea { min-height: 160px; resize: vertical; }
small.aide { display: block; color: var(--ink-soft); margin-top: 3px; font-size: 0.82rem; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

button, .bouton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--violet);
  color: #fff;
  border: 1px solid transparent;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 18px;
}
button:hover, .bouton:hover { background: var(--violet-bright); }
button:disabled { opacity: 0.75; cursor: default; }
.bouton.secondaire { background: var(--panel); color: var(--violet); border: 1px solid var(--line); }
.bouton.secondaire:hover { background: var(--violet-tint); border-color: var(--violet); }

/* Petit indicateur de chargement (spinner) pour les actions qui prennent
   quelques secondes, ex. l'analyse d'un email par l'IA. */
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.message { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.message.erreur { background: var(--rouge-tint); color: var(--rouge); }
.message.ok { background: var(--vert-tint); color: var(--vert); }
.message.info { background: var(--violet-tint); color: var(--violet-texte); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge.actif { background: var(--vert-tint); color: var(--vert); }
.badge.inactif { background: var(--rouge-tint); color: var(--rouge); }
.badge.brouillon { background: var(--jaune-tint); color: var(--jaune-texte); }
.badge.exporte { background: var(--vert-tint); color: var(--vert); }
.badge.alerte-critique { background: var(--rouge-tint); color: var(--rouge); margin-left: 6px; }
.badge.alerte-mineure { background: var(--jaune-tint); color: var(--jaune-texte); margin-left: 6px; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { color: var(--ink-soft); font-weight: 500; font-size: 0.8rem; }
td input[type=number] { width: 100px; }

.liste-devis a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.liste-devis a:hover { color: var(--violet-texte); }
.liste-devis .meta { color: var(--ink-soft); font-size: 0.85rem; }

/* Points à vérifier : ambre (attention), rouge clair pour les critiques ;
   contraste > 7:1 sur les deux thèmes (le violet sur fond sombre était à 2,4:1). */
.alerte-champ { color: var(--jaune-texte); font-size: 0.86rem; margin: 4px 0; }
.alerte-critique-texte { color: var(--rouge); font-weight: 500; font-size: 0.9rem; margin: 4px 0; }

.hero {
  text-align: center;
  padding: 60px 0 40px;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); max-width: 18ch; margin-left: auto; margin-right: auto; }
.hero p { color: var(--ink-soft); font-size: 1.1rem; max-width: 560px; margin: 12px auto 28px; }

/* ---- carte de formule d'abonnement (même style que la page de présentation) ---- */
.plan-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 28px;
  background: var(--panel); position: relative; max-width: 360px;
}
.plan-card.actif, .plan-card.populaire { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.badge-pop {
  position: absolute; top: -13px; left: 24px; background: var(--violet); color: #fff;
  font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
}
.plan-name { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 6px 0 2px; }
.plan-desc { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; }
.plan-price { font-family: var(--display); font-weight: 700; font-size: 32px; margin: 0 0 20px; }
.plan-price span { font-family: var(--sans); font-weight: 400; font-size: 14px; color: var(--ink-soft); }
.plan-features { list-style: none; margin: 0 0 22px; padding: 0; font-size: 14.5px; color: var(--ink-soft); }
.plan-features li { padding: 7px 0 7px 22px; border-top: 1px solid var(--line); position: relative; }
.plan-features li:first-child { border-top: none; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--verified); font-weight: 600; }

/* ---- page d'accueil (landing) ---- */
main.large .hero { padding-top: 24px; text-align: left; }
main.large .hero h1 { text-align: left; margin-left: 0; max-width: 15ch; }
main.large .hero p { text-align: left; margin-left: 0; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.cta-note { font-size: 14px; color: var(--ink-soft); margin-top: 10px; }

.demo { margin-top: 48px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; }
.demo-col { padding: 26px; }
.demo-col + .demo-col { border-left: 1px solid var(--line); }
.demo-label { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.demo-email { font-size: 14px; line-height: 1.75; color: var(--ink-soft); white-space: pre-wrap; }
.demo-email mark { background: var(--violet-tint); color: var(--violet); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.devis-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.devis-head strong { font-family: var(--display); font-size: 16px; }
.devis-head span { font-size: 13px; color: var(--ink-soft); }
table.devis { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 0; }
table.devis th, table.devis td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.a-completer { color: var(--violet-texte); font-style: italic; }
.alerte-note { margin-top: 14px; font-size: 13px; color: var(--verified); display: flex; gap: 8px; align-items: flex-start; }

section.bloc { padding: 56px 0; border-top: 1px solid var(--line); }
.lead-p { color: var(--ink-soft); max-width: 56ch; margin: 0 0 36px; font-size: 16px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.step-num { font-family: var(--display); font-size: 36px; color: var(--violet-soft); font-weight: 700; line-height: 1; margin-bottom: 10px; }
.step h3 { font-family: var(--display); font-size: 17px; margin: 0 0 6px; font-weight: 600; }
.step p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; }
.principle { display: flex; gap: 14px; }
.principle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--verified); margin-top: 8px; flex-shrink: 0; }
.principle h3 { font-size: 15.5px; margin: 0 0 4px; font-weight: 600; }
.principle p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* padding-top : place pour les badges (« Populaire », « Formule actuelle »)
   qui débordent de 13 px au-dessus de leur carte. */
.pricing-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: stretch; padding-top: 16px; }
.pricing-grid.quatre { grid-template-columns: repeat(4, 1fr); }
.badge-pop.actif { left: auto; right: 24px; background: var(--verified); }
.plan-cta { margin-top: auto; }
.plan-cta button, .plan-cta .bouton { width: 100%; }
/* Boutons des cartes : une seule ligne, centrés, même hauteur partout — un
   libellé qui passe sur deux lignes décalait sinon le bouton de sa carte. */
.pricing-grid .plan-cta button, .pricing-grid .plan-cta .bouton {
  justify-content: center; white-space: nowrap; padding-left: 10px; padding-right: 10px;
  height: 44px; padding-top: 0; padding-bottom: 0; line-height: 1;
}
.pricing-grid .plan-cta form { margin: 0; }
.plan-cta button:disabled { opacity: 0.55; cursor: default; }
.case-a-cocher { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 18px; font-size: 0.92rem; }
.case-a-cocher input { width: auto; margin: 3px 0 0; flex-shrink: 0; }

/* ---- pied de page et pages légales ---- */
.liens-legaux { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.85rem; margin-top: 18px; }
.liens-legaux a { color: var(--ink-soft); text-decoration: none; }
.liens-legaux a:hover { color: var(--ink); text-decoration: underline; }
.pied-app { border-top: 1px solid var(--line); padding: 8px 24px 32px; }
.pied-app .liens-legaux { max-width: 1080px; margin: 18px auto 0; justify-content: center; }
.page-legale { max-width: 720px; }
.page-legale h2 { font-size: 1.1rem; margin-top: 30px; }
.page-legale p, .page-legale li { color: var(--ink); line-height: 1.7; font-size: 0.97rem; }
.page-legale ul { padding-left: 20px; }
.page-legale .maj { color: var(--ink-soft); font-size: 0.88rem; margin-top: -4px; }
.a-completer-legal {
  background: var(--jaune-tint); color: var(--jaune-texte); padding: 1px 6px;
  border-radius: 4px; font-size: 0.9em; font-style: italic;
}

/* ---- logo de l'entreprise ---- */
.logo-bloc { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start; }
.logo-apercu {
  height: 100px; border: 1px dashed var(--line); border-radius: 10px; display: flex;
  align-items: center; justify-content: center; padding: 10px;
  /* fond clair, comme la page du PDF : on juge le logo tel qu'il sera imprimé */
  background: #fff; color: #64748b; font-size: 0.85rem;
}
.logo-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; }
input[type=file] { display: block; margin: 6px 0; font-size: 0.9rem; color: var(--ink-soft); }
@media (max-width: 600px) { .logo-bloc { grid-template-columns: 1fr; } }

/* ---- édition des lignes d'un devis ---- */
.table-lignes-wrap { overflow-x: auto; margin: 0 -4px; }
.table-lignes { width: 100%; min-width: 760px; border-collapse: collapse; }
.table-lignes th { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); text-align: left; padding: 6px 4px; }
.table-lignes td { padding: 4px; vertical-align: middle; }
.table-lignes input { margin: 0; padding: 7px 8px; font-size: 0.9rem; width: 100%; }
.table-lignes .c-ref { width: 110px; }
.table-lignes .c-qte { width: 80px; }
.table-lignes .c-unite { width: 95px; }
.table-lignes .c-prix { width: 120px; }
.table-lignes .c-total { width: 105px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-lignes .c-suppr { width: 36px; }
.retirer-ligne {
  margin: 0; padding: 0; width: 30px; height: 30px; justify-content: center;
  background: none; border: 1px solid var(--line); color: var(--ink-soft); font-size: 1.1rem; line-height: 1;
}
.retirer-ligne:hover { background: var(--rouge-tint); color: var(--rouge); border-color: var(--rouge); }
.actions-lignes { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.actions-lignes button, .actions-lignes .bouton { margin-top: 0; }
.bouton-danger { background: none; color: var(--rouge); border: 1px solid var(--rouge); }
.bouton-danger:hover { background: var(--rouge-tint); }
.zone-suppression { border-color: color-mix(in srgb, var(--rouge) 35%, var(--line)); }

.compteur-ligne { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.compteur { white-space: nowrap; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.compteur.depasse { color: var(--rouge); font-weight: 600; }
.lien-discret {
  background: none; border: none; color: var(--ink-soft); font-size: 13.5px;
  text-decoration: underline; cursor: pointer; padding: 4px; font-family: var(--sans);
}
.lien-discret:hover { color: var(--ink); }
@media (max-width: 900px) {
  .pricing-grid, .pricing-grid.quatre { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pricing-grid, .pricing-grid.quatre { grid-template-columns: 1fr; }
}
.pricing-grid .plan-card { max-width: none; padding: 22px 18px; display: flex; flex-direction: column; }
.pricing-grid .plan-name { font-size: 16.5px; }
.pricing-grid .plan-price { font-size: 26px; }
/* Hauteurs réservées identiques sur toutes les cartes : le volume peut passer
   sur deux lignes en colonnes étroites, et la liste reçoit la même hauteur
   minimale partout — les séparateurs et les boutons restent alignés. */
.pricing-grid .plan-volume { min-height: 3.2em; }
/* Hauteur de ligne fixe pour le prix : « Sur mesure » (plus petit, sans
   retour à la ligne) occupe exactement la même hauteur que « 79 € ». */
.pricing-grid .plan-price { white-space: nowrap; line-height: 36px; height: 36px; }
.pricing-grid .plan-price.sur-mesure { font-size: 21px; }
.pricing-grid .plan-features { flex-grow: 1; min-height: 132px; }
.plan-volume { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }
.pricing-note { margin-top: 22px; font-size: 13.5px; color: var(--ink-soft); }
.sectors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.sector-chip { font-size: 13px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); background: var(--panel); }

.pilot {
  background: var(--violet); color: #fff; border-radius: 16px; padding: 44px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center;
}
.pilot h2 { color: #fff; }
.pilot p { color: color-mix(in srgb, #fff 78%, transparent); margin: 0 0 22px; max-width: 48ch; }
.pilot .bouton { background: #fff; color: var(--violet); }
.pilot .bouton:hover { background: var(--violet-tint); }
.pilot-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.pilot-list li { margin-bottom: 8px; }

.site-footer { padding: 36px 0 48px; border-top: 1px solid var(--line); margin-top: 8px; }
.foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.foot-note { font-size: 13px; color: var(--ink-soft); max-width: 60ch; margin: 0; }

:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-col + .demo-col { border-left: none; border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .principles { grid-template-columns: 1fr; }
  .pilot { grid-template-columns: 1fr; padding: 30px 22px; }
}
@media (max-width: 900px) {
  header { padding: 16px 24px; }
  header nav { gap: 22px; }
}
@media (max-width: 600px) {
  /* Le menu passe sous le logo, et défile horizontalement s'il déborde. */
  header { flex-wrap: wrap; row-gap: 10px; padding: 14px 16px 8px; min-height: 0; }
  header .logo { font-size: 1.25rem; }
  header .logo .mark { width: 26px; height: 28px; }
  header nav { width: 100%; gap: 18px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  header nav a { font-size: 0.92rem; flex-shrink: 0; }
  /* Libellés raccourcis sur téléphone (« Entreprise »), pour que tout le menu tienne. */
  header nav .long { display: none; }
  header nav .court { display: inline; }
  main { padding: 28px 16px 60px; }
  .grille-2 { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
}
