/* © 2026 Yoann Crom — Vicious Studio. Logiciel propriétaire, tous droits réservés (LICENSE). Réf. VS-2026-8EFE48 */
/* La refonte de l'onglet 🏷️ Prix (2026-10-14) : petits onglets, une carte par sujet, le gain en direct, une carte par
   moteur IA avec son interrupteur, la barre « Enregistrer » collée en bas. Seulement les couleurs de console.css (le rose
   de Vicious Studio sur noir, le vert « ok », l'orange « alerte », le rouge « erreur ») et leurs teintes. */

/* ---------- Les petits onglets et leurs cartes ---------- */
.prix-puces { margin: 12px 0 14px; }
.prix-point { display: inline-block; width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; background: var(--alerte);
  vertical-align: middle; box-shadow: 0 0 0 3px rgba(245,177,76,.18); }
.prix-carte { gap: 10px; }
#prix-carte-iphones, #prix-carte-regles, #prix-carte-abonnements { max-width: 760px; }
.prix-carte h3 { font-size: 16px; }
.prix-carte .aide { margin: 0; }
.prix-carte .etiquette { margin: 4px 0; }
.prix-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; align-items: start; }

/* ---------- 📱 le gain sur un iPhone ---------- */
.prix-gain { border-radius: var(--rayon); padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--bord);
  display: flex; flex-direction: column; gap: 6px; }
.prix-gain-phrase { font-size: 15.5px; }
.prix-gain.gagne { background: rgba(62,207,142,.08); border-color: rgba(62,207,142,.4); }
.prix-gain.gagne b { color: var(--ok); }
.prix-gain.nul { background: rgba(245,177,76,.08); border-color: rgba(245,177,76,.4); }
.prix-gain.perte { background: rgba(255,93,93,.08); border-color: rgba(255,93,93,.5); }
.prix-gain.perte .prix-gain-phrase { color: var(--erreur); font-weight: 600; }
.barre-gain { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.barre-gain i { display: block; height: 100%; transition: width .25s ease; }
.barre-gain .part-cout { background: var(--tres-doux); }
.barre-gain .part-gain { background: var(--ok); }
.prix-gain.perte .barre-gain .part-cout { background: var(--erreur); }

/* ---------- ⚙️ les montants de recharge, en pastilles ---------- */
.prix-recharges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 6px; }
.prix-montant { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 11px; border-radius: 999px;
  background: rgba(250,5,110,.12); border: 1px solid rgba(250,5,110,.45); font-weight: 600; font-size: 13px; white-space: nowrap; }
.prix-montant.faux { padding-right: 11px; background: rgba(255,93,93,.1); border-color: rgba(255,93,93,.55); color: var(--erreur); }
.prix-montant.sous-mini { background: rgba(245,177,76,.1); border-color: rgba(245,177,76,.6); color: var(--alerte); }
.prix-montant-x { background: none; border: 0; padding: 0 6px; border-radius: 999px; color: var(--doux); font-size: 12px; line-height: 18px; }
.prix-montant-x:hover { background: var(--surface-3); color: var(--texte); }
.prix-conseil { color: var(--alerte); font-size: 12.5px; font-weight: 600; }
.prix-carte .etiquette .petit-texte { font-weight: 400; }
.prix-carte .etiquette .aide { display: inline; margin: 0; }

