/* ============================================
   SCAM CHECKER – Senior-friendly styles
   Clean, high-contrast, large typography
   ============================================ */

/* --- Reset & base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #0071e3;          /* Apple-like blue */
  --accent-hover: #005bb5;
  --danger: #d92d20;
  --danger-hover: #b42318;
  --bg: #f9f9fb;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-muted: #4a4a4f;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

html {
  font-size: 20px;            /* Base 20px for seniors */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header / Brand --- */
.site-header {
  text-align: center;
  padding: 1rem 1.5rem;
}

.brand {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* --- Screens --- */
.screen {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 6rem;
}

.screen.active {
  display: flex;
}

.container {
  max-width: 720px;
  width: 100%;
  text-align: center;
}

/* --- Typography --- */
.headline {
  font-size: 2.2rem;         /* ~44px */
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.subtitle {
  font-size: 1.2rem;         /* ~24px */
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.credibility {
  font-size: 0.85rem;        /* ~17px – small but readable */
  color: #6e6e73;
  margin-bottom: 2.5rem;
  line-height: 1.4;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

/* Visible focus ring for keyboard navigation */
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn-huge {
  font-size: 1.4rem;         /* ~28px */
  min-height: 72px;
  padding: 1.1rem 3rem;
  width: 100%;
  max-width: 400px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background: #f0f5ff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-danger:hover {
  background: var(--danger-hover);
}

/* --- "How this works" disclosure (Option B) --- */
.how-it-works {
  max-width: 480px;
  margin: 2rem auto 0;
  text-align: left;
}

.how-it-works summary {
  font-size: 1rem;           /* 20px at base */
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0.75rem 0;
  list-style: none;          /* Remove default triangle */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  text-align: center;
  min-height: 64px;          /* Touch-target requirement */
  border-radius: 8px;
}

/* Custom disclosure indicator */
.how-it-works summary::before {
  content: "▸";
  font-size: 0.9rem;
  transition: transform 0.2s;
  display: inline-block;
}

.how-it-works[open] summary::before {
  transform: rotate(90deg);
}

/* Remove default marker in webkit/blink */
.how-it-works summary::-webkit-details-marker {
  display: none;
}

/* Focus ring for keyboard navigation */
.how-it-works summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.how-it-works summary:hover {
  color: var(--accent-hover);
}

.how-it-works-body {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-top: 0.5rem;
  border: 1px solid #e5e5ea;
}

.how-it-works-body p {
  font-size: 1rem;            /* 20px – meets accessibility minimum */
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.how-it-works-body p:last-child {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--text);
}

/* --- Mic area (listening screen) --- */
.mic-area {
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Pulsing circle behind mic */
.mic-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mic-pulse 2s ease-in-out infinite;
  color: var(--accent);
}

@keyframes mic-pulse {
  0%, 100% { transform: scale(1); background: rgba(0, 113, 227, 0.08); }
  50%      { transform: scale(1.08); background: rgba(0, 113, 227, 0.15); }
}

/* Waveform bars */
.waveform {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
}

.wave-bar {
  width: 6px;
  border-radius: 3px;
  background: var(--accent);
  animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 32px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 40px; animation-delay: 0.3s; }
.wave-bar:nth-child(5) { height: 32px; animation-delay: 0.4s; }
.wave-bar:nth-child(6) { height: 20px; animation-delay: 0.5s; }
.wave-bar:nth-child(7) { height: 12px; animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.4); }
}

/* Timer */
.timer {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

/* --- Video (result screen) --- */
.video-wrapper {
  position: relative;
  width: 100%;
  margin: 1.5rem auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
}

.result-video {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

/* Autoplay-blocked overlay */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}

.play-overlay:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -4px;
}

.play-overlay[hidden] {
  display: none;
}

/* Result screen advice */
.result-advice {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.4;
}

/* Button row */
.btn-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* --- Red flags informational section --- */
.red-flags {
  max-width: 480px;
  margin: 2.5rem auto 0;
  text-align: left;
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  border: 1px solid #e5e5ea;
}

.red-flags-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.red-flags-list {
  list-style: none;
  padding: 0;
}

.red-flags-list li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0.35rem 0 0.35rem 1.25rem;
  position: relative;
}

.red-flags-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid #e5e5ea;
  background: var(--surface);
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.footer-notice {
  font-size: 0.7rem;
  color: #8e8e93;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .mic-circle {
    animation: none;
  }
  .wave-bar {
    animation: none;
  }
  .btn {
    transition: none;
  }
  .how-it-works summary::before {
    transition: none;
  }
}

/* --- Responsive tweaks --- */
@media (max-width: 480px) {
  html {
    font-size: 18px;
  }
  .headline {
    font-size: 1.8rem;
  }
  .btn-huge {
    font-size: 1.25rem;
    min-height: 64px;
    padding: 0.85rem 1.5rem;
  }
  .screen {
    padding: 1.5rem 1rem 5rem;
  }
  .how-it-works {
    max-width: 100%;
  }
  .how-it-works-body {
    padding: 1rem 1.25rem;
  }
  .red-flags {
    max-width: 100%;
    padding: 1.25rem 1.25rem;
  }
}

@media (min-width: 768px) {
  .headline {
    font-size: 2.8rem;
  }
  .btn-row {
    flex-direction: row;
    justify-content: center;
  }
  .btn-row .btn-huge {
    width: auto;
    min-width: 220px;
  }
}
