/* Outils Mama4care — même design system que le site (rose/prune/crème). */
:root {
  --rose: #F43F6A; --rose-deep: #C81E4E; --rose-soft: #FDE7EE;
  --plum: #33121F; --ink: #2B1B26; --muted: #8A6E7C;
  --cream: #FBF5F0; --blush: #FBEFF3; --border: #F0DCE4;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Inter, system-ui, sans-serif; background: var(--cream); color: var(--ink); line-height: 1.55; }
a { color: var(--rose-deep); text-decoration: none; }
button { font-family: inherit; }

.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(251, 245, 240, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-nav .inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 18px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.brand img { border-radius: 9px; }
.m4c-4 { color: var(--rose); }
.site-nav .links { display: flex; gap: 16px; margin-inline-start: auto; font-weight: 600; font-size: .92rem; }
.site-nav .links a { color: var(--ink); }
.site-nav .links a.active { color: var(--rose-deep); }
.lang-switch { display: flex; gap: 5px; }
.lang-pill { display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: .8rem; cursor: pointer; }
.lang-pill.active { background: var(--rose); border-color: var(--rose); color: #fff; }

.wrap { max-width: 760px; margin: 0 auto; padding: 26px 18px 60px; }
.tool-hero { text-align: center; padding: 26px 0 18px; }
.tool-hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; }
.tool-hero p { color: var(--muted); margin-top: 10px; max-width: 560px; margin-inline: auto; }

.calc-card { background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: 0 10px 30px rgba(51, 18, 31, .06); }
.method-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.method-pill { border: 1px solid var(--border); background: var(--blush); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .88rem; cursor: pointer; }
.method-pill.active { background: var(--rose); border-color: var(--rose); color: #fff; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field input, .field select { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--rose); }
.field .inline { display: flex; align-items: center; gap: 8px; }
.field .inline input { width: 90px; }
.field .inline span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.err { color: #B91C1C; font-size: .86rem; min-height: 1.2em; margin: 4px 0 8px; }
.primary { width: 100%; border: none; background: var(--rose); color: #fff; font-weight: 800; font-size: 1rem; border-radius: 999px; padding: 13px; cursor: pointer; }
.primary:hover { background: var(--rose-deep); }

.result { margin-top: 20px; background: var(--rose-soft); border-radius: 16px; padding: 18px; text-align: center; }
.res-label { font-size: .85rem; font-weight: 700; color: var(--rose-deep); text-transform: uppercase; letter-spacing: .04em; }
.res-date { font-size: clamp(1.25rem, 3.5vw, 1.7rem); font-weight: 800; margin: 6px 0 12px; }
.progress { height: 8px; background: #fff; border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--rose), var(--rose-deep)); border-radius: 999px; transition: width .6s ease; }
html[dir="rtl"] .progress .bar { background: linear-gradient(-90deg, var(--rose), var(--rose-deep)); }
.res-line { font-size: .95rem; margin-top: 4px; }
.res-line.strong { font-weight: 800; color: var(--rose-deep); }

.privacy-note { margin-top: 16px; font-size: .84rem; color: var(--muted); text-align: center; }

.tool-section { margin-top: 34px; }
.tool-section h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 12px; }
.tool-section ul { padding-inline-start: 20px; display: grid; gap: 8px; color: var(--ink); }
.tool-section details { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin-bottom: 8px; }
.tool-section summary { font-weight: 700; cursor: pointer; }
.tool-section details p { margin-top: 8px; color: var(--muted); }

.disclaimer { margin-top: 26px; font-size: .82rem; color: var(--muted); background: var(--blush); border-radius: 14px; padding: 12px 16px; }

.tool-cta { margin-top: 34px; text-align: center; background: var(--plum); color: #fff; border-radius: 22px; padding: 30px 22px; }
.tool-cta h2 { font-size: 1.3rem; }
.tool-cta p { color: rgba(255, 255, 255, .8); margin: 8px auto 16px; max-width: 460px; }
.cta-btn { display: inline-block; background: var(--rose); color: #fff; font-weight: 800; border-radius: 999px; padding: 12px 26px; }

.site-footer { text-align: center; padding: 26px 16px 40px; color: var(--muted); font-size: .85rem; }
.site-footer p { margin-top: 10px; max-width: 640px; margin-inline: auto; }

/* ── Vérificateur d'aliments ─────────────────────────────────────────────── */
.examples { margin-top: 14px; }
.ex-label { font-size: .84rem; color: var(--muted); font-weight: 700; display: block; margin-bottom: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--rose); color: var(--rose-deep); }
.chip.avoid { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.chip.caution { background: #FFFBEB; border-color: #FCD34D; color: #92400E; }
.chip.safe { background: #F0FDF4; border-color: #86EFAC; color: #166534; }

#foodResults { margin-top: 18px; display: grid; gap: 12px; }
.food-card { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: #fff; border-inline-start-width: 5px; }
.food-card.avoid { border-inline-start-color: #DC2626; }
.food-card.caution { border-inline-start-color: #D97706; }
.food-card.safe { border-inline-start-color: #16A34A; }
.food-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.food-head h3 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.verdict { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: .76rem; font-weight: 800; }
.verdict.avoid { background: #FEE2E2; color: #991B1B; }
.verdict.caution { background: #FEF3C7; color: #92400E; }
.verdict.safe { background: #DCFCE7; color: #166534; }
.food-notes { font-size: .93rem; }
.food-alt { margin-top: 8px; font-size: .88rem; color: var(--muted); }
.food-empty { text-align: center; padding: 22px 12px; color: var(--muted); }
.food-empty-title { font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.group-title { font-size: .95rem; font-weight: 800; margin: 18px 0 8px; }
.group-title.avoid { color: #991B1B; }
.group-title.caution { color: #92400E; }
.group-title.safe { color: #166534; }
.muted { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.cross-link { margin-top: 14px; font-size: .9rem; }
.cross-link a { color: #fff; text-decoration: underline; opacity: .85; }
#foodInput { font-size: 1.02rem; }

/* ── Bandeau profil partagé ──────────────────────────────────────────────── */
.profile-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; background: var(--blush); border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; margin-bottom: 18px; font-size: .9rem; }
.pb-week { font-weight: 800; color: var(--rose-deep); }
.pb-reset { border: none; background: none; color: var(--muted); font-size: .82rem; text-decoration: underline; cursor: pointer; }
.pb-link { font-weight: 600; color: var(--rose-deep); }

/* ── Emplacements d'images (retirés si le fichier n'existe pas encore) ───── */
.tool-figure { margin: 0 0 20px; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, var(--blush), #fff); }
.tool-figure img { display: block; width: 100%; height: auto; }

/* ── Index des outils ────────────────────────────────────────────────────── */
.tool-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tool-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--rose); transform: translateY(-2px); }
.tool-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.tool-card p { font-size: .88rem; color: var(--muted); }

/* ── Substances : la grille des phases ───────────────────────────────────── */
.sub-meta { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.phase-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 12px; }
.phase-cell { text-align: center; border-radius: 10px; padding: 6px 2px; border: 1px solid var(--border); background: #fff; }
.phase-cell.now { outline: 2px solid var(--rose); outline-offset: 1px; }
.phase-cell.avoid { background: #FEE2E2; border-color: #FCA5A5; }
.phase-cell.caution { background: #FEF3C7; border-color: #FCD34D; }
.phase-cell.safe { background: #DCFCE7; border-color: #86EFAC; }
.phase-name { display: block; font-size: .64rem; font-weight: 700; color: var(--muted); }
.phase-val { display: block; font-size: 1rem; font-weight: 800; }

/* ── Croissance ──────────────────────────────────────────────────────────── */
.res-line.ok { color: #166534; }
.res-line.warn { color: #B45309; }
.limit-note { margin-top: 12px; background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 12px; padding: 10px 14px; font-size: .86rem; }

/* ── Calendrier ──────────────────────────────────────────────────────────── */
.ms-list { display: grid; gap: 6px; margin-bottom: 16px; }
.ms-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.ms-row.past { opacity: .5; }
.ms-week { font-weight: 800; color: var(--rose-deep); font-size: .82rem; }
.ms-date { color: var(--muted); font-size: .82rem; }

/* ── Signaux d'alerte ────────────────────────────────────────────────────── */
.flag-list { display: grid; gap: 12px; margin-bottom: 22px; }
.flag-card { background: #fff; border: 1px solid var(--border); border-inline-start: 5px solid #DC2626; border-radius: 16px; padding: 16px; }
.flag-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.flag-card p { font-size: .93rem; }
.flag-action { margin-top: 8px; font-weight: 700; color: #991B1B; }

/* ── Mode nuit : gros boutons, une main, dans le noir ────────────────────── */
body.night { background: #12070E; color: #F6EAF0; }
body.night .site-nav { background: rgba(18, 7, 14, .92); border-bottom-color: #2E1B26; }
body.night .site-nav .links a, body.night .brand { color: #F6EAF0; }
body.night .lang-pill { background: #1E0F18; border-color: #3A2330; color: #F6EAF0; }
body.night .lang-pill.active { background: var(--rose); border-color: var(--rose); }
body.night .tool-hero p { color: #C9AFBE; }
body.night .profile-bar { background: #1E0F18; border-color: #3A2330; }
body.night .tool-figure { background: linear-gradient(135deg, #1E0F18, #12070E); }
.night-block { background: #1B0D16; border: 1px solid #33202C; border-radius: 22px; padding: 22px; margin-bottom: 16px; text-align: center; }
.night-block h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 14px; color: #F6EAF0; }
.big-btn { width: 100%; border: none; border-radius: 20px; background: var(--rose); color: #fff; font: inherit; font-weight: 800; font-size: 1.15rem; padding: 26px 18px; cursor: pointer; }
.big-btn.running { background: #7F1D3A; }
.big-btn.half { width: auto; flex: 1; font-size: 1rem; padding: 22px 10px; }
.side-row { display: flex; gap: 10px; }
.big-timer { font-size: 2rem; font-weight: 800; margin: 14px 0 6px; font-variant-numeric: tabular-nums; color: #F6EAF0; }
.ghost-btn { border: 1px solid #4A2E3D; background: none; color: #C9AFBE; border-radius: 999px; padding: 8px 18px; font: inherit; font-size: .85rem; cursor: pointer; margin-top: 10px; }
.rule-note { margin-top: 14px; font-size: .82rem; color: #B295A5; text-align: start; line-height: 1.5; }
body.night .res-line { color: #E7D3DE; }
body.night .res-line.strong { color: #FFB3C7; }
body.night .res-line.strong.warn { color: #FCA5A5; }
body.night .disclaimer { background: #1B0D16; color: #B295A5; }
body.night .tool-cta { background: #1B0D16; border: 1px solid #33202C; }
body.night .site-footer { color: #8E7382; }

@media (max-width: 560px) {
  .site-nav .links { display: none; }
  .phase-row { grid-template-columns: repeat(5, 1fr); }
  .phase-name { font-size: .58rem; }
  .ms-row { grid-template-columns: 60px 1fr; }
  .ms-date { grid-column: 2; }
}
