/* ==========================================================================
   FABRIQUE DE FORMATION — complète fabrique.css (cartes, segments, carte encre)
   Idée de mise en page : le questionnaire à gauche, et à droite la formation
   qui se dessine en direct, jour par jour, comme un calendrier en mosaïque.
   ========================================================================== */

.form-kin .ln { white-space: nowrap; }
@media (max-width: 520px) { .form-kin { font-size: clamp(3rem, 15vw, 4.6rem); } }
.form-promise { margin-top: 14px; max-width: 46ch; color: var(--muted); font-size: 1rem; }

/* Carte « rêve » : un liseré orange pour dire « on commence par là » */
.fcard--dream { box-shadow: var(--shadow), inset 0 0 0 2px var(--signal); }

/* ---------- Dictée ---------- */
.micwrap { position: relative; }
.micwrap textarea { padding-bottom: 46px; }
.mic {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px;
  border: 0; cursor: pointer; padding: 6px 11px 6px 9px; border-radius: 999px;
  background: var(--card); color: var(--ink); font-size: .8rem; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.mic svg { width: 16px; height: 16px; color: var(--signal); }
.mic:hover { box-shadow: 0 0 0 1.5px var(--signal); }
.mic[aria-pressed="true"] { background: var(--signal); color: var(--on-signal); }
.mic[aria-pressed="true"] svg { color: var(--on-signal); animation: micpulse 1.1s ease-in-out infinite; }
@keyframes micpulse { 50% { transform: scale(1.25); } }
.mic-hint { margin: -4px 2px 0; }

/* ---------- Domaines ---------- */
.domtools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 14px; }
.domtools input[type=search] { flex: 1 1 260px; width: auto; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1.5px solid transparent; border-radius: 14px; padding: 11px 14px; }
.domtools input[type=search]:focus { outline: none; border-color: var(--signal); }
.doms { display: grid; gap: 14px; max-height: 560px; overflow: auto; padding: 2px 6px 2px 2px; margin-right: -6px; scrollbar-width: thin; }
.domgrp[hidden] { display: none; }
.domgrp__t { display: flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.domgrp__t i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.domgrp__list { display: flex; flex-wrap: wrap; gap: 6px; }
.dom {
  --dc: var(--signal);
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; border: 0;
  padding: 7px 12px 7px 10px; border-radius: 999px; background: var(--bg); color: var(--ink);
  font-size: .86rem; font-weight: 600; transition: background-color .15s, color .15s, box-shadow .15s;
}
.dom[hidden] { display: none; }
.dom i { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); flex: none; }
.dom:hover { box-shadow: inset 0 0 0 1.5px var(--dc); }
.dom[aria-pressed="true"] { background: color-mix(in srgb, var(--dc) 16%, var(--card)); box-shadow: inset 0 0 0 1.5px var(--dc); }
.dom.is-prio { background: var(--dc); color: #fff; box-shadow: none; }
.dom.is-prio i { background: #fff; width: 10px; height: 10px; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border-radius: 0; }
.addrow { display: flex; gap: 8px; }
.addrow input { flex: 1; }

/* ---------- Rythme ---------- */
.frow--chips, .frow--segs { gap: 0 20px; }
.seg--days button { font: 900 1.25rem/1 var(--f-disp); font-stretch: 90%; font-variation-settings: "wdth" 90; padding: 12px 18px; min-width: 64px; }
.seg--days button::after { content: " j"; font: 600 .78rem var(--f-body); }
.seg--stack { display: grid; width: 100%; }
.seg--stack button { text-align: left; }
.fcard input.fdate { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1.5px solid transparent; border-radius: 14px; padding: 11px 14px; color-scheme: light dark; }
#faithMore[hidden] { display: none; }

/* ---------- Boîte à outils ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tool {
  position: relative; text-align: left; cursor: pointer; border: 0; border-radius: 16px; padding: 12px 40px 12px 14px;
  background: var(--bg); color: var(--muted); transition: background-color .15s, color .15s;
}
.tool b { display: block; color: var(--ink); font-size: .92rem; font-weight: 700; line-height: 1.2; }
.tool small { display: block; font-size: .78rem; line-height: 1.35; margin-top: 3px; }
.tool::after { content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--card); }
.tool[aria-pressed="true"] { background: color-mix(in srgb, var(--signal) 10%, var(--card)); box-shadow: inset 0 0 0 1.5px var(--signal); }
.tool[aria-pressed="true"]::after { background: var(--signal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/12px no-repeat; box-shadow: none; }

/* ---------- La formation en direct ---------- */
@media (min-width: 1240px) { .recipe__card { overflow-y: auto; scrollbar-width: thin; } }
.form-who { font-size: clamp(2rem, 1.5rem + 1.4vw, 2.8rem); }
.recipe__dream { font-size: .95rem; line-height: 1.45; font-style: italic; color: color-mix(in srgb, var(--bg) 78%, transparent); }

.gauge { display: grid; gap: 7px; }
.gauge__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .86rem; color: color-mix(in srgb, var(--bg) 75%, transparent); }
.gauge__top b { font: 900 1.4rem/1 var(--f-disp); font-stretch: 90%; font-variation-settings: "wdth" 90; color: var(--signal); font-variant-numeric: tabular-nums; }
.gauge__track { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 14%, transparent); overflow: hidden; }
.gauge__track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--c-foi), var(--c-culture), var(--c-planete), var(--signal)); transition: width .5s cubic-bezier(.2,.8,.2,1); }

