/* Essayez avec votre propre client : styles (mobile d'abord, sans police externe). */

:root {
  color-scheme: light dark;

  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #4d5056;
  --border: #767676;
  --line: #d9d7d0;
  --accent: #0b5c75;
  --accent-text: #ffffff;
  --accent-soft: #e3f0f4;
  --danger: #b3261e;
  --danger-text: #ffffff;
  --error: #b3261e;
  --error-soft: #fcebea;
  --notice-bg: #fff4d6;
  --notice-border: #8a5a00;
  --ok: #1d6b3a;
  --focus: #0b57d0;

  --radius: 0.75rem;
  --space: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1b1e22;
    --text: #ececec;
    --muted: #b8bcc2;
    --border: #8d9096;
    --line: #30343a;
    --accent: #7cc7e0;
    --accent-text: #06232c;
    --accent-soft: #15313b;
    --danger: #ff8a80;
    --danger-text: #3b0906;
    --error: #ff9b92;
    --error-soft: #3a1715;
    --notice-bg: #2c2410;
    --notice-border: #e0b04a;
    --ok: #7dd69c;
    --focus: #8ab4f8;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

main,
.footer {
  width: min(100% - 2rem, 40rem);
  margin-inline: auto;
}

main {
  padding-block: 1.5rem 2rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.25rem);
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.05rem;
}

p,
ul {
  margin: 0 0 0.75rem;
}

ul {
  padding-inline-start: 1.25rem;
}

li + li {
  margin-block-start: 0.35rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.eyebrow {
  display: inline-block;
  margin-block-end: 0.5rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--notice-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--notice-bg);
  font-size: 0.85rem;
  font-weight: 600;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.intro {
  margin-block-end: 1.5rem;
}

form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
}

.field {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.field.nested {
  margin: 0.75rem 0 0;
}

label,
legend {
  display: block;
  margin-block-end: 0.35rem;
  font-weight: 600;
}

legend {
  padding: 0;
}

.tag {
  font-weight: 400;
  color: var(--muted);
}

input[type="text"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: max(1rem, 1em);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

textarea {
  resize: vertical;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border: 2px solid var(--error);
  background: var(--error-soft);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-block: 0.4rem;
}

.choice input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
}

.choice label {
  margin: 0;
  font-weight: 400;
}

.hint,
.counter {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.counter {
  text-align: end;
}

.error {
  margin: 0.35rem 0 0;
  color: var(--error);
  font-weight: 600;
}

.error::before {
  content: "Erreur\00A0: ";
}

.call {
  border-top: 1px solid var(--line);
  padding-block-start: 1.25rem;
}

.privacy {
  margin-block-end: 1rem;
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.privacy ul {
  margin: 0;
}

.demo-notice {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-inline-start-width: 6px;
  border-radius: 0.5rem;
  font-weight: 500;
}

.demo-notice:empty {
  display: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1rem;
}

.button {
  min-height: 52px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-size: max(1rem, 1em);
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.button.primary {
  flex: 1 1 16rem;
  color: var(--accent-text);
  background: var(--accent);
}

.button.danger {
  flex: 1 1 10rem;
  color: var(--danger-text);
  background: var(--danger);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.alert:empty {
  display: none;
}

.alert {
  margin-block: 0 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--error);
  border-radius: 0.5rem;
  background: var(--error-soft);
  font-weight: 600;
}

.call-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.call-panel p {
  margin: 0;
}

.call-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

#timer-visual {
  color: var(--text);
  font-weight: 700;
}

.dot {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--border);
}

.call-panel[data-state="connecting"] .dot {
  background: var(--notice-border);
}

.call-panel[data-state="listening"] .dot {
  background: var(--ok);
}

.call-panel[data-state="speaking"] .dot {
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

.call-panel[data-state="error"] .dot {
  background: var(--error);
}

@keyframes pulse {
  50% {
    transform: scale(1.5);
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .call-panel[data-state="speaking"] .dot {
    animation: none;
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }
}

.mic-help {
  margin-block: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--notice-border);
  border-radius: 0.5rem;
  background: var(--notice-bg);
}

.mic-help h3:focus {
  outline: none;
}

.mic-help h3:focus-visible {
  outline: 3px solid var(--focus);
}

.tips {
  margin-block-start: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.tips h3 {
  color: var(--text);
}

.footer {
  padding-block: 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.noscript {
  width: min(100% - 2rem, 40rem);
  margin: 0 auto 2rem;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

@media (min-width: 48rem) {
  main {
    padding-block-start: 3rem;
  }

  form {
    padding: 1.75rem 2rem;
  }
}
