/*
 * Frencheezy UI kit (fz-ui): the shared components of the design system (docs/DESIGN_SYSTEM.md).
 * Loaded on every page of the 3 sites after fz-tokens.css. Components read --fz-* tokens only; the site look
 * (body.fz-look-main, -kids, -exams) changes the tokens, and the few rules below that are per look.
 * The design system page shows the same rules with [data-theme] instead of the body classes.
 */

/* ---------- base ---------- */
.fz-ui { font-family: var(--fz-font-body); font-weight: var(--fz-body-weight); color: var(--fz-ink); line-height: 1.6; }
.fz-ui *, .fz-ui *::before, .fz-ui *::after { box-sizing: border-box; }
.fz-eyebrow { margin: 0; font: 600 0.8125rem/1.3 var(--fz-font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--fz-action-strong); }
.fz-title { margin: 0; font-family: var(--fz-font-heading); font-weight: var(--fz-heading-weight); line-height: 1.15; color: var(--fz-ink); text-wrap: balance; }
.fz-lede { margin: 0; font-size: 1.0625rem; color: var(--fz-muted); max-width: 62ch; }
.fz-ui :focus-visible { outline: 3px solid var(--fz-action); outline-offset: 2px; }

/* ---------- Button ---------- */
.fz-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: 0 1.25em;
  border: var(--fz-border) solid transparent; border-radius: var(--fz-radius-btn); font: 600 1rem/1.2 var(--fz-font-body);
  text-decoration: none; cursor: pointer; transition: background-color .15s var(--fz-ease), transform .15s var(--fz-ease), box-shadow .15s var(--fz-ease); }
.fz-btn svg { width: 1.1em; height: 1.1em; flex: none; }
.fz-btn--primary { background: var(--fz-action); color: var(--fz-on-action); }
.fz-btn--primary:hover { background: var(--fz-action-strong); }
.fz-btn--spotlight { background: var(--fz-spotlight); color: var(--fz-on-spotlight); }
.fz-btn--spotlight:hover { filter: brightness(.95); }
.fz-btn--secondary { background: var(--fz-surface); color: var(--fz-ink); border-color: var(--fz-line); }
.fz-btn--secondary:hover { border-color: var(--fz-ink); }
.fz-btn--ghost { background: transparent; color: var(--fz-action-strong); }
.fz-btn--ghost:hover { background: var(--fz-action-soft); }
.fz-btn--danger { background: var(--fz-surface); color: var(--fz-danger); border-color: var(--fz-danger); }
.fz-btn[disabled], .fz-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.fz-btn--block { display: flex; width: 100%; }
.fz-look-kids .fz-btn { font-family: var(--fz-font-heading); font-size: 1.0625rem; }
.fz-look-kids .fz-btn--primary { box-shadow: 0 5px 0 var(--fz-action-strong); }
.fz-look-kids .fz-btn--primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--fz-action-strong); }
.fz-look-kids .fz-btn--secondary { border-color: var(--fz-ink); box-shadow: 0 4px 0 var(--fz-ink); }
.fz-look-exams .fz-btn { font-family: var(--fz-font-heading); }

/* ---------- Card ---------- */
.fz-card { display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; background: var(--fz-surface);
  border: var(--fz-border) solid var(--fz-line); border-radius: var(--fz-radius-lg); box-shadow: var(--fz-shadow-soft); min-width: 0; }
.fz-card--link { color: inherit; text-decoration: none; transition: box-shadow .2s var(--fz-ease), transform .2s var(--fz-ease); }
.fz-card--link:hover { box-shadow: var(--fz-shadow-lift); transform: translateY(-2px); }
.fz-card--flat { box-shadow: none; }
.fz-card__title { margin: 0; font: var(--fz-heading-weight) 1.3125rem/1.3 var(--fz-font-heading); color: var(--fz-ink); }
.fz-card__meta { margin: 0; font-size: .9375rem; color: var(--fz-muted); }
.fz-look-kids .fz-card { border-color: var(--fz-ink); }

/* ---------- Badge ---------- */
.fz-badge { display: inline-flex; align-items: center; gap: .35em; padding: .25em .7em; border-radius: var(--fz-radius-pill, 999px);
  font: 600 .8125rem/1.3 var(--fz-font-body); letter-spacing: .02em; white-space: nowrap; background: var(--fz-surface-soft); color: var(--fz-ink); }
