:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #152335;
  --orange: #fb6340;
  --orange-soft: #ffece5;
  --muted: #8a8c94;
  --line: #e1e3e8;
  --card: #ffffff;
  --heart: #fb6340;
  --live: #29bd6b;
  --radius: 28px;
  font-family: "Lexend Deca", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; background: var(--bg); color: var(--ink); }

body { min-height: 100vh; position: relative; overflow-x: hidden; }

.hidden { display: none !important; }

/* ---------- Ciel de Paris ---------- */
.sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: 400px;
  background: linear-gradient(180deg, #cbd8e5 0%, #e7ecf1 55%, var(--bg) 100%);
  overflow: hidden;
  z-index: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
          mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.cloud { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.75); filter: blur(26px); }
.cloud.c1 { width: 360px; height: 60px; left: -60px; top: 50px; }
.cloud.c2 { width: 320px; height: 52px; right: -80px; top: 120px; opacity: 0.8; }
.skyline { position: absolute; left: 0; right: 0; bottom: 70px; width: 100%; height: 110px; opacity: 0.55; }

/* ---------- Page ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.top { display: flex; justify-content: center; padding: 6px 0 4px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.logo-mark { height: 24px; width: auto; display: block; }

.hero { text-align: center; padding: 28px 6px 34px; }

h1, h2 {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0;
}
h1 { font-size: clamp(38px, 11vw, 50px); }
h2 { font-size: 30px; margin-bottom: 8px; }

.lead {
  margin: 14px auto 0;
  max-width: 330px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 500;
  color: rgba(13, 13, 15, 0.78);
}

.live-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.live-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- Cartes ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.card.center { text-align: center; padding: 30px 20px; }

.label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.muted { color: var(--muted); font-weight: 500; }
.small { font-size: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.row-between .label { margin-bottom: 0; }

input[type="text"] {
  width: 100%;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 18px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
input[type="text"]:focus { border-color: var(--orange); background: #fff; }
input::placeholder { color: #b3b6bd; font-weight: 500; }

/* ---------- Enregistreur ---------- */
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; color: var(--muted); }

.recorder { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 4px; }

.mic {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 0;
  background: var(--orange);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(251, 99, 64, 0.4);
  transition: transform 0.15s ease, background 0.2s;
}
.mic:active { transform: scale(0.94); }
.mic .icon-mic { width: 34px; height: 34px; fill: #fff; stroke: #fff; }
.mic .icon-stop { display: none; width: 26px; height: 26px; border-radius: 7px; background: #fff; }
.mic .ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px solid rgba(251, 99, 64, 0.4);
  opacity: 0;
}
.mic.recording { background: var(--ink); }
.mic.recording .icon-mic { display: none; }
.mic.recording .icon-stop { display: block; }
.mic.recording .ring { animation: ring 1.3s ease-out infinite; }
@keyframes ring { 0% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }

.hint { margin: 10px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); text-align: center; }

/* ---------- Ondes ---------- */
.wave { display: flex; align-items: center; gap: 3px; height: 32px; }
.wave span {
  width: 3px;
  min-height: 3px;
  border-radius: 3px;
  background: rgba(13, 13, 15, 0.2);
  transition: height 0.08s linear, background 0.15s;
}
.wave span.on { background: var(--orange); }
.wave.live { height: 40px; justify-content: center; }
.wave.live span { background: var(--ink); }

/* ---------- Carte vocal (DA) ---------- */
.voice {
  margin-top: 14px;
  background: #f9f9fa;
  border-radius: 26px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.92) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }

.voice-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 15px;
  background: #8c7cee;
}
.voice-name { font-weight: 600; font-size: 16px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dotsep, .voice-timing { color: var(--muted); font-size: 14px; font-weight: 500; }
.heart { margin-left: auto; color: var(--heart); font-size: 20px; }

.voice-body { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 12px 14px; }
.voice-line { display: flex; align-items: center; gap: 12px; }
.play {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.play svg { width: 16px; height: 16px; fill: var(--ink); }
.play .i-pause { display: none; }
.play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }
.caption { margin: 10px 0 2px; font-size: 18px; line-height: 1.3; color: rgba(13, 13, 15, 0.78); }

.link-btn {
  display: block;
  margin: 12px auto 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

/* ---------- Choix du moment ---------- */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 999px; background: var(--bg); }
.seg {
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.seg.active { background: var(--ink); color: #fff; }

.minute-box { padding-top: 18px; }
.minute-value { text-align: center; font-weight: 900; font-size: 44px; letter-spacing: -0.04em; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.minute-value span { display: inline-block; min-width: 1.3em; }

input[type="range"] { width: 100%; -webkit-appearance: none; appearance: none; background: transparent; height: 32px; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--ink);
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 4px solid #fff; }

/* ---------- Boutons ---------- */
.btn {
  display: block;
  width: 100%;
  height: 60px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 12px 26px rgba(251, 99, 64, 0.35);
  transition: transform 0.15s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.3; box-shadow: none; cursor: not-allowed; }
.btn.outline { background: #fff; color: var(--ink); border: 1.2px solid var(--line); box-shadow: none; }

.status { min-height: 1.3em; margin: 12px 0 0; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.status.error {
  color: #b42318;
  background: #fff1ee;
  border: 1.5px solid #f6b4a6;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 15px;
}

/* ---------- Aide micro bloqué ---------- */
.mic-help {
  margin-top: 16px;
  padding: 16px;
  border-radius: 22px;
  background: #fff1ee;
  border: 2px solid var(--orange);
  text-align: left;
  animation: help-in 0.35s ease-out;
}
.mic-help.shake { animation: help-shake 0.45s ease-in-out; }
@keyframes help-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes help-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.mic-help-head { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--ink); }
.mic-help-icon { font-size: 22px; }
.mic-help-text { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.mic-help-steps { margin: 10px 0 0; padding-left: 22px; font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--ink); }
.mic-help-steps li + li { margin-top: 4px; }
.mic-help-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn.small { width: auto; flex: 1 1 140px; height: 46px; min-height: 46px; padding: 0 16px; font-size: 15px; }
.mic-help-alt { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #f6b4a6; font-size: 13px; color: var(--muted); display: grid; gap: 8px; }
.file-btn {
  display: flex; align-items: center; justify-content: center;
  height: 44px; border-radius: 999px; background: #fff; border: 1.2px solid var(--line);
  font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer;
}
.file-btn input { display: none; }

/* ---------- Fin ---------- */
.done { animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
.check {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; margin-top: 28px; font-size: 12px; font-weight: 500; color: var(--muted); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot-sep { margin: 0 6px; opacity: 0.5; }

/* ---------- Pages légales ---------- */
.legal { max-width: 640px; }
.legal h1 {
  font-size: clamp(28px, 8vw, 36px);
  margin: 18px 0 6px;
  text-align: left;
}
.legal-meta {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.legal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px 8px;
  box-shadow: 0 8px 28px rgba(21, 35, 53, 0.06);
}
.legal-card h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 18px 0 8px;
  line-height: 1.25;
}
.legal-card h2:first-child { margin-top: 0; }
.legal-card p,
.legal-card li {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: rgba(21, 35, 53, 0.88);
  margin: 0 0 12px;
}
.legal-card ul {
  margin: 0 0 14px;
  padding-left: 1.15em;
}
.legal-card a { color: var(--orange); font-weight: 600; text-decoration: none; }
.legal-card a:hover { text-decoration: underline; }
.legal .wordmark { text-decoration: none; color: inherit; }
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.legal-nav a { color: var(--orange); text-decoration: none; }
.muted-line { color: var(--muted) !important; font-size: 13px !important; }
