/* ================= Polices ================= */
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: normal; font-display: swap;
  src: url(fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: italic; font-display: swap;
  src: url(fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 400; font-display: swap;
  src: url(fonts/jost-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap;
  src: url(fonts/jost-latin-500-normal.woff2) format("woff2"); }

/* ================= Couleurs Energies by Ora ================= */
:root {
  --creme: #faf5ee;
  --creme-2: #f4ebe1;
  --prune: #4f1a3e;
  --prune-2: #6e2c57;
  --rose: #e9d6de;
  --or: #c9a24a;
  --or-clair: #e6cf93;
  --encre: #3a1530;
  --encre-2: #5d4053;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --barre-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--creme); color: var(--encre);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--prune-2); outline-offset: 3px; border-radius: 6px; }

/* Aquarelles en coin */
.wash { position: fixed; width: 44vw; max-width: 240px; aspect-ratio: 1; pointer-events: none;
  background-size: contain; background-repeat: no-repeat; z-index: 0; opacity: .75; }
.wash-br { width: 58vw; max-width: 320px; }
.wash-tl { top: 0; left: 0; background-image: url(img/wash-tl.webp); }
.wash-br { bottom: 0; right: 0; background-image: url(img/wash-br.webp); background-position: bottom right; }

main { position: relative; z-index: 1; max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(var(--barre-h) + env(safe-area-inset-bottom) + 32px); }

/* ================= En-tête ================= */
.entete { text-align: center; margin-bottom: 8px; }
.logo { width: 96px; height: 96px; border-radius: 50%; display: block; margin: 0 auto 6px;
  box-shadow: 0 6px 24px rgba(79, 26, 62, .12); }
h1 { font-family: var(--serif); font-weight: 500; color: var(--prune); margin: 0;
  font-size: clamp(2.4rem, 11vw, 3.2rem); line-height: 1; letter-spacing: .01em; }
h1 .t-24 { font-weight: 600; }
h1 em { display: block; font-style: italic; color: var(--prune-2); font-size: .72em; margin-top: .1em; }
h2 { font-family: var(--serif); font-weight: 500; color: var(--prune); font-size: 2.2rem; margin: 0; line-height: 1.1; }
.entete-simple { padding-top: 96px; }
.sous-titre { font-family: var(--serif); font-size: 1.2rem; color: var(--encre-2); margin: .5em auto 0; max-width: 26em; }

.filet { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--or); margin: 16px auto; max-width: 180px; }
.filet::before, .filet::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--or)); }
.filet::after { background: linear-gradient(270deg, transparent, var(--or)); }
.filet span { font-size: .8rem; }

.statut { text-align: center; font-family: var(--serif); font-size: 1.25rem; color: var(--prune); margin: 4px 0 14px; }

/* ================= Boutons ================= */
.bouton { border: 1px solid var(--or); background: rgba(255,255,255,.6); color: var(--prune);
  padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: .95rem; min-height: 44px; }
.bouton:disabled { opacity: .35; cursor: default; }
.bouton-plein { display: block; margin: 0 auto 22px; background: var(--prune); color: var(--creme);
  border-color: var(--prune); padding: 14px 26px; box-shadow: 0 8px 22px rgba(79,26,62,.25); }
.lien-install { display: block; margin: 28px auto 0; background: none; border: none; color: var(--prune-2);
  text-decoration: underline; text-underline-offset: 4px; min-height: 44px; }

/* ================= Semaines & cases ================= */
.semaine { margin: 22px 0 8px; }
.semaine-titre { text-align: center; margin-bottom: 12px; }
.semaine-titre .num { font-family: var(--sans); letter-spacing: .22em; text-transform: uppercase;
  font-size: .78rem; color: var(--prune-2); font-weight: 500; }
.semaine-titre .theme { display: block; font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--prune); }

.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.case { position: relative; aspect-ratio: 1 / 1.08; border-radius: 18px; border: 1px solid var(--or-clair);
  background: rgba(255,255,255,.72); display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--prune); transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; padding: 0; }
.case::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(201,162,74,.45); border-radius: 13px; pointer-events: none; }
.case .n { font-family: var(--serif); font-size: 2.4rem; font-weight: 500; line-height: 1; }
.case .etiquette { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; color: var(--encre-2); }
.case:active { transform: scale(.97); }

.case.fermee { background: rgba(244,235,225,.7); color: #9b8691; }
.case.fermee .etiquette { color: #9b8691; }
.case.ouverte { background: linear-gradient(160deg, var(--prune-2), var(--prune)); color: var(--creme); border-color: var(--prune); }
.case.ouverte::before { border-color: rgba(230,207,147,.55); }
.case.ouverte .etiquette { color: var(--or-clair); }
.case.aujourdhui { border: 2px solid var(--or); box-shadow: 0 0 0 4px rgba(201,162,74,.18), 0 10px 26px rgba(201,162,74,.35);
  animation: lueur 2.6s ease-in-out infinite; }
.case.aujourdhui.ouverte { animation: none; }
@keyframes lueur { 50% { box-shadow: 0 0 0 7px rgba(201,162,74,.12), 0 10px 30px rgba(201,162,74,.5); } }

/* ================= Cartes génériques ================= */
.carte { background: rgba(255,255,255,.78); border: 1px solid var(--or-clair); border-radius: 22px;
  padding: 22px; margin: 16px 0; box-shadow: 0 6px 24px rgba(79,26,62,.06); }
.carte h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--prune); margin: 0 0 8px; }
.carte p { margin: .5em 0; }
.texte-centre { text-align: center; }
.petit { font-size: .9rem; color: var(--encre-2); }
.pictos { font-weight: 500; color: var(--prune); }
#intro p { font-family: var(--serif); font-size: 1.3rem; color: var(--prune); line-height: 1.4; }
.avertissement img { border-radius: 50%; }
.avertissement p { font-family: var(--serif); font-size: 1.2rem; }
.ligne-rappel { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px;
  border-top: 1px solid rgba(201,162,74,.35); padding: 6px 0; cursor: pointer; }