.fz-badge--action { background: var(--fz-action-soft); color: var(--fz-action-strong); }
.fz-badge--success { background: var(--fz-success-soft); color: var(--fz-success); }
.fz-badge--warning { background: var(--fz-warning-soft); color: var(--fz-warning); }
.fz-badge--danger { background: var(--fz-danger-soft); color: var(--fz-danger); }
.fz-badge--spotlight { background: var(--fz-spotlight); color: var(--fz-on-spotlight); }

/* ---------- Notice ---------- */
.fz-notice { display: flex; gap: .75rem; align-items: flex-start; padding: .875rem 1rem; border-radius: var(--fz-radius-md);
  background: var(--fz-surface-soft); color: var(--fz-ink); font-size: .9375rem; line-height: 1.5; }
.fz-notice svg { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .1rem; }
.fz-notice strong { display: block; }
.fz-notice--info { background: var(--fz-action-soft); }
.fz-notice--info svg { color: var(--fz-action-strong); }
.fz-notice--success { background: var(--fz-success-soft); }
.fz-notice--success svg { color: var(--fz-success); }
.fz-notice--warning { background: var(--fz-warning-soft); }
.fz-notice--warning svg { color: var(--fz-warning); }
.fz-notice--danger { background: var(--fz-danger-soft); }
.fz-notice--danger svg { color: var(--fz-danger); }

/* ---------- Field ---------- */
.fz-field { display: flex; flex-direction: column; gap: .375rem; min-width: 0; }
.fz-field__label { font-weight: 600; font-size: .9375rem; color: var(--fz-ink); }
.fz-field__help { font-size: .875rem; color: var(--fz-muted); }
.fz-field__error { font-size: .875rem; color: var(--fz-danger); font-weight: 600; }
.fz-input { width: 100%; min-height: 44px; padding: .55rem .85rem; border: var(--fz-border) solid var(--fz-line); border-radius: var(--fz-radius-sm);
  background: var(--fz-surface); color: var(--fz-ink); font: inherit; font-weight: 400; }
.fz-input:hover { border-color: var(--fz-muted); }
.fz-input:focus { outline: 3px solid var(--fz-action-soft); border-color: var(--fz-action); }
.fz-input[aria-invalid="true"] { border-color: var(--fz-danger); }
.fz-look-kids .fz-input { border-color: var(--fz-ink); }

/* ---------- Choice (an answer in a quiz or exam) ---------- */
.fz-choices { display: flex; flex-direction: column; gap: .75rem; }
.fz-choice { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 48px; padding: .6rem .9rem; text-align: left;
  border: var(--fz-border) solid var(--fz-line); border-radius: var(--fz-radius-md); background: var(--fz-surface); color: var(--fz-ink);
  font: inherit; cursor: pointer; transition: border-color .15s var(--fz-ease), background-color .15s var(--fz-ease); }
.fz-choice:hover { border-color: var(--fz-action); }
.fz-choice__key { flex: none; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--fz-surface-soft); font-weight: 700; font-size: .875rem; }
.fz-choice__state { margin-left: auto; font-size: .8125rem; font-weight: 700; }
.fz-choice.is-selected { border-color: var(--fz-action); background: var(--fz-action-soft); }
.fz-choice.is-selected .fz-choice__key { background: var(--fz-action); color: var(--fz-on-action); }
.fz-choice.is-right { border-color: var(--fz-success); background: var(--fz-success-soft); }
.fz-choice.is-right .fz-choice__key { background: var(--fz-success); color: var(--fz-surface); }
.fz-choice.is-right .fz-choice__state { color: var(--fz-success); }
.fz-choice.is-wrong { border-color: var(--fz-danger); background: var(--fz-danger-soft); }
.fz-choice.is-wrong .fz-choice__key { background: var(--fz-danger); color: var(--fz-surface); }
.fz-choice.is-wrong .fz-choice__state { color: var(--fz-danger); }
.fz-look-kids .fz-choice { border-color: var(--fz-ink); box-shadow: 0 4px 0 var(--fz-ink); }

