/* Le Rituel — DA Élégance Intense.
   Bordeaux profond, crème, cuivre, or rose. Cormorant pour la voix,
   Inter pour le geste. Mobile-first, une colonne, respiration large. */

:root {
  --bordeaux-nuit: #3F0E1A;
  --bordeaux: #5B1424;
  --cuivre: #C97C56;
  --or-rose: #D8A07C;
  --creme: #EDE2D2;
  --creme-40: rgba(237, 226, 210, 0.4);
  --creme-15: rgba(237, 226, 210, 0.15);
  --braise: 0; /* progression 0→1, pilotée par main.js */
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100dvh;
  background: linear-gradient(175deg, var(--bordeaux) 0%, var(--bordeaux-nuit) 70%);
  color: var(--creme);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: max(14px, env(safe-area-inset-top)) 24px 0;
  max-width: 430px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--cuivre);
}
.brand-icon { width: 19px; height: 19px; }
.app-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--or-rose);
}

main {
  max-width: 430px;
  margin: 0 auto;
  padding: 28px 24px calc(48px + env(safe-area-inset-bottom));
}

h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.2;
  margin: 0.6em 0 0.5em;
}

.lead { color: var(--creme); }
p, ul { margin-bottom: 1em; }

.garde { padding-left: 1.1em; }
.garde li { margin-bottom: 0.5em; }

.engagement {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--or-rose);
  border-left: 2px solid var(--cuivre);
  padding-left: 14px;
  margin: 1.4em 0;
}

/* ---- controls ---- */

.cta {
  display: block;
  width: 100%;
  margin-top: 1.6em;
  padding: 16px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--cuivre), var(--or-rose));
  color: var(--bordeaux-nuit);
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
}
.cta:disabled { opacity: 0.35; cursor: default; }

.linklike {
  display: block;
  margin: 1.2em auto 0;
  background: none;
  border: none;
  color: var(--creme-40);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.back { margin: 0 0 0.4em; padding: 0; }

label {
  display: block;
  margin-top: 1.2em;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--or-rose);
}
input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 2px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--creme-40);
  color: var(--creme);
  font-family: Inter, sans-serif;
  font-size: 1.05rem;
  border-radius: 0;
}
input:focus, textarea:focus { outline: none; border-bottom-color: var(--or-rose); }
input[readonly] { color: var(--creme-40); }

.error { color: #E8A48F; font-size: 0.9rem; }
.fine { font-size: 0.78rem; color: var(--creme-40); margin-top: 1.6em; }
.note { margin-top: 1em; color: var(--or-rose); text-align: center; }

/* ---- écran jour : flamme + progression ---- */

/* Logo officiel femme-flamme : le feu monte à l'intérieur des flammes
   avec l'avancée (4 % « la braise couve » → 100 % au jour 21). */
.flamme-wrap {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}
#flamme {
  width: 150px;
  filter: drop-shadow(0 0 calc(5px + var(--braise) * 30px) rgba(216, 160, 124, calc(0.22 + var(--braise) * 0.55)));
  animation: halo 4s ease-in-out infinite;
  transition: filter 1.5s ease;
}
#flamme .fill-level {
  transform-box: fill-box;
  transform: translateY(calc((0.96 - var(--braise) * 0.96) * 100%));
  transition: transform 1.5s ease;
}
@keyframes halo {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.93; }
}

/* B — Embrasement à l'activation : le feu monte dans tout le logo,
   tient l'incandescence, puis retombe au niveau réel de la braise. */
.ignition .fill-level {
  animation: ignite 3s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes ignite {
  0%   { transform: translateY(96%); }
  40%  { transform: translateY(0%); }
  68%  { transform: translateY(0%); }
  100% { transform: translateY(calc((0.96 - var(--braise) * 0.96) * 100%)); }
}
.ignition #flamme {
  animation: halo-burst 3s ease both;
}
@keyframes halo-burst {
  0%   { filter: drop-shadow(0 0 4px rgba(216, 160, 124, 0.2)); }
  45%  { filter: drop-shadow(0 0 46px rgba(216, 160, 124, 0.85)); }
  100% { filter: drop-shadow(0 0 calc(5px + var(--braise) * 30px) rgba(216, 160, 124, calc(0.22 + var(--braise) * 0.55))); }
}

/* C — Braises montantes : discrètes, plus présentes quand la flamme grandit. */
.flamme-wrap { position: relative; }
.braises {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: calc(0.3 + var(--braise) * 0.5);
}
.braises i {
  position: absolute;
  bottom: 6%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--or-rose);
  filter: blur(0.5px);
  opacity: 0;
  animation: monter 4.4s linear infinite;
}
.braises i:nth-child(1) { left: 36%; animation-delay: 0s;    animation-duration: 4.1s; }
.braises i:nth-child(2) { left: 46%; animation-delay: 0.9s;  width: 3px; height: 3px; }
.braises i:nth-child(3) { left: 56%; animation-delay: 1.6s;  animation-duration: 3.7s; }
.braises i:nth-child(4) { left: 63%; animation-delay: 2.4s;  width: 3px; height: 3px; animation-duration: 5s; }
.braises i:nth-child(5) { left: 41%; animation-delay: 3.1s;  animation-duration: 4.7s; }
.braises i:nth-child(6) { left: 52%; animation-delay: 3.8s;  width: 5px; height: 5px; }
@keyframes monter {
  0%   { transform: translate(0, 0); opacity: 0; }
  12%  { opacity: 0.7; }
  60%  { opacity: 0.35; }
  100% { transform: translate(9px, -150px); opacity: 0; }
}

[data-screen="jour"] { text-align: center; }
.acte {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--cuivre);
  margin: 0.8em 0 0;
}
[data-screen="jour"] h1 { margin-top: 0.1em; }

.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  list-style: none;
  padding: 0.4em 0 0;
}
.dots li {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--creme-15);
}
.dots li.done { background: var(--or-rose); }
.dots li.today {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--cuivre);
}

/* ---- lecteur ---- */

.rituel-meta { color: var(--creme-40); font-size: 0.9rem; }

.player {
  margin-top: 2em;
  padding: 26px 22px;
  border: 1px solid var(--creme-15);
  border-radius: 18px;
  text-align: center;
}
.play {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1.5px solid var(--or-rose);
  background: radial-gradient(circle at 50% 35%, rgba(216,160,124,0.18), transparent 70%);
  color: var(--creme);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  cursor: pointer;
}
.play.playing { border-style: dashed; }

.bar {
  height: 3px;
  background: var(--creme-15);
  border-radius: 2px;
  margin: 22px 0 8px;
  overflow: hidden;
}
#bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cuivre), var(--or-rose));
}
.time {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--creme-40);
  font-variant-numeric: tabular-nums;
}

/* ---- check-in ---- */

.feels { display: grid; gap: 10px; margin-top: 1.2em; }
.feels button {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--creme-15);
  background: transparent;
  color: var(--creme);
  font-family: Inter, sans-serif;
  font-weight: 300;
  font-size: 0.98rem;
  text-align: left;
  cursor: pointer;
}
.feels button.sel {
  border-color: var(--or-rose);
  background: rgba(216, 160, 124, 0.12);
}
textarea { resize: vertical; }
