/*
 * Fidélité & Cuisson : styles front.
 * Les variables --fc-* sont définies en ligne (Appearance) et héritent par défaut de la palette du thème actif.
 * Toutes les classes sont préfixées « fc- » pour éviter les conflits avec le thème.
 */
.fc-app {
	--fc-gap: 16px;
	box-sizing: border-box;
	max-width: 560px;
	margin: 0 auto;
	padding: 16px;
	color: var(--fc-text);
	font-family: var(--fc-font, inherit);
	font-size: 1rem;
	line-height: 1.5;
}
.fc-app *, .fc-app *::before, .fc-app *::after { box-sizing: border-box; }

.fc-app[data-fc="kiosk"] { max-width: 880px; }

.fc-card {
	background: var(--fc-background);
	border: 1px solid color-mix(in srgb, var(--fc-text) 14%, transparent);
	border-radius: var(--fc-radius);
	padding: 20px;
	margin-bottom: var(--fc-gap);
}
.fc-card--soft { background: var(--fc-secondary); border-color: transparent; }
.fc-card h2, .fc-card h3, .fc-title { margin: 0 0 12px; font-size: 1.35rem; line-height: 1.25; color: var(--fc-text); }
.fc-brand { text-align: center; margin-bottom: var(--fc-gap); }
.fc-brand img { max-height: 64px; width: auto; max-width: 70%; height: auto; }
.fc-brand span { font-weight: 700; font-size: 1.3rem; }
.fc-muted { color: color-mix(in srgb, var(--fc-text) 65%, transparent); font-size: .92rem; }

.fc-field { display: block; margin-bottom: 14px; }
.fc-field > span { display: block; font-weight: 600; margin-bottom: 4px; }
.fc-input, .fc-select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: 10px 14px;
	font: inherit;
	color: var(--fc-text);
	background: var(--fc-background);
	border: 2px solid color-mix(in srgb, var(--fc-text) 25%, transparent);
	border-radius: calc(var(--fc-radius) * .7);
}
.fc-input:focus, .fc-select:focus, .fc-btn:focus-visible, .fc-check input:focus-visible {
	outline: 3px solid var(--fc-accent);
	outline-offset: 2px;
}
.fc-check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
.fc-check input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--fc-primary); }
.fc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.fc-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 100%; min-height: 52px; padding: 12px 22px;
	font: inherit; font-weight: 700; cursor: pointer;
	color: var(--fc-on-primary);
	background: var(--fc-primary);
	border: 0; border-radius: calc(var(--fc-radius) * .8);
	transition: filter .15s ease, transform .05s ease;
}
.fc-btn:hover { filter: brightness(1.08); }
.fc-btn:active { transform: translateY(1px); }
.fc-btn[disabled] { opacity: .55; cursor: wait; }
.fc-btn--ghost { background: transparent; color: var(--fc-text); border: 2px solid color-mix(in srgb, var(--fc-text) 25%, transparent); }
.fc-btn--small { width: auto; min-height: 40px; padding: 8px 16px; }
.fc-link { background: none; border: 0; padding: 0; color: var(--fc-text); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }

.fc-alert { border-radius: calc(var(--fc-radius) * .7); padding: 12px 14px; margin-bottom: var(--fc-gap); font-weight: 600; }
.fc-alert--error { background: color-mix(in srgb, var(--fc-danger) 14%, var(--fc-background)); color: var(--fc-text); border-left: 5px solid var(--fc-danger); }
.fc-alert--success { background: color-mix(in srgb, var(--fc-success) 14%, var(--fc-background)); color: var(--fc-text); border-left: 5px solid var(--fc-success); }
.fc-alert--info { background: var(--fc-secondary); color: var(--fc-text); border-left: 5px solid var(--fc-accent); }

.fc-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--fc-secondary); color: var(--fc-text); }
.fc-badge--a_recuperer { background: var(--fc-success); color: var(--fc-on-success); }
.fc-badge--en_cuisson { background: var(--fc-accent); color: var(--fc-text); }
.fc-badge--annule { background: var(--fc-danger); color: var(--fc-on-danger); }
.fc-badge--hors_delai { background: #b45309; color: #fff; }

.fc-day { padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--fc-text) 14%, transparent); }
.fc-day:first-of-type { border-top: 0; }
.fc-day__head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.fc-day__date { font-weight: 700; text-transform: capitalize; }
.fc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fc-thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--fc-text) 18%, transparent); }