/* ---------- 🤖 une carte par moteur ---------- */
.prix-moteurs-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 12px; }
.carte-moteur { background: var(--surface-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; transition: border-color .15s; }
.carte-moteur.a-perte { border-color: rgba(255,93,93,.65); }
.tete-moteur { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emoji-moteur { font-size: 20px; line-height: 1; }
.nom-moteur { font-size: 15px; margin-right: auto; }
.marge-moteur { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--doux); font-weight: 600; }
.marge-moteur .petit-texte { font-weight: 400; }
.qualites-moteur { width: 100%; border-collapse: collapse; font-size: 13px; }
.qualites-moteur th { text-align: left; color: var(--tres-doux); font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: .3px; padding: 4px 6px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.qualites-moteur td { padding: 6px; border-bottom: 1px solid var(--bord); white-space: nowrap; vertical-align: middle; }
.qualites-moteur tr:last-child td { border-bottom: 0; }
.qualites-moteur tr.sous-cout td { background: rgba(255,93,93,.08); }
.carte-moteur:not(.fixe-ouvert) .col-fixe { display: none; }
.carte-moteur.fixe-ouvert [data-prix-fixe] { border-color: var(--accent); }
.pied-moteur { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.moteur-ferme { display: none; margin: 0; color: var(--tres-doux); font-size: 12.5px; font-weight: 600; }
.carte-moteur:has(.interrupteur input:not(:checked)) .moteur-ferme { display: block; }
.carte-moteur:has(.interrupteur input:not(:checked)) .qualites-moteur { opacity: .55; }
#prix-moteurs { margin-top: 4px; }
.prix-textes-carte { background: var(--surface-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px; margin-top: 6px; }
.prix-textes-carte h3 { font-size: 15px; margin: 0 0 4px; }
.prix-textes-carte .etiquette { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--bord); font-weight: 400; color: var(--texte); }
.prix-textes-carte .etiquette:last-child { border-bottom: 0; }
.prix-textes-carte .etiquette span { white-space: nowrap; }

/* L'interrupteur « ouvert aux agences » : une case à cocher, dessinée en glissière */
.interrupteur { position: relative; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.glissiere { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--bord); transition: background .15s, border-color .15s; }
.glissiere::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--tres-doux); transition: transform .15s, background .15s; }
.interrupteur input:checked + .glissiere { background: rgba(62,207,142,.22); border-color: var(--ok); }
.interrupteur input:checked + .glissiere::after { transform: translateX(16px); background: var(--ok); }
.interrupteur input:focus-visible + .glissiere { outline: 2px solid var(--accent); outline-offset: 2px; }
.interrupteur-oui { color: var(--ok); }
.interrupteur-non { color: var(--tres-doux); }
.interrupteur input:checked ~ .interrupteur-non, .interrupteur input:not(:checked) ~ .interrupteur-oui { display: none; }

/* ---------- 💳 les abonnements ---------- */
#table-prix-abonnements td { vertical-align: top; }
/* le prix par mois passe à la ligne au lieu d'élargir sa colonne : les champs gardent leur largeur pendant la saisie
   (2026-10-14, revue : « plus cher que le mois seul » écrasait les champs d'1 mois à 63 px et coupait le nom des formules) */
#table-prix-abonnements .champ { width: 120px; }
#table-prix-abonnements td:first-child { white-space: nowrap; }
#table-prix-abonnements [data-par-mois] { margin-top: 4px; white-space: normal; }
#table-prix-abonnements [data-par-mois] span { white-space: nowrap; }
.prix-eco { color: var(--ok); font-weight: 600; }

/* ---------- La barre « Enregistrer », collée en bas tant qu'un prix attend ---------- */
.prix-barre { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.55); animation: prix-monte .2s ease-out; }
.prix-barre-texte { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.prix-barre p { margin: 0; }
.prix-barre .erreur { min-height: 0; font-weight: 600; }
.prix-barre .erreur:empty { display: none; }
.prix-barre .prix-aller { padding: 0; font-weight: 600; }
.prix-barre-boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.prix-barre-conseils { display: flex; flex-direction: column; gap: 2px; }
.prix-bravo { color: var(--ok); font-weight: 600; }
.prix-bravo.prix-attention { color: var(--alerte); }
/* sur 📱, 💳 et ⚙️, la barre a la largeur de la carte : le bouton reste près des champs qu'il enregistre (2026-10-14) */
#vue-prix:has(#prix-carte-ia[hidden]) .prix-barre { max-width: 760px; }
.prix-barre.bravo { border-color: var(--ok); background: linear-gradient(rgba(62,207,142,.14), rgba(62,207,142,.14)), var(--surface-3); }
#prix-barre .bouton:disabled { opacity: .6; cursor: progress; }

/* La petite fête d'un enregistrement réussi : la carte et son petit onglet s'allument en vert un instant */
.prix-fete { animation: prix-fete 1.3s ease-out; }
@keyframes prix-fete {
  0% { box-shadow: 0 0 0 0 rgba(62,207,142,.7); border-color: var(--ok); }
  60% { border-color: var(--ok); }
  100% { box-shadow: 0 0 0 16px rgba(62,207,142,0); }
}
@keyframes prix-monte { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .prix-barre, .prix-fete, .barre-gain i, .glissiere, .glissiere::after { animation: none; transition: none; }
}

/* Les petites lignes qui portent un chiffre ou une règle (prix par mois, ton coût, « Les agences verront », « laisse
   vide = 50 % »…) : en --doux, lisible sur les cartes (2026-10-14, revue : --tres-doux n'y faisait que 3,6 : 1) */
.prix-carte .petit-texte, .qualites-moteur th, .moteur-ferme { color: var(--doux); }
#prix-ia-taux { margin: 0; }
