/* ==========================================================
   Kétogenic — Une couleur par boîte, de grosses tuiles illustrées
   Ma journée = vert · Apprendre = orange · Suivre = turquoise · Plus = encre
   ========================================================== */
:root {
  --day: #4f8a2a; --day-soft: #eaf3de; --day-ink: #27500a;
  --learn: #e0951f; --learn-soft: #faeeda; --learn-ink: #633806;
  --track: #1d9e75; --track-soft: #e1f5ee; --track-ink: #085041;
  --more: #5f5e5a; --more-soft: #f1efe8; --more-ink: #2c2c2a;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
.zone-day { --z: var(--day); --zs: var(--day-soft); --zi: var(--day-ink); }
.zone-learn, body[data-zone="learn"] { --z: var(--learn); --zs: var(--learn-soft); --zi: var(--learn-ink); }
.zone-track, body[data-zone="track"] { --z: var(--track); --zs: var(--track-soft); --zi: var(--track-ink); }
.zone-more, body[data-zone="more"] { --z: var(--more); --zs: var(--more-soft); --zi: var(--more-ink); }
body[data-zone="day"] { --z: var(--day); --zs: var(--day-soft); --zi: var(--day-ink); }

/* ---------- Navigation colorée ---------- */
.side-nav button[data-z="day"] { --c: var(--day); }
.side-nav button[data-z="learn"] { --c: var(--learn); }
.side-nav button[data-z="track"] { --c: var(--track); }
.side-nav button[data-z="more"] { --c: var(--more); }
.side-nav button .ic { color: var(--c); }
.side-nav button.active { color: var(--text); }
.side-nav button.active .ic { color: #fff !important; background: var(--c) !important; border-radius: 10px; width: 32px; height: 32px; transform: scale(1); transition: transform 300ms var(--spring); }
.side-nav button.active::after { background: var(--c) !important; }
.side-nav button:active .ic { transform: scale(.9); }
.subnav button.active::after { background: var(--z) !important; height: 3px; border-radius: 2px; }
.subnav button.active { color: var(--zi) !important; }
.back { color: var(--z) !important; }
.topbar h1 { transition: color 200ms; }

/* ---------- Illustration « spot » (cercle + pastilles + icône) ---------- */
.spot { position: relative; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 28px; background: var(--zs); color: var(--z); flex: none; }
.spot i { position: absolute; border-radius: 50%; background: var(--z); opacity: .18; }
.spot i:nth-child(1) { width: 18px; height: 18px; top: -5px; right: 8px; }
.spot i:nth-child(2) { width: 10px; height: 10px; bottom: 8px; left: -4px; opacity: .3; }
.spot i:nth-child(3) { width: 34px; height: 34px; bottom: -8px; right: -8px; opacity: .1; }
.spot .ic-svg { position: relative; transition: transform 400ms var(--spring); }
.spot-learn { --z: var(--learn); --zs: var(--learn-soft); }
.spot-track { --z: var(--track); --zs: var(--track-soft); }
.spot-more { --z: var(--more); --zs: var(--more-soft); }
.spot-day { --z: var(--day); --zs: var(--day-soft); }

/* ---------- Tuiles des boîtes ---------- */
.zhub { display: grid; gap: 18px; }
.ztiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ztile { position: relative; display: grid; justify-items: start; gap: 6px; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 20px; border-radius: 22px; background: #fff; border: 1.5px solid var(--line); animation: tileIn 500ms var(--e-out) both; animation-delay: calc(var(--i) * 70ms); transition: transform 200ms var(--e-out), border-color 200ms, box-shadow 200ms; }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.ztile .spot { margin-bottom: 8px; }
.ztile b { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.15; }
.ztile small { color: var(--text-2); font-size: 14.5px; }
.ztile .zt-go { position: absolute; top: 20px; right: 20px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--zs); color: var(--z); transition: transform 250ms var(--spring); }
.ztile:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .ztile:hover { border-color: var(--z); transform: translateY(-4px); box-shadow: 0 18px 34px -24px var(--z); }
  .ztile:hover .spot .ic-svg { transform: scale(1.12) rotate(-6deg); }
  .ztile:hover .zt-go { transform: translateX(3px); }
}
.ztile.wide { grid-column: 1 / -1; grid-template-columns: auto 1fr; column-gap: 18px; align-items: center; }
.ztile.wide .spot { grid-row: span 2; margin: 0; }
.ztile.lk { background: #fcfbf8; }
.zt-lock { position: absolute; top: 20px; right: 20px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--zi); background: var(--zs); padding: 6px 10px; border-radius: 99px; }
.zbanner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-radius: 18px; background: var(--zs) !important; border: 0 !important; color: var(--zi); }
.zbanner b { display: block; font-size: 16px; }
.zbanner p { margin: 2px 0 0; font-size: 14px; color: var(--zi); opacity: .85; }
.zbanner .btn-primary { background: var(--zi); border-color: var(--zi); }