.fc-points { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.fc-points strong { font-size: 2rem; line-height: 1; color: var(--fc-text); }

/* Kiosque */
.fc-kiosk { display: grid; gap: 24px; align-items: center; }
@media (min-width: 720px) { .fc-kiosk { grid-template-columns: 1fr 1fr; } }
.fc-kiosk h1 { font-size: 2.2rem; margin: 0 0 8px; }
.fc-qr { text-align: center; }
.fc-qr svg { width: min(100%, 320px); height: auto; border-radius: 12px; border: 6px solid #fff; background: #fff; }
.fc-qr__timer { margin-top: 8px; }

/* Photos : zone facultative, volontairement discrète */
.fc-photo-zone { border: 2px dashed color-mix(in srgb, var(--fc-text) 25%, transparent); border-radius: calc(var(--fc-radius) * .7); padding: 14px; margin: 16px 0; }
.fc-photo-zone input[type="file"] { width: 100%; }
.fc-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fc-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

.fc-last-cook { font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .fc-btn { transition: none; } }

/* Back-office « Cuisson » : calendrier des fournées. Une case = une date ; une seule pastille d'état. */
.fc-cal-legend, .fc-cal__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 12px; font-size: 13px; color: #1d2327; }
.fc-cal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.fc-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid #8c8f94; }
.fc-sw--notified { background: #d63638; border-color: #d63638; }
.fc-sw--partial { background: #dba617; border-color: #dba617; }
.fc-sw--pending { background: #fff; border-color: #2271b1; }
.fc-sw--soon { background: #dcdcde; border-color: #a7aaad; }
.fc-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 1040px; }
.fc-cal__head { font-weight: 600; text-align: center; padding: 6px 0; color: #50575e; font-size: 13px; }
.fc-cal__day { min-height: 118px; border: 1px solid #c3c4c7; border-radius: 6px; padding: 8px 8px 6px; background: #fff; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #1d2327; box-sizing: border-box; }
.fc-cal__day--blank { background: transparent; border: 0; }
.fc-cal__day--empty { background: #f6f7f7; border-style: dashed; color: #8c8f94; }
.fc-cal__day--today { box-shadow: inset 0 0 0 2px #2271b1; }
.fc-cal__top { display: flex; justify-content: space-between; align-items: flex-start; }
.fc-cal__num { font-weight: 700; font-size: 15px; }
.fc-cal__pick { cursor: pointer; padding: 2px; }
.fc-cal__pick input { margin: 0; width: 16px; height: 16px; }
.fc-cal__count { font-size: 13px; color: #50575e; }
.fc-cal__count strong { font-size: 18px; color: #1d2327; margin-right: 2px; }
.fc-cal__pill { align-self: flex-start; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.fc-cal__pill--notified { background: #d63638; color: #fff; }
.fc-cal__pill--partial { background: #dba617; color: #1d2327; }
.fc-cal__pill--pending { background: #e7f0fa; color: #135e96; }
.fc-cal__pill--soon { background: #dcdcde; color: #50575e; }
.fc-cal__day--notified { background: #fcf0f1; border-color: #d63638; }
.fc-cal__day--partial { background: #fcf9e8; border-color: #dba617; }
.fc-cal__day--soon { background: #f6f7f7; color: #787c82; }
.fc-cal__day--soon .fc-cal__count strong { color: #787c82; }
.fc-cal__open { margin-top: auto; font-size: 12px; text-decoration: none; color: #2271b1; }
.fc-cal__open:hover { text-decoration: underline; }

/* Photos des pièces dans l'admin : miniature cliquable (affichage en grand par script). */
.fc-photo-link { display: inline-block; margin: 0 6px 6px 0; vertical-align: top; }
.fc-photo-thumb { display: block; width: 140px; height: 140px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }

/* Photos de l'espace client : agrandissement au clic. */
.fc-photo-open { cursor: zoom-in; }
.fc-lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; z-index: 100000; cursor: zoom-out; padding: 12px; box-sizing: border-box; }
.fc-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* Fidélité : progression, cadeaux, écran de présentation au comptoir (plein écran, lisible sur mobile). */
.fc-progress { height: 10px; background: var(--fc-secondary); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.fc-progress__bar { height: 100%; background: var(--fc-primary); border-radius: 99px; }
.fc-reward-screen { padding: 0; background: var(--fc-background); align-items: stretch; justify-content: center; }
.fc-reward-box { background: var(--fc-background); color: var(--fc-text); width: 100%; max-width: 480px; min-height: 100%; box-sizing: border-box; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.fc-reward-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fc-reward-top h2 { margin: 0; font-size: 1.3rem; }
.fc-reward-close { background: var(--fc-secondary); color: var(--fc-text); border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 1.2rem; cursor: pointer; flex: 0 0 auto; }
.fc-reward-name { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.25; }
.fc-reward-clock { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 700; letter-spacing: .05em; color: var(--fc-text); }
.fc-reward-notice { border: 3px solid var(--fc-accent); background: color-mix(in srgb, var(--fc-accent) 22%, var(--fc-background)); border-radius: var(--fc-radius); padding: 16px; }
.fc-reward-notice strong { display: block; font-size: 1.1rem; margin-bottom: 6px; }
.fc-reward-notice p { margin: 0; font-size: 1rem; line-height: 1.45; font-weight: 600; }
.fc-slider-wrap { margin-top: auto; }
.fc-slider-label { font-weight: 700; margin: 0 0 10px; text-align: center; }
.fc-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 76px; margin: 0; border-radius: 999px; background: var(--fc-secondary); border: 2px solid color-mix(in srgb, var(--fc-text) 25%, transparent); outline: none; cursor: pointer; touch-action: pan-y; }
.fc-slider::-webkit-slider-runnable-track { height: 76px; background: transparent; border: 0; }
.fc-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 84px; height: 84px; margin-top: -6px; border-radius: 50%; background: var(--fc-primary); border: 5px solid var(--fc-background); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); cursor: grab; }
.fc-slider::-moz-range-track { height: 76px; background: transparent; border: 0; }
.fc-slider::-moz-range-thumb { width: 84px; height: 84px; border-radius: 50%; background: var(--fc-primary); border: 5px solid var(--fc-background); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); cursor: grab; }
.fc-slider:focus-visible { box-shadow: 0 0 0 4px var(--fc-accent); }
.fc-slider:disabled { opacity: .5; cursor: default; }
.fc-reward-done { text-align: center; justify-content: center; align-items: center; }
.fc-reward-check { font-size: 96px; line-height: 1; color: var(--fc-success); }

/* Mes préférences : titre repliable avec un peu d'air avant le formulaire. */
.fc-app details > summary { cursor: pointer; font-weight: 700; padding: 2px 0; margin-bottom: 12px; }


/* Kiosque : confirmation plein écran après le scan d'une carte (douchette), se ferme seule ou au toucher. */
.fc-scan { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; background: color-mix(in srgb, var(--fc-text) 55%, transparent); }
.fc-scan__box { max-width: 640px; width: 100%; text-align: center; padding: 40px 28px; border-radius: var(--fc-radius); background: var(--fc-background); color: var(--fc-text); border-top: 12px solid var(--fc-success); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.fc-scan--error .fc-scan__box { border-top-color: var(--fc-danger); }
.fc-scan__box h1 { margin: 0 0 12px; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; }
.fc-scan__points { font-size: 1.6rem; font-weight: 700; margin: 0 0 12px; }
.fc-scan__gift { font-size: 1.3rem; font-weight: 700; margin: 8px 0; padding: 10px 14px; border-radius: calc(var(--fc-radius) * .7); background: var(--fc-success); color: var(--fc-on-success); }

/* Kiosque : boutons secondaires (caméra, installation) et écran de scan par la caméra. */
.fc-kiosk__tools { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.fc-kiosk__tools .fc-btn { width: auto; }
.fc-cam { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; background: color-mix(in srgb, var(--fc-text) 70%, transparent); }
.fc-cam__box { max-width: 640px; width: 100%; text-align: center; padding: 20px; border-radius: var(--fc-radius); background: var(--fc-background); color: var(--fc-text); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.fc-cam__video { display: block; width: 100%; max-height: 60vh; object-fit: cover; border-radius: calc(var(--fc-radius) * .7); background: #000; }
.fc-cam__hint { margin: 14px 0; font-size: 1.15rem; font-weight: 600; }
.fc-cam__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.fc-cam__actions .fc-btn { width: auto; }

/* Piste de fidélité : un point par passage (pointillés, vert une fois acquis), cercles = cadeaux. */
.fc-loyalty { text-align: center; }
.fc-loyalty .fc-points { justify-content: center; }
.fc-loyalty .fc-track-steps { display: inline-block; text-align: left; }
/* Piste de fidélité : barre pleine largeur, ronds de cadeaux dessus, étiquettes dessous. Tout reste dans la barre (symétrique, centré). */
.fc-track { --fc-step: clamp(34px, 10vw, 46px); --fc-half: max(calc(var(--fc-step) / 2), 22px); position: relative; height: calc(var(--fc-step) + 34px); margin: 14px 0 6px; }
.fc-track__line, .fc-track__fill { position: absolute; left: 0; top: calc(var(--fc-step) / 2 - 5px); height: 10px; border-radius: 10px; }
.fc-track__line { right: 0; background: color-mix(in srgb, var(--fc-text) 14%, var(--fc-background)); }
.fc-track__fill { background: var(--fc-success); transition: width .6s ease; }
.fc-track__step, .fc-track__num { position: absolute; left: clamp(var(--fc-half), calc(var(--p) * 1%), calc(100% - var(--fc-half))); transform: translateX(-50%); }
.fc-track__step { top: 0; width: var(--fc-step); height: var(--fc-step); border-radius: 50%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: var(--fc-background); border: 3px solid color-mix(in srgb, var(--fc-text) 30%, var(--fc-background)); }
.fc-track__step.is-on { background: var(--fc-success); border-color: var(--fc-success); color: var(--fc-on-success); }
.fc-track__step.is-next { border-color: var(--fc-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fc-accent) 35%, transparent); }
.fc-track__icon { font-size: calc(var(--fc-step) * .43); line-height: 1; display: flex; align-items: center; justify-content: center; }
.fc-track__icon img { display: block; width: calc(var(--fc-step) * .66); height: calc(var(--fc-step) * .66); object-fit: contain; }
.fc-track__num { top: calc(var(--fc-step) + 6px); width: 44px; text-align: center; font-size: .74rem; font-weight: 600; color: var(--fc-text); white-space: nowrap; }
.fc-track.is-dense .fc-track__num:not(.is-next) { display: none; }
.fc-track.is-dense { height: calc(var(--fc-step) + 34px); }
.fc-track.is-tiny { --fc-step: 26px; }
.fc-track.is-tiny .fc-track__icon { font-size: 12px; }
.fc-track.is-tiny .fc-track__icon img { width: 18px; height: 18px; }
.fc-track.is-mini { --fc-step: 16px; --fc-half: 8px; }
.fc-track.is-mini .fc-track__icon { display: none; }
.fc-track.is-mini .fc-track__step { border-width: 2px; }.fc-track-rule { margin: 6px 0 4px; }
.fc-track-next { font-weight: 700; margin: 6px 0 8px; }
.fc-track-steps { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.fc-track-steps li { padding: 4px 0; color: color-mix(in srgb, var(--fc-text) 70%, transparent); }
.fc-track-steps li.is-on { color: var(--fc-text); }

/* Pages du plugin : filet de sécurité si le thème garde sa colonne latérale */
body.fc-no-sidebar #secondary, body.fc-no-sidebar .widget-area, body.fc-no-sidebar #sidebar, body.fc-no-sidebar aside.sidebar { display: none !important; }
body.fc-no-sidebar #primary, body.fc-no-sidebar .content-area { width: 100% !important; max-width: 100% !important; float: none !important; }
body.fc-app-page { margin: 0; }
.fc-app-main { margin: 0; padding: 0; }body.fc-no-sidebar #left-area { width: 100% !important; float: none !important; padding-right: 0 !important; }
body.fc-no-sidebar #main-content .container:before { display: none !important; }

/* Le bandeau du thème affiche déjà le café : on masque le doublon hors tablette */
body.fc-theme-header .fc-brand { display: none; }
body.fc-theme-header .fc-kiosk .fc-brand { display: block; }

/* Écran de confirmation en couche supérieure (popover) : on neutralise les styles par défaut du navigateur */
.fc-scan[popover] { position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; border: 0; overflow: visible; color: inherit; }

/* Scan : accusé de lecture en attendant la réponse */
.fc-scan--pending .fc-scan__box { border-top-color: var(--fc-primary); }
.fc-scan__spin { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%; border: 6px solid color-mix(in srgb, var(--fc-text) 15%, transparent); border-top-color: var(--fc-primary); animation: fc-spin .8s linear infinite; }
@keyframes fc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fc-scan__spin { animation-duration: 3s; } }

.fc-kiosk__last { margin: 10px 0 0; min-height: 1.4em; font-size: .85rem; }

.fc-kiosk__result .fc-alert { font-size: 1.25rem; }

/* Carte du client en QR code (espace cuisson) */
.fc-mycard { text-align: center; }
.fc-mycard h3 { margin-top: 0; }
.fc-mycard__qr svg { display: block; margin: 0 auto; width: min(260px, 78%); height: auto; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--fc-text) 15%, transparent); }

/* Historique des cadeaux (consommés ou expirés). */
.fc-history { margin-top: 14px; }
.fc-history > summary { cursor: pointer; font-weight: 600; }
.fc-day--past { opacity: .8; }