/* ---------- Progress ---------- */
.fz-progress { display: flex; flex-direction: column; gap: .375rem; }
.fz-progress__top { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--fz-muted); font-variant-numeric: tabular-nums; }
.fz-progress__top strong { color: var(--fz-ink); }
.fz-progress__track { height: 10px; border-radius: var(--fz-radius-pill, 999px); background: var(--fz-surface-soft); overflow: hidden; }
.fz-progress__fill { height: 100%; border-radius: inherit; background: var(--fz-action); }
.fz-progress--done .fz-progress__fill { background: var(--fz-success); }
.fz-look-kids .fz-progress__track { height: 14px; border: 2px solid var(--fz-ink); }

@media (prefers-reduced-motion: reduce) { .fz-btn, .fz-card--link, .fz-choice { transition: none; } }

/* ---------- Button states ---------- */
.fz-btn:active { transform: translateY(1px); }
.fz-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.fz-btn.is-loading::after { content: ""; position: absolute; width: 1.1em; height: 1.1em; border-radius: 50%; border: 2px solid var(--fz-on-action); border-right-color: transparent; animation: fz-spin .7s linear infinite; }
.fz-btn--secondary.is-loading::after, .fz-btn--ghost.is-loading::after { border-color: var(--fz-action); border-right-color: transparent; }
@keyframes fz-spin { to { transform: rotate(360deg); } }

/* ---------- Badge: sticker (kids, on pictures) ---------- */
.fz-badge--sticker { background: var(--fz-spotlight); color: var(--fz-on-spotlight); box-shadow: var(--fz-shadow-sticker); transform: rotate(-4deg); font-family: var(--fz-font-heading); }

/* ---------- Icon ---------- */
.fz-icon { display: inline-block; width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; stroke-width: var(--fz-icon-stroke, 2); }
.fz-icon--xl { width: 2.75em; height: 2.75em; }
/* Kids drawings (assets/icons/kids): a colour fill under the lines, and a face that only shows on big icons. */
.fz-i-fill { stroke: none; fill: color-mix(in srgb, var(--fz-sky) 70%, var(--fz-surface)); }
.fz-i-fill--sun { fill: var(--fz-spotlight); }
.fz-i-fill--mint { fill: color-mix(in srgb, var(--fz-mint) 75%, var(--fz-surface)); }
.fz-i-fill--coral { fill: color-mix(in srgb, var(--fz-coral) 70%, var(--fz-surface)); }
.fz-i-face { display: none; }
.fz-icon--xl .fz-i-face { display: inline; }
.fz-i-eye { fill: currentColor; stroke: none; }
.fz-i-smile { stroke-width: 1.4; }
.fz-i-cheek { fill: var(--fz-coral); stroke: none; opacity: .55; }
.fz-icon--lg { width: 1.75em; height: 1.75em; }

/* ---------- Tabs ---------- */
.fz-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: var(--fz-border) solid var(--fz-line); }
.fz-tab { min-height: 44px; padding: 0 1rem; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--fz-muted);
  font: 600 .9375rem/1.2 var(--fz-font-body); cursor: pointer; }
.fz-tab:hover { color: var(--fz-ink); }
.fz-tab[aria-selected="true"] { color: var(--fz-ink); border-bottom-color: var(--fz-action); }
.fz-look-kids .fz-tabs { border: 0; gap: .5rem; }
.fz-look-kids .fz-tab { border: 3px solid var(--fz-ink); border-radius: 999px; background: var(--fz-surface); color: var(--fz-ink); font-family: var(--fz-font-heading); }
.fz-look-kids .fz-tab[aria-selected="true"] { background: var(--fz-action); color: var(--fz-on-action); }

/* ---------- Accordion ---------- */
.fz-accordion { display: flex; flex-direction: column; gap: .5rem; }
.fz-accordion details { border: var(--fz-border) solid var(--fz-line); border-radius: var(--fz-radius-md); background: var(--fz-surface); }
.fz-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; padding: .75rem 1rem;
  font: var(--fz-heading-weight) 1.0625rem/1.35 var(--fz-font-heading); color: var(--fz-ink); cursor: pointer; list-style: none; }
.fz-accordion summary::-webkit-details-marker { display: none; }
.fz-accordion summary::after { content: "+"; font: 600 1.25rem/1 var(--fz-font-body); color: var(--fz-action-strong); }
.fz-accordion details[open] summary::after { content: "\2212"; }
.fz-accordion details > div { padding: 0 1rem 1rem; color: var(--fz-muted); }
.fz-look-kids .fz-accordion details { border-color: var(--fz-ink); }