/* ---------- Accueil : Ma journée ---------- */
.dayc { display: grid; gap: 16px; padding: 22px; border-radius: 24px; background: var(--day-soft); color: var(--day-ink); animation: tileIn 500ms var(--e-out) both; }
.dayc-top { display: flex; align-items: center; gap: 18px; }
.dayc-top h3 { margin: 4px 0 2px; font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--day-ink); }
.dayc-top p { margin: 0; font-size: 14.5px; color: #3b6d11; }
.dayc .label { color: #3b6d11; }
.dayc-ring { --p: 0; flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; color: #fff; background: radial-gradient(closest-side, var(--day) 79%, transparent 80%), conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.35) 0); background-color: var(--day); animation: ringPop 600ms var(--spring) both 150ms; }
@keyframes ringPop { from { transform: scale(.6); opacity: 0; } }
.dayc-ring b { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1; display: grid; place-items: center; }
.dayc-ring small { font-size: 11px; opacity: .85; }
.dayc-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; background: #fff; border: 0; font: inherit; color: var(--day-ink); cursor: pointer; transition: transform 160ms var(--e-out); }
.mini:active { transform: scale(.96); }
.mini .ic-svg { color: var(--day); }
.mini b { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.1; display: flex; align-items: center; }
.mini b span { font-size: 13px; opacity: .6; font-family: var(--font); }
.mini small { font-size: 11.5px; text-align: center; color: #3b6d11; }
.dayc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.dayc-week span { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: #3b6d11; text-transform: capitalize; }
.dayc-week span::before { content: ""; width: 100%; height: 8px; border-radius: 4px; background: rgba(79,138,42,.18); }
.dayc-week .wg::before { background: var(--day); } .dayc-week .wo::before { background: #e0951f; } .dayc-week .wr::before { background: var(--warm); }
.dayc-week small { font-size: 11px; }
.btn-light { justify-self: start; background: #fff; color: var(--day-ink); border: 0; }

.todo { padding: 20px 22px; border-radius: 22px !important; }
.todo-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.todo-top h3 { margin: 0; font-size: 20px; }
.todo-count { font-weight: 700; color: var(--day); }
.todo .rc-bar { margin: 0 0 6px; height: 8px; border-radius: 4px; }
.todo .rc-bar i { background: var(--day); }
.todo .rc-item .box { border-radius: 50%; width: 26px; height: 26px; }
.todo .rc-item.done .box { background: var(--day); border-color: var(--day); animation: tick 400ms var(--spring); }
@keyframes tick { from { transform: scale(.6); } }

/* ---------- Accueil : les 2 boîtes ---------- */
.zcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.zcard { position: relative; display: flex; align-items: center; gap: 16px; text-align: left; font: inherit; cursor: pointer; padding: 18px; border-radius: 22px; border: 0; background: var(--zs); color: var(--zi); animation: tileIn 500ms var(--e-out) both 120ms; transition: transform 200ms var(--e-out); }
.zcard + .zcard { animation-delay: 200ms; }
.zcard .spot { width: 60px; height: 60px; border-radius: 20px; background: var(--z); color: #fff; }
.zcard .spot i { background: #fff; }
.zcard b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--zi); }
.zcard small { color: var(--zi); opacity: .8; font-size: 14px; }
.zc-txt { flex: 1; }
.zc-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--z); transition: transform 250ms var(--spring); }
.zcard .zt-lock { position: static; background: #fff; }
.zcard:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .zcard:hover { transform: translateY(-3px); } .zcard:hover .zc-go { transform: translateX(3px); } .zcard:hover .spot .ic-svg { transform: scale(1.1) rotate(-6deg); } }

/* ---------- Accueil : en-tête plus chaleureux ---------- */
.day-head h2 { font-size: clamp(36px, 5vw, 52px); }
.today { gap: 16px !important; }

/* ---------- Paywall dans la couleur de la boîte ---------- */
body[data-zone="track"] .pw-ic { background: var(--track-soft); color: var(--track); }
body[data-zone="track"] .pw-list li .ic-svg { color: var(--track); }

@media (max-width: 700px) {
  .ztiles, .zcards { grid-template-columns: 1fr; }
  .ztile { grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; padding: 16px; }
  .ztile .spot { grid-row: span 2; margin: 0; width: 64px; height: 64px; border-radius: 20px; }
  .ztile .spot .ic-svg { width: 30px; height: 30px; }
  .ztile b { font-size: 19px; padding-right: 34px; }
  .ztile .zt-go, .zt-lock { top: 16px; right: 14px; }
  .ztile .zt-go { width: 30px; height: 30px; }
  .ztile.lk .zt-lock { font-size: 0; padding: 7px; gap: 0; }
  .dayc { padding: 18px; }
  .dayc-ring { width: 82px; height: 82px; }
  .side-nav button.active .ic { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .ztile, .zcard, .dayc, .dayc-ring { animation: none !important; } }

/* Tuiles plus vives : pastille pleine, icône blanche */
.ztile .spot { background: var(--z); color: #fff; }
.ztile .spot i { background: #fff; opacity: .28; }
.ztile .spot i:nth-child(3) { display: none; }
.ztile .spot i:nth-child(1) { top: 8px; right: 8px; width: 10px; height: 10px; }
.ztile .spot i:nth-child(2) { bottom: 9px; left: 9px; width: 6px; height: 6px; opacity: .45; }
.ztile { background: linear-gradient(180deg, #fff, #fff) padding-box; }
.ztile:nth-child(odd) .spot { transform: rotate(-3deg); }
.ztile:nth-child(even) .spot { transform: rotate(3deg); }
@media (max-width: 700px) { .ztile .spot .ic-svg { width: 34px; height: 34px; stroke-width: 1.9; } }

/* ---------- Photo dans les tuiles ---------- */
.ztile { padding-right: 46%; min-height: 200px; overflow: visible; }
.zt-photo { position: absolute; top: 12px; right: 12px; bottom: 12px; width: calc(44% - 12px); border-radius: 16px; overflow: visible; }
.zt-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; transition: transform 600ms var(--e-out); }
.ztile:hover .zt-photo img { transform: scale(1.03); }
.zt-photo .deco.t1 { left: -18px; bottom: -14px; width: 50px; height: 50px; --r: -10deg; }
.ztile .zt-go, .ztile .zt-lock { top: 22px; right: 22px; z-index: 2; background: #fff; box-shadow: 0 6px 14px -8px rgba(28,33,24,.35); }
.ztile.wide { padding-right: 46%; }
@media (max-width: 700px) {
  .ztile, .ztile.wide { padding-right: 112px; min-height: 0; }
  .zt-photo { width: 92px; top: 10px; bottom: 10px; right: 10px; }
  .zt-photo .deco.t1 { width: 36px; height: 36px; left: -12px; bottom: -10px; }
  .ztile .zt-go { display: none; }
  .ztile .zt-lock { top: 16px; right: 16px; }
}
.ztile.wide { align-content: center; grid-template-rows: auto auto; row-gap: 4px; }

/* Menu : libellés courts sur mobile, lien Accueil */
.nav-home { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-2); font-weight: 600; padding: 10px 12px; border-radius: 8px; --c: var(--more); }
.nav-home .ic { color: var(--c); }
.nav-home:hover { color: var(--text); background: rgba(28,33,24,.04); }
.nl-short { display: none; }
@media (max-width: 900px) {
  .nl-full { display: none; } .nl-short { display: inline; }
  .nav-home { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 10.5px; flex: 1 1 0; }
  .side-nav button { font-size: 10px !important; padding: 8px 1px !important; }
}
.nav-home .ic { width: 26px; height: 26px; display: grid; place-items: center; flex: none; } .nav-home .ic svg { width: 20px; height: 20px; display: block; }