.mosaic-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin-top: 4px; }
.mosaic-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; font-size: .64rem; font-weight: 700; color: color-mix(in srgb, var(--bg) 50%, transparent); }
.mosaic-days span { display: flex; align-items: center; }
.mosaic { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); grid-auto-columns: minmax(0, 30px); gap: 4px; overflow-x: auto; padding: 2px; }
.cell { --dc: color-mix(in srgb, var(--bg) 28%, transparent); aspect-ratio: 1; min-width: 14px; border: 0; padding: 0; border-radius: 5px; cursor: default; background: var(--dc); transition: transform .15s; }
.cell:hover, .cell:focus-visible { transform: scale(1.3); position: relative; z-index: 1; outline: 2px solid var(--bg); outline-offset: 0; }
.cell--void { background: transparent; }
.cell--lesson { animation: pop .35s both; }
.cell--open, .cell--close, .cell--council { background: var(--bg); box-shadow: inset 0 0 0 3px var(--signal); }
.cell--council { background: var(--signal); box-shadow: none; }
.cell--atelier { background: repeating-linear-gradient(135deg, var(--signal) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px var(--signal); }
.cell--pause { background: color-mix(in srgb, var(--bg) 10%, transparent); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cell--lesson { animation: none; } .gauge__track i { transition: none; } }
.cellinfo { min-height: 1.3em; font-size: .82rem; font-weight: 600; color: color-mix(in srgb, var(--bg) 80%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .76rem; color: color-mix(in srgb, var(--bg) 72%, transparent); }
.legend:empty { display: none; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { width: 9px; height: 9px; border-radius: 3px; }
.warn { font-size: .82rem; line-height: 1.4; color: var(--signal); font-weight: 600; }
.warn:empty { display: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px; margin: 2px 0 0; }
.kpis div { background: color-mix(in srgb, var(--bg) 8%, transparent); border-radius: 12px; padding: 8px 6px; text-align: center; }
.kpis dt { font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--bg) 55%, transparent); }
.kpis dd { margin: 3px 0 0; font: 900 1.05rem/1 var(--f-disp); font-stretch: 72%; font-variation-settings: "wdth" 72; font-variant-numeric: tabular-nums; white-space: nowrap; }

.recipe__more { border-radius: 14px; background: color-mix(in srgb, var(--bg) 6%, transparent); }
.recipe__more summary { cursor: pointer; list-style: none; padding: 11px 14px; font-size: .88rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.recipe__more summary::-webkit-details-marker { display: none; }
.recipe__more summary::after { content: "+"; font-size: 1.2rem; line-height: 1; color: var(--signal); }
.recipe__more[open] summary::after { content: "−"; }
.recipe__more pre { margin: 0 8px 8px; max-height: 420px; min-height: 0; }
@media (min-width: 1240px) { .recipe__more pre { max-height: 360px; } }
.recipe__note { margin-top: 2px; }

/* ---------- Teaser : l'exemple « Princesse en 14 jours » ---------- */
.princess-teaser {
  display: grid; gap: 4px; text-decoration: none; color: var(--ink); position: relative; overflow: hidden;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 22px;
  background-image: radial-gradient(circle at 100% 0, color-mix(in srgb, #E8337D 22%, transparent), transparent 55%);
  transition: transform .15s;
}
.princess-teaser:hover { transform: translateY(-2px); }
.princess-teaser__k { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #E8337D; }
.princess-teaser b { font: 900 1.5rem/1 var(--f-disp); font-stretch: 72%; font-variation-settings: "wdth" 72; text-transform: uppercase; }
.princess-teaser span:not(.princess-teaser__k):not(.princess-teaser__go) { color: var(--muted); font-size: .92rem; max-width: 60ch; }
.princess-teaser__go { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem; margin-top: 6px; color: var(--signal); }
.princess-teaser__go svg { width: 18px; height: 18px; }

/* ---------- Avis (silhouettes grises) ---------- */
.avis__t { font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); margin: 10px 0 22px; }
.avis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .avis { grid-template-columns: 1fr; } }
.avi { margin: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; }
.avi svg { width: 64px; height: 64px; }
.avi .av-bg { fill: color-mix(in srgb, var(--muted) 18%, var(--card)); }
.avi .av-fg { fill: color-mix(in srgb, var(--muted) 55%, var(--card)); }
.avi blockquote { margin: 0; font-size: 1.08rem; line-height: 1.5; font-weight: 600; }
.avi figcaption { font-size: .82rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.avis__note { margin-top: 12px; font-size: .82rem; color: var(--muted); font-style: italic; }

/* Bloc fusionné : avis + boutons */
.fab-avis { background: var(--card); border-radius: calc(var(--r) + 6px); box-shadow: var(--shadow); padding: clamp(24px, 4vw, 48px); }
.fab-avis .avis__t { margin-top: 0; }
.fab-avis .avi { background: var(--bg); box-shadow: none; }
.fab-avis__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 24px; }
.fab-avis .avis__note { margin: 0; font-size: .74rem; }