/* ---------- Dialog ---------- */
.fz-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: var(--fz-border) solid var(--fz-line); border-radius: var(--fz-radius-lg);
  background: var(--fz-surface); color: var(--fz-ink); box-shadow: var(--fz-shadow-lift); }
.fz-dialog::backdrop { background: var(--fz-scrim); }
.fz-dialog__body { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; }
.fz-dialog__title { margin: 0; font: var(--fz-heading-weight) 1.3125rem/1.3 var(--fz-font-heading); }
.fz-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; padding: 1rem 1.5rem; border-top: var(--fz-border) solid var(--fz-line); }
.fz-look-kids .fz-dialog { border-color: var(--fz-ink); }

/* ---------- Table ---------- */
.fz-table-wrap { overflow-x: auto; border: var(--fz-border) solid var(--fz-line); border-radius: var(--fz-radius-md); background: var(--fz-surface); }
.fz-table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.fz-table th { text-align: left; padding: .75rem 1rem; font: 600 .8125rem/1.3 var(--fz-font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--fz-muted); background: var(--fz-surface-soft); }
.fz-table td { padding: .75rem 1rem; border-top: 1px solid var(--fz-line); color: var(--fz-ink); }
.fz-table .is-num { text-align: right; }

/* Stat, Empty state, Course card and Plan card share their names with older theme components (theme.css),
   so they only apply inside a .fz-ui root. */
/* ---------- Stat ---------- */
.fz-ui .fz-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 0 !important; /* the theme stats band sets an important margin */ }
.fz-ui .fz-stat { text-align: left; font-weight: inherit; display: flex; flex-direction: column; gap: .15rem; padding: 1rem; border-radius: var(--fz-radius-md); background: var(--fz-surface); border: var(--fz-border) solid var(--fz-line); }
.fz-ui .fz-stat__value { font: var(--fz-heading-weight) 1.75rem/1.1 var(--fz-font-heading); color: var(--fz-ink); font-variant-numeric: tabular-nums; }
.fz-ui .fz-stat__label { font-size: .875rem; color: var(--fz-muted); }
.fz-look-kids .fz-ui .fz-stat { border-color: var(--fz-ink); }

/* ---------- Empty state ---------- */
/* One pattern on every site and screen: a picture (Zazou reading on Kids, an icon in a soft circle elsewhere), a title,
   one sentence and the next action. tutor.css gives Tutor's and the Pro Pack's own empty states the same look. */
.fz-empty { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem 1.25rem; text-align: center;
  border: 2px dashed var(--fz-line); border-radius: var(--fz-radius-lg); background: var(--fz-surface); color: var(--fz-muted); }
.fz-empty__art { position: relative; display: block; flex: none; width: 72px; height: 72px; border-radius: 50%; background: var(--fz-action-soft); }
.fz-empty__art::after { content: ""; position: absolute; inset: 21px; background: var(--fz-action);
  -webkit-mask: url(../icons/compass.svg) center / contain no-repeat; mask: url(../icons/compass.svg) center / contain no-repeat; }
.fz-look-kids .fz-empty__art { width: 120px; height: 120px; border-radius: 0; background: url(../img/zazou-read-cut-640.webp) center / contain no-repeat; }
.fz-look-kids .fz-empty__art::after { content: none; }
.fz-empty > img { width: 120px; height: auto; }
.fz-empty__title { margin: 0; font: var(--fz-heading-weight) 1.3125rem/1.3 var(--fz-font-heading); color: var(--fz-ink); }
.fz-empty p { margin: 0; max-width: 46ch; }

/* ---------- Toast ---------- */
.fz-toast { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: .6rem 1rem; border-radius: var(--fz-radius-md);
  background: var(--fz-night); color: var(--fz-on-night); font-weight: 600; font-size: .9375rem; box-shadow: var(--fz-shadow-lift); }
.fz-toast .fz-icon { color: var(--fz-spotlight); }

/* ---------- Audio player ---------- */
.fz-audio { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem .5rem .5rem; border-radius: var(--fz-radius-pill, 999px);
  background: var(--fz-surface); border: var(--fz-border) solid var(--fz-line); min-width: 0; }
