/* O'repas – Grille Recettes Cube v2 — couleurs et espacements à personnaliser ici */
.grc-wrap {
	--grc-gap: 6px;              /* espace entre les cubes */
	--grc-accent: #13b21f;       /* vert O'repas */
	--grc-texte: #222;
	--grc-bord: #c9c9c9;
	--grc-dos: rgba(20, 20, 20, .88); /* fond de la face arrière des recettes */
	--grc-duree: .55s;
	--grc-row: 22vw;             /* recalculé en JS = largeur d'une colonne */
	max-width: 1200px;
	margin: 0 auto 3rem;
	color: var(--grc-texte);
}
.grc-wrap *, .grc-wrap *::before, .grc-wrap *::after { box-sizing: border-box; }

/* ---------- Filtres ---------- */
.grc-filtres { display: flex; flex-direction: column; gap: 12px; margin: 0 0 22px; }
.grc-search,
.grc-drop-btn {
	width: 100%; min-height: 54px; padding: 0 18px;
	border: 1.5px solid var(--grc-bord); border-radius: 3px; background: #fff;
	font: inherit; font-size: 1.05rem; color: var(--grc-texte); text-align: left;
}
.grc-search:focus, .grc-drop-btn:focus-visible { outline: none; border-color: var(--grc-accent); }
.grc-drop { position: relative; }
.grc-drop-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.grc-drop-txt { color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grc-drop.has-value .grc-drop-txt { color: var(--grc-texte); font-weight: 600; }
.grc-drop.has-value .grc-drop-btn { border-color: var(--grc-accent); }
.grc-chev { width: 20px; height: 20px; flex: none; transition: transform .2s; color: #777; }
.grc-drop-btn[aria-expanded="true"] .grc-chev { transform: rotate(180deg); }
.grc-drop-panel {
	position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
	max-height: 320px; overflow-y: auto; padding: 8px;
	background: #fff; border: 1.5px solid var(--grc-bord); border-radius: 3px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
	display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 12px;
}
.grc-drop-panel[hidden] { display: none; }

.grc-opt { display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer; font-size: 1rem; line-height: 1.25; }
.grc-opt input { width: 20px; height: 20px; accent-color: var(--grc-accent); flex: none; margin: 0; }
.grc-opt em { font-style: normal; color: #888; font-size: .85em; }
.grc-opt.is-off { opacity: .35; }

.grc-cases { display: flex; flex-wrap: wrap; gap: 0 18px; }
.grc-cases .grc-opt { font-weight: 700; font-size: 1.05rem; }

.grc-actifs { display: flex; align-items: center; justify-content: space-between; font-size: .95rem; }
.grc-actifs[hidden] { display: none; }
.grc-reset { background: none; border: 0; padding: 0; color: var(--grc-accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- Barre membre ---------- */
.grc-membre {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
	padding: 12px 14px; background: #f3faf3; border: 1px solid #d4ecd4; border-radius: 3px; font-size: .95rem;
}
.grc-membre-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.grc-membre a { color: var(--grc-accent); font-weight: 600; }
.grc-save, .grc-signup {
	background: var(--grc-accent); color: #fff !important; border: 0; border-radius: 999px;
	padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important;
}
.grc-save[disabled] { opacity: .6; }

/* ---------- Page « Mon espace » ---------- */
.grc-compte *, .grc-compte *::before, .grc-compte *::after { box-sizing: border-box; }
.grc-compte { max-width: 760px; margin: 0 auto 3rem; color: var(--grc-texte, #222); --grc-accent: #13b21f; }
.grc-compte .grc-plus { background: var(--grc-accent); color: #fff; border: 0; border-radius: 999px; padding: 13px 28px; font: inherit; font-weight: 600; cursor: pointer; }
.grc-onglets { display: flex; gap: 6px; margin-bottom: 14px; }
.grc-onglets a { flex: 1; text-align: center; padding: 12px; border: 1.5px solid #c9c9c9; border-radius: 3px; text-decoration: none; color: inherit; font-weight: 600; }
.grc-onglets a.is-active { border-color: var(--grc-accent); background: var(--grc-accent); color: #fff; }
.grc-carte { border: 1.5px solid #e2e2e2; border-radius: 3px; padding: 20px; margin-bottom: 14px; }
.grc-form label { display: block; margin-bottom: 12px; font-weight: 600; }
.grc-form input[type=text], .grc-form input[type=email], .grc-form input[type=password],
.grc-carte #loginform input[type=text], .grc-carte #loginform input[type=password] {
	display: block; width: 100%; min-height: 50px; margin-top: 6px; padding: 0 14px;
	border: 1.5px solid #c9c9c9; border-radius: 3px; font: inherit; font-weight: 400;
}
.grc-carte #loginform .button-primary { background: var(--grc-accent); color: #fff; border: 0; border-radius: 999px; padding: 13px 28px; font: inherit; font-weight: 600; cursor: pointer; }
.grc-form .grc-check { display: flex; gap: 10px; font-weight: 400; font-size: .9rem; line-height: 1.4; }
.grc-form .grc-check input { width: 20px; height: 20px; flex: none; accent-color: var(--grc-accent); }
.grc-hp { position: absolute !important; left: -9999px !important; }
.grc-form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.grc-form legend { font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.grc-pref-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.grc-pref-liste .grc-opt { font-weight: 400; margin: 0; }
.grc-msg { padding: 12px 14px; border-radius: 3px; }
.grc-msg-ok { background: #e9f8e9; color: #1d6b22; }
.grc-msg-erreur { background: #fdecea; color: #a12a1c; }
.grc-bonjour { margin: 0 0 6px; }
.grc-petit { font-size: .9rem; }
.grc-bas { display: flex; justify-content: space-between; align-items: center; }
.grc-bas form { margin: 0; }
.grc-lien-danger { background: none; border: 0; color: #a12a1c; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---------- Mosaïque ---------- */
.grc-grille {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: var(--grc-gap);
	grid-template-columns: repeat(var(--grc-cols, 4), minmax(0, 1fr));
	grid-auto-rows: var(--grc-row);
	grid-auto-flow: row dense;
}
.grc-case { position: relative; perspective: 1400px; margin: 0; padding: 0; }
.grc-case.is-l { grid-column: span 2; }
.grc-case.is-h { grid-row: span 2; }
.grc-case.is-g { grid-column: span 2; grid-row: span 2; }
.grc-case.is-hidden, .grc-case.is-later { display: none; }
.grc-case.is-entering { opacity: 0; }
.grc-case { transition: opacity .35s; }

@media (max-width: 900px) { .grc-grille { --grc-cols: 3; } }
@media (max-width: 640px) {
	.grc-wrap { --grc-gap: 5px; }
	.grc-grille { --grc-cols: 2; }
	.grc-case.is-g { grid-column: span 2; grid-row: span 2; }
}

/* ---------- Cube ---------- */
/* Lien invisible qui couvre toute la case : on peut cliquer n'importe où sur la photo */
.grc-hit { position: absolute; inset: 0; z-index: 5; display: block; cursor: pointer; }
.grc-hit:focus-visible { outline: 3px solid var(--grc-accent); outline-offset: 2px; }

/* Évite l'affichage de la grille avant le mélange */
.grc-wrap:not(.grc-ready) .grc-grille { visibility: hidden; max-height: 100vh; overflow: hidden; }

.grc-cube {
	position: absolute; inset: 0; display: block; color: inherit; pointer-events: none;
	transform-style: preserve-3d;
	transition: transform var(--grc-duree) cubic-bezier(.45, .1, .2, 1);
}
.grc-face {
	position: absolute; inset: 0; overflow: hidden;
	backface-visibility: hidden; -webkit-backface-visibility: hidden;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.grc-avant { background: #e9e9e9; }
.grc-avant img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; display: block; margin: 0; }

/* Titre sur la photo : discret sur ordinateur (révélé au dos), visible sur mobile */
.grc-titre {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 10px 9px;
	color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.2; text-align: left;
	background: linear-gradient(transparent, rgba(0, 0, 0, .7));
	opacity: 0;
}
@media (hover: none), (max-width: 640px) { .grc-titre { opacity: 1; } }

.grc-arriere {
	background: var(--grc-dos); color: #fff; text-align: center; padding: 14px; gap: 9px;
}
.grc-arriere strong { font-size: 1.05rem; line-height: 1.25; }
.grc-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.grc-badges span { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.grc-temps { font-size: .82rem; opacity: .85; }
.grc-btn {
	display: inline-block; padding: 7px 16px; border-radius: 999px; font-size: .84rem; font-weight: 600;
	background: var(--grc-accent); color: #fff;
}

/* Tuiles de couleur (photo, recherche, générateur, défis) */
.grc-cta .grc-avant, .grc-cta .grc-arriere { background: var(--grc-bg); color: #fff; }
.grc-cta .grc-arriere { filter: brightness(.9); }
.grc-cta .grc-arriere strong { font-size: 1.2rem; }
.grc-cta .grc-btn { background: #fff; color: var(--grc-bg); }
.grc-cta-titre { padding: 12px; text-align: center; font-size: clamp(1.05rem, 2.1vw, 1.9rem); font-weight: 600; line-height: 1.15; color: #fff; }
@media (max-width: 640px) { .grc-cta-titre { font-size: 1.1rem; } }
.grc-ico { width: 62%; max-width: 230px; color: #fff; display: block; }
.grc-ico svg { width: 100%; height: auto; display: block; }

/* Effet CUBE : la case roule vers le haut */
.grc-effet-cube .grc-cube    { transform: translateZ(calc(var(--d, 100px) * -1)); }
.grc-effet-cube .grc-avant   { transform: translateZ(var(--d, 100px)); }
.grc-effet-cube .grc-arriere { transform: rotateX(-90deg) translateZ(var(--d, 100px)); }
.grc-effet-cube .grc-case:hover .grc-cube,
.grc-effet-cube .grc-case:focus-within .grc-cube,
.grc-effet-cube .grc-case.is-open .grc-cube { transform: translateZ(calc(var(--d, 100px) * -1)) rotateX(90deg); }

/* Effet FLIP : carte retournée */
.grc-effet-flip .grc-arriere { transform: rotateY(180deg); }
.grc-effet-flip .grc-case:hover .grc-cube,
.grc-effet-flip .grc-case:focus-within .grc-cube,
.grc-effet-flip .grc-case.is-open .grc-cube { transform: rotateY(180deg); }

/* Écran tactile : pas de survol, seul le tap ouvre */
@media (hover: none) {
	.grc-effet-cube .grc-case:hover:not(.is-open) .grc-cube { transform: translateZ(calc(var(--d, 100px) * -1)); }
	.grc-effet-flip .grc-case:hover:not(.is-open) .grc-cube { transform: none; }
}

/* Petites cases sur mobile : dos simplifié */
@media (max-width: 640px) {
	.grc-arriere { padding: 10px; gap: 6px; }
	.grc-arriere strong { font-size: .88rem; }
	.grc-case:not(.is-l):not(.is-h):not(.is-g) .grc-badges { display: none; }
	.grc-btn { padding: 6px 12px; font-size: .78rem; }
	.grc-cta .grc-arriere strong { font-size: .95rem; }
}

/* ---------- Bas de page ---------- */
.grc-aucune { text-align: center; padding: 30px 10px; }
.grc-aucune[hidden] { display: none; }
.grc-plus-wrap { text-align: center; margin-top: 22px; }
.grc-plus {
	background: var(--grc-accent); color: #fff; border: 0; border-radius: 999px;
	padding: 13px 28px; font: inherit; font-weight: 600; cursor: pointer;
}
.grc-plus[hidden] { display: none; }

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

/* Espace membre : bilan des filtres enregistrés + réinitialiser */
.grc-pref-bilan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 18px; background: #f3faf3; border: 1px solid #d4ecd4; border-radius: 8px; line-height: 1.45; }
.grc-pref-bilan a { color: #0e7f17; font-weight: 600; }
.grc-pref-nb { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #13b21f; color: #fff; font-weight: 800; font-size: 1.15rem; }
.grc-pref-nb.is-zero { background: #b9c2bb; }
.grc-pref-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.grc-compte .grc-reinit { background: #fff; color: #444; border: 1.5px solid #c9c9c9; border-radius: 999px; padding: 12px 24px; font: inherit; font-weight: 600; cursor: pointer; }
.grc-compte .grc-reinit:hover { border-color: #a12a1c; color: #a12a1c; }

/* Avertissement : régime enregistré non appliqué */
.grc-alerte-regime { padding: 14px 16px; background: #fff6e0; border: 1.5px solid #f2b705; border-left-width: 6px; border-radius: 6px; font-size: .95rem; line-height: 1.45; }
.grc-alerte-regime[hidden] { display: none; }
.grc-alerte-regime p { margin: 0 0 6px; }
.grc-alerte-regime .grc-ar-sub { color: #5d5233; font-size: .88rem; }
.grc-ar-btn { margin-top: 4px; background: #13b21f; color: #fff; border: 0; border-radius: 999px; padding: 8px 18px; font: inherit; font-weight: 700; cursor: pointer; }

/* ===================== Recherche en phrase ===================== */
.grc-phrase-box { padding: 18px 18px 16px; background: #f4faf3; border-radius: 16px; }
.grc-search-pill { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: #fff; border: 1.5px solid #dfe9dd; border-radius: 999px; margin: 0; }
.grc-search-pill svg { width: 18px; height: 18px; flex: none; color: #5d655f; }
.grc-search-pill .grc-search { flex: 1; min-width: 0; min-height: 0; height: 100%; border: 0 !important; padding: 0 !important; background: transparent; font-size: 16px; outline: none; box-shadow: none; }
.grc-phrase { margin: 16px 0 0; font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.6; font-weight: 800; letter-spacing: -0.01em; color: #1f2420; }
.grc-slot { font: inherit; line-height: inherit; color: #0e7f17; background: none; border: 0; border-bottom: 2.5px dashed #13b21f; border-radius: 4px 4px 0 0; padding: 0 3px; margin: 0 1px; cursor: pointer; text-align: left; }
.grc-slot:hover { background: #e4f5e4; }
.grc-slot:focus-visible { outline: 3px solid #0e7f17; outline-offset: 2px; }
.grc-slot.is-set { color: #0a5f11; background: #dff3df; border-bottom-style: solid; }
.grc-slot.is-pref.is-set { color: #fff; background: #0e7f17; border-bottom-color: #0a5f11; border-radius: 6px; padding: 0 7px; }
.grc-phrase-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-top: 14px; font-size: .95rem; }
.grc-phrase-hint { color: #5d655f; font-size: .9rem; }
.grc-phrase-hint[hidden] { display: none; }
.grc-phrase-actions .grc-actifs { display: inline; color: #1f2420; font-weight: 700; }
.grc-phrase-actions .grc-actifs[hidden] { display: none; }
.grc-phrase-actions .grc-reset { color: #5d655f; }
.grc-voir { margin-left: auto; height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: #0e7f17; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.grc-voir:hover { background: #0a5f11; }

/* Panneaux de choix : glissent du bas sur téléphone, fenêtre centrée sur ordinateur */
html.grc-sheet-lock { overflow: hidden; }
.grc-sheet-back { position: fixed; inset: 0; z-index: 9998; background: rgba(20, 24, 21, .5); }
.grc-sheet-back[hidden], .grc-sheet[hidden] { display: none; }
.grc-sheet { position: fixed; z-index: 9999; left: 0; right: 0; bottom: 0; max-height: 78vh; display: flex; flex-direction: column; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); color: #1f2420; animation: grc-up .22s ease-out; }
@keyframes grc-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.grc-sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: #d6d6d6; margin: 10px auto 2px; }
.grc-sheet-head { padding: 8px 20px 10px; border-bottom: 1px solid #ecefeb; }
.grc-sheet-head strong { display: block; font-size: 1.25rem; font-weight: 900; }
.grc-sheet-head span { display: block; font-size: .9rem; color: #5d655f; margin-top: 2px; }
.grc-sheet-list { flex: 1; overflow-y: auto; padding: 6px 12px; -webkit-overflow-scrolling: touch; }
.grc-sheet-list .grc-opt { min-height: 46px; padding: 0 8px; border-radius: 10px; font-size: 1rem; }
.grc-sheet-list .grc-opt:hover { background: #f4faf3; }
.grc-sheet-list .grc-opt span { flex: 1; font-weight: 600; }
.grc-sheet-foot { display: flex; gap: 10px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid #ecefeb; }
.grc-sheet-clear { height: 48px; padding: 0 18px; border-radius: 999px; border: 1.5px solid #c9c9c9; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: #1f2420; }
.grc-sheet-ok { flex: 1; height: 48px; border-radius: 999px; border: 0; background: #0e7f17; color: #fff; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; }
@media (min-width: 700px) {
	.grc-sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); max-height: 80vh; transform: translate(-50%, -50%); border-radius: 18px; animation: none; }
	.grc-sheet-grip { display: none; }
	.grc-sheet-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; align-content: start; }
}
@media (max-width: 640px) {
	.grc-phrase-box { padding: 14px 14px 12px; border-radius: 14px; }
	.grc-phrase { font-size: 1.3rem; line-height: 1.55; margin-top: 12px; }
	.grc-voir { height: 42px; padding: 0 16px; }
	.grc-membre { padding: 9px 12px; font-size: .88rem; }
}
/* Neutralise les styles de bouton du thème sur les mots de la phrase */
.grc-phrase .grc-slot { border: 0 !important; border-bottom: 2.5px dashed #13b21f !important; box-shadow: none !important; text-transform: none; letter-spacing: inherit; margin: 0; padding: 0 2px; min-height: 0; }
.grc-phrase .grc-slot.is-set { border-bottom-style: solid !important; }
.grc-phrase .grc-slot.is-pref.is-set { border-bottom-color: #0a5f11 !important; padding: 0 6px; }
.grc-sheet-clear, .grc-sheet-ok, .grc-voir { font-size: 1rem !important; line-height: 1.2; text-transform: none; }

/* ===================== Mon espace : barre « Mon régime » + suivi ===================== */
.grc-regime-carte { padding: 14px !important; }
.grc-regime-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px !important; border-radius: 14px; border: 2px solid #0e7f17 !important; background: #f0faf0 !important; font: inherit; text-align: left; cursor: pointer; color: #1f2420; box-shadow: none; text-transform: none; }
.grc-regime-btn:hover { background: #e4f5e4 !important; }
.grc-regime-btn:focus-visible { outline: 3px solid #0e7f17; outline-offset: 2px; }
.grc-regime-btn .grc-pref-nb { width: 38px; height: 38px; }
.grc-regime-txt { flex: 1; min-width: 0; }
.grc-regime-lbl { display: block; font-size: .78rem; font-weight: 800; color: #3c5a40; text-transform: uppercase; letter-spacing: .06em; }
.grc-regime-val { display: block; font-size: 1.08rem; font-weight: 800; color: #0a5f11; line-height: 1.3; }
.grc-regime-btn svg { width: 22px; height: 22px; flex: none; color: #0e7f17; }
.grc-regime-info { margin: 10px 2px 0; font-size: .92rem; color: #5d655f; }
.grc-regime-info a { color: #0e7f17; font-weight: 700; }
.grc-suivi { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; background: #fff8e1; border-color: #f2d27a !important; }
.grc-suivi div { flex: 1 1 260px; }
.grc-suivi strong { display: block; font-size: 1.05rem; }
.grc-suivi span { display: block; font-size: .92rem; color: #5d5233; margin-top: 2px; }
.grc-suivi-btn { flex: none; display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 999px; background: #0e7f17; color: #fff !important; font-weight: 800; text-decoration: none !important; }
.grc-suivi-btn:hover { background: #0a5f11; }
