/* Same visual language as the assistant: large friendly Arabic type, chunky
   pressable controls with a solid bottom edge, generous rounding. */

:root {
  --bg: #0e1522;
  --bg-2: #131d2e;
  --surface: #18233a;
  --line: #24314d;
  --text: #f2f6ff;
  --muted: #8fa0c0;
  --green: #58cc02;
  --green-dark: #43a302;
  --blue: #1cb0f6;
  --amber: #ffc800;
  --red: #ff4b4b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "SF Arabic", "Geeza Pro", ui-rounded, -apple-system, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  display: grid;
  place-items: start center;
}

main {
  width: min(680px, 100vw);
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-bottom: 20px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.mark {
  width: 34px; height: 34px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--green), #2fa8a0);
  box-shadow: 0 3px 0 var(--green-dark);
}

h1 { margin: 0; font-size: 26px; font-weight: 800; }

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}

.screen { padding: 0 24px; }

h2 { font-size: 27px; font-weight: 800; margin: 8px 0 12px; line-height: 1.4; }
h3 { font-size: 19px; font-weight: 800; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 14px; }

/* --------------------------------------------------------------- consent */

.consent-box {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin: 22px 0;
}

.consent-box ul { margin: 0; padding-inline-start: 22px; color: var(--muted); }
.consent-box li { margin-bottom: 8px; }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
  cursor: pointer;
  font-weight: 600;
}

.check input {
  width: 24px; height: 24px;
  margin: 4px 0 0;
  accent-color: var(--green);
  flex: none;
}

/* ---------------------------------------------------------------- prompt */

.prompt-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 5px 0 #101a2c;
}

.script-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.prompt-arabizi {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--blue);
  font-family: ui-rounded, -apple-system, system-ui, sans-serif;
}

.prompt-arabic {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.9;
}

.prompt-card hr {
  border: 0;
  border-top: 2px solid var(--line);
  margin: 18px 0;
}

/* -------------------------------------------------------------- feedback */

.feedback {
  margin: 16px 0 0;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 17px;
}

.feedback[data-kind="error"] { background: #3a1a1f; border: 2px solid #5c262e; color: #ffb4b4; }
.feedback[data-kind="ok"] { background: #14301a; border: 2px solid #235c2c; color: #b6f0a8; }

/* ---------------------------------------------------------------- meter */

.meter {
  height: 10px;
  margin: 22px 0;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--line);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 60ms linear;
}

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

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.mic {
  position: relative;
  width: 92px; height: 92px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 6px 0 var(--green-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  flex: none;
}

.mic:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--green-dark); }
.mic:disabled { opacity: 0.45; cursor: not-allowed; }

.mic svg { width: 42px; height: 42px; fill: none; stroke: #08300a; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.mic svg path:first-child { fill: #08300a; stroke: none; }

.mic[data-live="true"] { background: var(--red); box-shadow: 0 6px 0 #c93232; }
.mic[data-live="true"] svg { stroke: #3d0808; }
.mic[data-live="true"] svg path:first-child { fill: #3d0808; }

.mic[data-live="true"]::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px solid var(--red);
  animation: ring 1.5s ease-out infinite;
}

@keyframes ring {
  0% { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mic::before { animation: none !important; }
}

.hint {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
  margin: 14px 0 0;
}

.review {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  padding: 14px 28px;
  border: 0;
  border-radius: 16px;
  background: var(--green);
  color: #06210f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--green-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-dark); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: 0 4px 0 var(--green-dark); }

.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 #101a2c;
  font-size: 16px;
  padding: 12px 20px;
}

.link {
  display: block;
  margin: 34px auto 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}

/* ----------------------------------------------------------------- stats */

.stats { padding: 20px 24px 0; color: var(--muted); font-size: 15px; text-align: center; }
.stats p { margin: 10px 0 0; font-weight: 700; }

.bar {
  height: 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--line);
  overflow: hidden;
}

.bar span { display: block; height: 100%; background: var(--green); transition: width 0.4s ease; }