.fz-audio__play { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--fz-action); color: var(--fz-on-action); cursor: pointer; }
.fz-audio__play .fz-icon { width: 20px; height: 20px; }
.fz-audio__track { flex: 1; height: 6px; border-radius: 999px; background: var(--fz-surface-soft); overflow: hidden; }
.fz-audio__fill { height: 100%; background: var(--fz-action); }
.fz-audio__time { font-size: .8125rem; color: var(--fz-muted); font-variant-numeric: tabular-nums; }
.fz-audio__label { font-size: .8125rem; font-weight: 600; color: var(--fz-warning); }
.fz-look-kids .fz-audio { border-color: var(--fz-ink); }

/* ---------- Timer ---------- */
.fz-timer { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: 0 .9rem; border-radius: var(--fz-radius-pill, 999px);
  background: var(--fz-surface-soft); color: var(--fz-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.fz-timer.is-low { background: var(--fz-warning-soft); color: var(--fz-warning); }
.fz-timer.is-over { background: var(--fz-danger-soft); color: var(--fz-danger); }

/* ---------- Course card ---------- */
.fz-ui .fz-course { display: flex; flex-direction: column; overflow: hidden; background: var(--fz-surface); border: var(--fz-border) solid var(--fz-line);
  border-radius: var(--fz-radius-lg); box-shadow: var(--fz-shadow-soft); color: inherit; text-decoration: none; min-width: 0; }
.fz-ui .fz-course__img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; display: block; background: var(--fz-surface-soft); }
.fz-ui .fz-course__body { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem 1.2rem; }
.fz-ui .fz-course__title { margin: 0; font: var(--fz-heading-weight) 1.1875rem/1.3 var(--fz-font-heading); color: var(--fz-ink); }
.fz-ui .fz-course__meta { margin: 0; font-size: .875rem; color: var(--fz-muted); }
.fz-ui .fz-course__foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .25rem; font-weight: 700; color: var(--fz-ink); }
.fz-look-kids .fz-ui .fz-course { border-color: var(--fz-ink); }

/* ---------- Plan card ---------- */
.fz-ui .fz-plan { display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; background: var(--fz-surface); border: var(--fz-border) solid var(--fz-line);
  border-radius: var(--fz-radius-lg); box-shadow: var(--fz-shadow-soft); }
.fz-ui .fz-plan.is-featured { border: 2px solid var(--fz-action); box-shadow: var(--fz-shadow-lift); }
.fz-ui .fz-plan__name { margin: 0; font: var(--fz-heading-weight) 1.3125rem/1.3 var(--fz-font-heading); }
.fz-ui .fz-plan__price { margin: 0; font: var(--fz-heading-weight) 2.5rem/1 var(--fz-font-heading); color: var(--fz-ink); font-variant-numeric: tabular-nums; }
.fz-ui .fz-plan__price small { font: 400 .9375rem/1 var(--fz-font-body); color: var(--fz-muted); }
.fz-ui .fz-plan__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.fz-ui .fz-plan__list li { display: flex; gap: .5rem; align-items: flex-start; }
.fz-ui .fz-plan__list .fz-icon { color: var(--fz-success); margin-top: .15em; }
.fz-look-kids .fz-ui .fz-plan { border-color: var(--fz-ink); }

/* ---------- Learning path (Ma ligne, journeys) ---------- */
.fz-path { position: relative; display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.fz-path::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 4px; border-radius: 4px; background: var(--fz-line); }
.fz-path__stop { position: relative; display: flex; align-items: center; gap: .9rem; min-height: 56px; padding: .5rem .75rem .5rem 0; }
.fz-path__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%;
  background: var(--fz-surface); border: 3px solid var(--fz-line); color: var(--fz-muted); font-weight: 700; }
.fz-path__text { display: flex; flex-direction: column; min-width: 0; }
.fz-path__title { font: var(--fz-heading-weight) 1.0625rem/1.3 var(--fz-font-heading); color: var(--fz-ink); }
.fz-path__meta { font-size: .875rem; color: var(--fz-muted); }
.fz-path__stop .fz-badge { margin-left: auto; }
.fz-path__stop.is-done .fz-path__dot { background: var(--fz-success); border-color: var(--fz-success); color: var(--fz-surface); }
.fz-path__stop.is-current .fz-path__dot { background: var(--fz-action); border-color: var(--fz-action); color: var(--fz-on-action); box-shadow: 0 0 0 5px var(--fz-action-soft); }
.fz-path__stop.is-locked { opacity: .7; }
.fz-look-kids .fz-path__dot { border-color: var(--fz-ink); }
