:root {
  --bg: #0b1120;
  --panel: #0f172a;
  --card: #111827;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --border-subtle: #1f2937;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.app-body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%);
  color: var(--text-main);
  min-height: 100vh;
}

/* ================= HEADER ================= */

.app-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.7)
  );
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 30% 10%,
    #60a5fa 0,
    #1d4ed8 35%,
    #020617 95%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #eff6ff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-muted);
}

.app-main {
  max-width: 960px;
  margin: 1.75rem auto 2.5rem;
  padding: 0 1.25rem;
}

/* ================= HERO (INDEX – UPGRADED) ================= */

.hero-card {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.35), transparent 55%),
    linear-gradient(to bottom right, #020617, #020617);
  border-radius: 1.6rem;
  padding: 2.4rem 2.2rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 30px 70px rgba(2, 6, 23, 1);
  margin-bottom: 2.2rem;
}

.hero-content {
  max-width: 640px;
}

.hero-card h1 {
  margin: 0 0 0.8rem;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
}

.hero-card p {
  margin: 0.4rem 0;
  font-size: 1rem;
  color: #cbd5f5;
  max-width: 38rem;
}

.hero-note {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: #e5e7eb;
  opacity: 0.9;
}

/* ================= MODE GRID (INDEX – UPGRADED) ================= */

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem;
}

.mode-card {
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.98),
    rgba(2, 6, 23, 0.98)
  );
  border-radius: 1.25rem;
  padding: 1.9rem 1.8rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 22px 50px rgba(2, 6, 23, 0.95);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mode-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 36px 70px rgba(2, 6, 23, 1);
}

.mode-card h2 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.mode-card p {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.feature-list {
  margin: 0.8rem 0 1.4rem;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.feature-list li {
  margin-bottom: 0.25rem;
}

/* ================= BUTTONS ================= */

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
              background 0.12s ease, border-color 0.12s ease;
}

.primary-btn {
  background: linear-gradient(to right, #2563eb, #1d4ed8);
  color: #eff6ff;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.55);
  border: 1px solid rgba(191, 219, 254, 0.3);
}

.primary-btn::after {
  content: "→";
  margin-left: 0.35rem;
  transition: transform 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.7);
}

.primary-btn:hover::after {
  transform: translateX(4px);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.9);
  color: var(--text-main);
}

.secondary-btn:hover {
  background: rgba(31, 41, 55, 0.95);
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-muted);
}

.ghost-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
}

.full-width {
  width: 100%;
  justify-content: center;
}

/* ================= EVERYTHING BELOW = OTHER PAGES (UNCHANGED) ================= */

/* Test layout */

.test-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.test-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.test-mode {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.test-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.test-meta {
  display: flex;
  gap: 1rem;
}

.meta-item {
  text-align: right;
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
}

.test-card {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 1rem;
  padding: 1.3rem 1.4rem 1.4rem;
  border: 1px solid rgba(55, 65, 81, 0.95);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.95);
}

/* Waveform */

.wave-canvas {
  width: 100%;
  height: 80px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  margin: 10px 0 15px;
  border: 1px solid rgba(55, 65, 81, 0.5);
}

/* Results */

.result-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

/* Slider etc... (unchanged) */

/* ================= RESPONSIVE ================= */

@media (max-width: 720px) {
  .app-main {
    padding: 0 0.9rem;
  }

  .hero-card {
    padding: 1.6rem 1.4rem;
  }

  .hero-card h1 {
    font-size: 1.6rem;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .test-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .test-meta {
    width: 100%;
    justify-content: space-between;
  }
}

.app-footer {
  margin-top: 3rem;
  padding: 1.2rem 0 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.app-footer .heart {
  color: #ef4444;
  margin: 0 0.15rem;
}

.app-footer .author {
  color: #e5e7eb;
  font-weight: 500;
}