.ligne-rappel input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--prune); order: 2; }
.ligne-rappel input[type=time] { font: inherit; font-size: 1.15rem; color: var(--prune); border: 1px solid var(--or-clair);
  border-radius: 12px; padding: 8px 12px; background: var(--creme); }
.ligne-rappel input[type=time]:disabled { opacity: .45; }
.precis { border-top: 1px solid rgba(201,162,74,.35); padding-top: 10px; margin-top: 6px; }
.precis .bouton { width: 100%; margin-top: 4px; }
.invite { text-align: center; margin-top: 0; }
.invite-boutons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.bouton-plein-petit { background: var(--prune); color: var(--creme); border-color: var(--prune); }
.natif main { padding-top: calc(env(safe-area-inset-top) + 32px); }
.legal { font-size: .92rem; color: var(--encre-2); }
.legal summary { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--prune); cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.legal[open] summary { margin-bottom: 6px; }
.legal a { color: var(--prune-2); }
.signature { text-align: center; font-family: var(--serif); font-size: 1.2rem; color: var(--prune); }

/* ================= Carnet ================= */
.entree { background: rgba(255,255,255,.78); border: 1px solid var(--or-clair); border-radius: 20px; padding: 18px 20px; margin: 14px 0; }
.entree button { all: unset; cursor: pointer; display: block; width: 100%; }
.entree .quand { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--prune-2); font-weight: 500; }
.entree .q { font-family: var(--serif); font-size: 1.25rem; color: var(--prune); margin: 4px 0 8px; line-height: 1.25; }
.entree .r { white-space: pre-wrap; margin: 0; color: var(--encre); }
.vide { text-align: center; font-family: var(--serif); font-size: 1.25rem; color: var(--encre-2); padding: 30px 10px; }

/* ================= Un matin ================= */
.matin { position: fixed; inset: 0; z-index: 20; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--creme); }
.matin-fond { position: fixed; inset: 0; pointer-events: none;
  background: url(img/wash-tl.webp) top left / min(46vw, 260px) no-repeat, url(img/wash-br.webp) bottom right / min(62vw, 340px) no-repeat; opacity: .8; }
.matin-carte { position: relative; max-width: 560px; margin: 0 auto; text-align: center;
  padding: calc(env(safe-area-inset-top) + 18px) 22px calc(env(safe-area-inset-bottom) + 30px); }
.matin.ouverture .matin-carte { animation: ouvrir .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ouvrir { from { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(4px); } }
.fermer { position: absolute; left: 12px; top: calc(env(safe-area-inset-top) + 10px); width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--or-clair); background: rgba(255,255,255,.75); color: var(--prune); font-size: 1.3rem; }
.m-semaine { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--prune-2); margin: 64px 0 2px; font-weight: 500; }
.m-numero { font-family: var(--serif); font-size: 1.5rem; color: var(--prune); margin: 0; }
.m-affirmation { font-size: clamp(2.2rem, 10vw, 2.9rem); line-height: 1.12; margin: 6px 0 26px; text-wrap: balance; }
.bloc { background: rgba(255,255,255,.82); border: 1px solid var(--or-clair); border-radius: 22px;
  padding: 20px 20px 18px; margin: 14px 0; text-align: center; box-shadow: 0 6px 24px rgba(79,26,62,.06); }
.bloc h3 { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 4px 18px 4px 6px;
  background: var(--prune); color: var(--creme); border-radius: 999px; font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.pastille { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--or); color: var(--prune); font-size: .95rem; font-family: var(--sans); font-weight: 500; }
.bloc p { font-size: 1.08rem; margin: 6px 0 12px; color: var(--encre); }
.case-fait { display: inline-flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--prune-2); cursor: pointer; min-height: 44px; }
.case-fait input { width: 22px; height: 22px; accent-color: var(--prune); }
.label-reponse { display: block; text-align: left; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--prune-2); margin: 6px 0 6px; font-weight: 500; }
textarea { width: 100%; border: 1px solid var(--or-clair); border-radius: 14px; padding: 12px 14px; background: var(--creme);
  resize: vertical; min-height: 110px; line-height: 1.5; font-size: 1rem; }
textarea:focus { outline: 2px solid var(--or); border-color: transparent; }
.enregistre { font-size: .8rem; color: var(--encre-2); min-height: 1.2em; margin: 4px 0 0 !important; text-align: right; }
.m-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }

/* ================= Barre du bas ================= */
.barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: rgba(250,245,238,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--or-clair); padding-bottom: env(safe-area-inset-bottom); }
.barre button { flex: 1; max-width: 180px; background: none; border: none; height: var(--barre-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .78rem; letter-spacing: .06em; color: var(--encre-2); }
.barre button span { font-size: 1.15rem; color: var(--or); }
.barre button[aria-current="page"] { color: var(--prune); font-weight: 500; }
.barre button[aria-current="page"] span { color: var(--prune); }

/* ================= Toast ================= */
.toast { position: fixed; left: 50%; bottom: calc(var(--barre-h) + env(safe-area-inset-bottom) + 16px); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .3s ease;
  background: var(--prune); color: var(--creme); padding: 12px 20px; border-radius: 999px; max-width: 90vw; text-align: center;
  font-size: .95rem; box-shadow: 0 10px 30px rgba(79,26,62,.3); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
