/* ravive — charte : crème / corail / jaune doux / vert sauge */

:root {
  --bg: #faf1de;
  --card: #fdf8ec;
  --card-soft: #f7ead3;
  --ink: #33291f;
  --ink-soft: #6f6353;
  --coral: #dd7355;
  --coral-deep: #c95f42;
  --coral-soft: #f4d9cd;
  --yellow: #ecd173;
  --sage: #a8b79a;
  --radius: 28px;
  --shadow: 0 18px 50px -22px rgba(101, 66, 43, 0.35);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(60rem 40rem at 110% -10%, rgba(236, 209, 115, 0.18), transparent 60%),
    radial-gradient(50rem 36rem at -20% 110%, rgba(168, 183, 154, 0.16), transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.5;
}

.wrap {
  width: 100%;
  max-width: 430px;
  padding: 20px 20px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* --- entête --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 0 18px;
}
.brand {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.back {
  position: absolute;
  left: 0;
  top: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.back:active { background: var(--card-soft); }
.back.show { display: flex; }

/* --- carte écran --- */
.screen {
  background: var(--card);
  border: 1px solid rgba(221, 115, 85, 0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 26px 30px;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}
.screen.active { display: flex; }

.badge {
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 8px 18px;
}
.badge.sage { background: #e6ebdf; color: #5f7150; }
.badge.gold { background: #f6ecc9; color: #8a6f1f; }

.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 26px;
}

h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.2;
  margin-top: 10px;
}

.lead { color: var(--ink-soft); font-size: 0.98rem; margin-top: 14px; max-width: 30ch; }

/* --- pastilles décoratives --- */
.deco { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; }
.deco .pill { width: 44px; height: 12px; border-radius: 999px; background: var(--yellow); opacity: 0.9; }
.deco .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sage); }
.deco .tile {
  width: 92px; height: 92px; border-radius: 30px;
  display: flex; align-items: center; justify-content: center;
}
.deco .tile.rose { background: #f6ddd2; }
.deco .tile.gold { background: var(--yellow); }
.deco .tile svg { width: 54px; height: 26px; }

/* --- formulaire code --- */
.field { width: 100%; margin-top: 28px; text-align: left; }
.field label { font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 10px; }
.field input {
  width: 100%;
  border: 1.5px solid rgba(51, 41, 31, 0.14);
  border-radius: 18px;
  background: #fffdf6;
  padding: 16px 18px;
  font-size: 1.15rem;
  font-family: inherit;
  letter-spacing: 0.35em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: #c4b8a5; letter-spacing: 0.3em; }
.field input:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(221, 115, 85, 0.15); }

.error {
  display: none;
  margin-top: 14px;
  color: #b4472c;
  background: #f9e3da;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 0.9rem;
  width: 100%;
}
.error.show { display: block; }

/* --- boutons --- */
.btn {
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 600;
  padding: 16px 34px;
  width: 100%;
  margin-top: 24px;
  cursor: pointer;
  box-shadow: 0 12px 28px -12px rgba(201, 95, 66, 0.7);
  transition: transform 0.1s, background 0.15s;
}
.btn:active { transform: scale(0.98); background: var(--coral-deep); }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn.ghost {
  background: transparent;
  color: var(--coral-deep);
  box-shadow: none;
  border: 1.5px solid rgba(221, 115, 85, 0.4);
}
.btn.ghost:active { background: var(--coral-soft); }

/* --- enregistrement --- */
.wave {
  width: 100%;
  height: 96px;
  margin-top: 30px;
}
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 600;
  margin-top: 10px;
}
.timer .max { font-size: 0.95rem; color: var(--ink-soft); font-weight: 500; }

.record-btn {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 0;
  background: var(--coral);
  color: #fff;
  margin-top: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 34px -12px rgba(201, 95, 66, 0.75);
  transition: transform 0.12s;
  position: relative;
}
.record-btn:active { transform: scale(0.94); }
.record-btn.recording::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(221, 115, 85, 0.5);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}
.record-btn svg { width: 34px; height: 34px; }

.hint { color: var(--ink-soft); font-size: 0.92rem; margin-top: 18px; }

/* --- lecteur --- */
.player {
  width: 100%;
  background: #fffdf6;
  border: 1px solid rgba(51, 41, 31, 0.08);
  border-radius: 24px;
  padding: 22px 20px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 30px -18px rgba(101, 66, 43, 0.3);
}
.play-btn {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  background: var(--coral);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px -10px rgba(201, 95, 66, 0.7);
}
.play-btn:active { transform: scale(0.95); }
.play-btn svg { width: 24px; height: 24px; }
.player .meta { flex: 1; text-align: left; }
.player .meta .title { font-weight: 600; font-size: 1rem; }
.player .meta .time { color: var(--ink-soft); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.player .bars { display: flex; align-items: center; gap: 3px; height: 34px; margin-bottom: 6px; }
.player .bars span {
  width: 4px;
  border-radius: 2px;
  background: var(--coral);
  opacity: 0.85;
}

.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(51, 41, 31, 0.1);
  margin-top: 6px;
  overflow: hidden;
}
.progress i { display: block; height: 100%; width: 0; background: var(--coral); border-radius: 999px; }

/* --- pied de page --- */
.foot {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .deco-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.foot .deco-dots i { width: 26px; height: 8px; border-radius: 999px; background: var(--coral); opacity: 0.85; }
.foot .deco-dots i:nth-child(2) { width: 8px; background: var(--yellow); }
.foot .deco-dots i:nth-child(3) { width: 8px; background: var(--sage); }

/* --- pages texte (mentions légales…) --- */
.doc { text-align: left; align-items: flex-start; }
.doc h1 { font-size: 1.6rem; }
.doc h2 { font-family: 'Fraunces', Georgia, serif; font-size: 1.1rem; margin-top: 26px; }
.doc p { color: var(--ink-soft); font-size: 0.94rem; margin-top: 8px; }
.doc a { color: var(--coral-deep); }

@media (min-width: 480px) {
  .wrap { padding-top: 40px; min-height: 0; }
  body { justify-content: center; }
}
