/* ==========================================================================
   Mic & Webcam Tester — shared styles
   Used by index.html, privacy.html, terms.html
   ========================================================================== */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f0f2f8;
  --border: #e1e4ee;
  --text: #1c1f2b;
  --text-muted: #5b6072;
  --brand: #3457d5;
  --brand-dark: #2740a8;
  --brand-light: #eaefff;
  --good: #1f9d55;
  --good-bg: #e6f8ed;
  --warn: #b45309;
  --warn-bg: #fff4e5;
  --bad: #c0392b;
  --bad-bg: #fdecea;
  --radius: 14px;
  --max-width: 880px;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.04), 0 8px 24px rgba(20, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video, canvas { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .dot { color: var(--brand); }

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
}

.site-nav a { color: var(--text-muted); font-weight: 500; }
.site-nav a:hover { color: var(--brand); text-decoration: none; }

/* ---- Hero ---- */
.hero {
  padding: 40px 0 8px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.hero p.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  margin: 18px 0 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trust-row span::before {
  content: "✓";
  color: var(--good);
  margin-right: 6px;
  font-weight: 700;
}

/* ---- Ad slots ---- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto;
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-height: 90px;
}

.ad-slot--leaderboard { max-width: 728px; }
.ad-slot--native { max-width: var(--max-width); min-height: 120px; }
.ad-slot--footer { max-width: 728px; }

/* ---- Tool card ---- */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0;
}

@media (max-width: 760px) {
  .tool-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.card .card-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }

.btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: #e7e9f2; }

/* Mic meter */
.meter-wrap {
  margin-top: 16px;
}

.meter-track {
  width: 100%;
  height: 18px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2ecc71 0%, #f1c40f 70%, #e74c3c 100%);
  transition: width 60ms linear;
}

canvas.waveform {
  width: 100%;
  height: 80px;
  background: var(--surface-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 12px;
}

/* Webcam preview */
.video-wrap {
  position: relative;
  background: #10121a;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8890a8;
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  margin-top: 12px;
}

.status-idle { background: var(--surface-alt); color: var(--text-muted); }
.status-good { background: var(--good-bg); color: var(--good); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.status-bad { background: var(--bad-bg); color: var(--bad); }

.status-pill .dot-ind {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.mini-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ---- Content sections (FAQ etc) ---- */
.content-section {
  margin: 44px 0;
}

.content-section h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.content-section > p.section-lede {
  color: var(--text-muted);
  margin-top: 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.faq-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 50px;
  padding: 30px 0 50px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer .footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.site-footer .footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer .footer-links a { color: var(--text-muted); }
.site-footer .footer-links a:hover { color: var(--brand); }

.legal-page main.container {
  padding-top: 40px;
  padding-bottom: 60px;
}

.legal-page h1 {
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.legal-page .updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.legal-page h2 {
  font-size: 1.15rem;
  margin-top: 34px;
}

.legal-page p, .legal-page li {
  color: #333649;
  font-size: 0.95rem;
}

.legal-page .callout {
  background: var(--brand-light);
  border: 1px solid #cdd8ff;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 0.92rem;
}
