/* Palette « solaire & océan » — mêmes jetons que apps/web/src/app/globals.css */
:root {
  --background: #f7f9fc;
  --foreground: #0b1f3a;
  --card: #ffffff;
  --muted: #e8eef6;
  --muted-foreground: #44546b;
  --primary: #0b3d91;
  --primary-foreground: #ffffff;
  --accent: #ffc72c;
  --accent-foreground: #0b1f3a;
  --destructive: #b42318;
  --border: #c9d4e3;
  --input: #9fb0c8;
  --ring: #1f6feb;
  --radius: 0.75rem;
  --ok: #1a7f37;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #07152b;
    --foreground: #eef3fa;
    --card: #0d2142;
    --muted: #13294d;
    --muted-foreground: #b4c2d6;
    --primary: #5b9cff;
    --primary-foreground: #07152b;
    --accent: #ffd24d;
    --accent-foreground: #07152b;
    --destructive: #ff8a80;
    --border: #234070;
    --input: #3a5a8c;
    --ring: #ffd24d;
    --ok: #4ade80;
    color-scheme: dark;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--background);
  color: var(--foreground);
  font-family:
    "Inter",
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--accent);
  color: var(--accent-foreground);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 100;
}
.skip:focus {
  top: 8px;
}
[hidden] {
  display: none !important;
}

/* Header */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.125rem;
  color: inherit;
  text-decoration: none;
}
.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.lang-switch {
  display: flex;
  gap: 4px;
}
.lang-switch button {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.lang-switch button:hover {
  background: var(--muted);
}
.lang-switch button[aria-current="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Home */
.home {
  max-width: 64rem;
  margin: 0 auto;
  padding: 40px 16px;
  display: grid;
  gap: 40px;
}
@media (min-width: 768px) {
  .home {
    grid-template-columns: 1.2fr 1fr;
    padding: 64px 16px;
  }
}
.eyebrow {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.875rem;
  margin: 0;
}
h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
  text-wrap: balance;
}
.intro {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  margin: 0 0 20px;
}
.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.features li::before {
  content: "✓";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  height: fit-content;
}
.card h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

/* Forms */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.field label,
.field legend {
  font-weight: 600;
}
.help {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin: 0;
}
.error {
  color: var(--destructive);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
}
input[type="text"],
select {
  font: inherit;
  font-size: 1.0625rem;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 2px solid var(--input);
  background: var(--background);
  color: var(--foreground);
}
input[type="text"]:focus-visible,
select:focus-visible {
  border-color: var(--ring);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 35%, transparent);
}
input[aria-invalid="true"] {
  border-color: var(--destructive);
}
.row-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-accent {
  background: var(--accent);
  color: var(--accent-foreground);
}
.btn-accent:hover:not(:disabled) {
  filter: brightness(0.95);
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-outline {
  background: transparent;
  color: inherit;
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--muted);
}
.btn-danger {
  background: var(--destructive);
  color: #fff;
}
.btn-lg {
  min-height: 56px;
  font-size: 1.125rem;
  width: 100%;
}

.preview {
  margin: 4px 0 16px;
  display: grid;
  gap: 10px;
}
.preview video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  object-fit: cover;
  transform: scaleX(-1);
}
.meter {
  height: 10px;
  border-radius: 99px;
  background: var(--muted);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ok);
  transition: width 0.08s linear;
}

/* Room */
body.room-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: #050e1d;
  color: #eef3fa;
}
.statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 8px 16px;
  background: #0b1f3a;
  font-size: 0.875rem;
}
.statusbar .title {
  font-weight: 700;
  margin-right: auto;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgb(255 255 255 / 0.08);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a99ad;
}
.pill[data-state="ok"] .dot {
  background: #4ade80;
}
.pill[data-state="warn"] .dot {
  background: #ffd24d;
}
.pill[data-state="bad"] .dot {
  background: #ff8a80;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
.grid {
  flex: 1;
  display: grid;
  gap: 8px;
  padding: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  grid-auto-rows: minmax(160px, 1fr);
  overflow: auto;
}
.grid.has-screen {
  grid-template-columns: 1fr;
}
.tile {
  position: relative;
  background: #0d2142;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 3px solid transparent;
}
.tile.speaking {
  border-color: var(--accent);
}
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile.screen video {
  object-fit: contain;
  background: #000;
}
.tile.local:not(.screen) video {
  transform: scaleX(-1);
}
.tile.screen {
  grid-column: 1 / -1;
  min-height: 50vh;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #234070;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 700;
}
.tile-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgb(0 0 0 / 0.6);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
}
.waiting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #b4c2d6;
  pointer-events: none;
}

.captions {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(960px, calc(100% - 24px));
  display: grid;
  gap: 6px;
  pointer-events: none;
}
.caption {
  background: rgb(5 14 29 / 0.85);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 1.25rem;
  line-height: 1.35;
}
.caption .who {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
}
.caption.interim .txt {
  color: #b4c2d6;
  font-style: italic;
}
.caption .badge {
  font-size: 0.6875rem;
  font-weight: 600;
  background: #3a5a8c;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
}
.captions-empty {
  text-align: center;
  color: #8a99ad;
  font-size: 0.9375rem;
  background: rgb(5 14 29 / 0.6);
  border-radius: 10px;
  padding: 8px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #0b1f3a;
}
.controls .btn {
  min-height: 52px;
  background: #234070;
  color: #fff;
}
.controls .btn[aria-pressed="false"] {
  background: #b42318;
}
.controls .btn.sharing {
  background: var(--accent);
  color: var(--accent-foreground);
}
.controls .btn-danger {
  background: #b42318;
}
.controls select {
  width: auto;
  height: 52px;
  background: #234070;
  color: #fff;
  border-color: #3a5a8c;
}
.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.audio-unlock {
  min-height: 64px;
  padding: 0 28px;
  font-size: 1.25rem;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.5);
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}
.left-screen {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 16px;
  padding: 24px;
}

@media (max-width: 640px) {
  .grid {
    grid-auto-rows: minmax(120px, 1fr);
  }
  .caption {
    font-size: 1.0625rem;
  }
  .controls .btn .lbl {
    display: none;
  }
  .controls .btn {
    min-width: 52px;
    padding: 0 14px;
  }
}
