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

:root {
  --bg: #0f0f13;
  --bg-card: #1a1a24;
  --bg-input: #12121a;
  --accent: #e8a838;
  --accent-hover: #f0b84a;
  --accent-glow: rgba(232, 168, 56, 0.15);
  --text: #e8e8ec;
  --text-muted: #8a8a9a;
  --border: #2a2a3a;
  --success: #34d399;
  --error: #ef4444;
  --radius: 12px;
  --max-w: 720px;
}

html { scroll-behavior: smooth; }

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Skip Link ───────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 999;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ── Header ──────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo:hover { color: var(--accent); text-decoration: none; }
.logo-icon { font-size: 1.4rem; }

nav { display: flex; gap: 20px; align-items: center; }
nav a { color: var(--text-muted); font-size: 0.9rem; }
nav a:hover { color: var(--text); text-decoration: none; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

@media (max-width: 600px) {
  .hamburger { display: block; }
  nav {
    display: none;
    position: absolute;
    top: 56px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
  }
  nav.open { display: flex; }
}

/* ── Main ────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent), #f0b84a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 24px;
}

.hero-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(232, 168, 56, 0.3);
  border-radius: 24px;
  padding: 8px 20px;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

/* ── Speech Types ────────────────────────────────────────────── */
.speech-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}

.speech-type-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  color: var(--text);
  font-size: 0.85rem;
}

.speech-type-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.speech-type-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.speech-type-btn .icon { font-size: 1.4rem; display: block; margin-bottom: 6px; }

/* ── Form ────────────────────────────────────────────────────── */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.form-section h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group label .required {
  color: var(--accent);
}

input, textarea, select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  outline: none;
}

textarea { resize: vertical; min-height: 80px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238a8a9a' fill='none' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select option { background: var(--bg-card); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 500px) { .row-2 { grid-template-columns: 1fr; } }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  width: 100%;
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Preview Card ────────────────────────────────────────────── */
.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  margin: 24px 0;
  display: none;
}

.preview-card.visible { display: block; }

.preview-card h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.preview-text {
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}

.preview-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.preview-blur {
  text-align: center;
  padding: 20px;
  background: linear-gradient(180deg, transparent, var(--bg-card));
  margin-top: -40px;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Success page ────────────────────────────────────────────── */
.success-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.success-icon { font-size: 3rem; margin-bottom: 16px; }

.speech-result {
  text-align: left;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0;
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 0.95rem;
}

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── Features ────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 48px 0;
}

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

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature h3 { font-size: 0.95rem; margin-bottom: 6px; }
.feature p { font-size: 0.8rem; color: var(--text-muted); }

/* ── How It Works ────────────────────────────────────────────── */
.steps {
  margin: 48px 0;
}

.steps h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 28px;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) { .step-list { grid-template-columns: 1fr; } }

.step {
  text-align: center;
  padding: 20px;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.step h3 { font-size: 0.95rem; margin-bottom: 6px; }
.step p { font-size: 0.8rem; color: var(--text-muted); }

/* ── Testimonials ────────────────────────────────────────────── */
.testimonials {
  margin: 48px 0;
}

.testimonials h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.testimonial {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.testimonial-stars { color: var(--accent); margin-bottom: 8px; }
.testimonial p { font-size: 0.9rem; font-style: italic; margin-bottom: 10px; }
.testimonial-author { font-size: 0.8rem; color: var(--text-muted); }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq { margin: 48px 0; }
.faq h2 { text-align: center; font-size: 1.4rem; margin-bottom: 24px; }

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-q {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); transition: transform 0.2s; }
.faq-item.open .faq-q::after { content: '−'; }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.open .faq-a {
  max-height: 200px;
  padding: 0 20px 16px;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error banner ────────────────────────────────────────────── */
.error-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--error);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}

.error-banner.visible { display: block; }

/* ── Aria live ───────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Legal pages ─────────────────────────────────────────────── */
.legal-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px;
}

.legal-content h1 { font-size: 1.8rem; margin-bottom: 24px; }
.legal-content h2 { font-size: 1.2rem; margin-top: 28px; margin-bottom: 12px; color: var(--accent); }
.legal-content p, .legal-content li { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 10px; }
.legal-content ul { padding-left: 20px; }
.legal-content a { color: var(--accent); }
