/* MyVoice Reader — base styling */

:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface-2: #20242f;
  --border: #2c313d;
  --text: #e7e9ee;
  --muted: #9aa1b0;
  --accent: #6d8bff;
  --accent-2: #54e0c7;
  --danger: #ff6b6b;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

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

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.user-chip {
  font-size: .85rem; color: var(--muted);
  padding: 4px 10px; background: var(--surface-2);
  border-radius: 999px;
}

/* ---- layout ---- */
.container { max-width: 860px; margin: 0 auto; padding: 32px 24px; }
.footnote { text-align: center; color: var(--muted); font-size: .8rem; padding: 32px; }

/* ---- buttons ---- */
.btn, .btn-ghost {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #0b0d12;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---- hero / landing ---- */
.hero h1 { font-size: 2.2rem; line-height: 1.2; margin-bottom: 12px; }
.hero h1 em { color: var(--accent-2); font-style: normal; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 40px; }
.feature-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.feature h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---- auth cards ---- */
.auth-card {
  max-width: 400px; margin: 24px auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.auth-card h1 { margin-top: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.muted { color: var(--muted); font-size: .9rem; }
.alert {
  background: rgba(255, 107, 107, .12);
  border: 1px solid var(--danger);
  color: #ffb3b3;
  padding: 10px 14px; border-radius: 8px; font-size: .9rem;
}
.hidden { display: none; }

/* ---- reader ---- */
.reader-controls {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin: 18px 0; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.reader-controls label { flex-direction: column; }
.reader-controls input[type=range] { width: 160px; }
.readout {
  min-height: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 1.15rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.readout:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.readout:focus { outline: 2px solid var(--accent); }
.sentence { border-radius: 4px; transition: background .15s ease; }
.sentence.speaking { background: var(--accent-2); color: #08130f; }
.reader-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ---- recording studio ---- */
.studio-head h1 { margin-bottom: 4px; }
.progress-wrap { margin: 20px 0; }
.progress-bar {
  height: 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s ease;
}
.progress-label { font-size: .85rem; color: var(--muted); margin-top: 6px; }

.studio-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-top: 8px;
}
.sentence-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.badge {
  font-size: .78rem; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.badge-ok { background: rgba(84, 224, 199, .15); color: var(--accent-2); }
.prompt-text {
  font-size: 1.6rem; line-height: 1.45; font-weight: 600;
  margin: 8px 0 22px; min-height: 3em;
}
.level-meter {
  height: 10px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden; margin-bottom: 8px;
}
.level-fill {
  height: 100%; width: 0%; background: var(--accent-2);
  transition: width .05s linear;
}
.level-fill.clipping { background: var(--danger); }
.status-line { min-height: 1.4em; margin: 4px 0 16px; }
.player { width: 100%; margin-bottom: 16px; }
.studio-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hint { margin-top: 10px; font-size: .85rem; }
.word-text { font-size: 2.4rem; text-align: center; min-height: 1.6em; }

/* mode tabs + own-text box */
.mode-tabs { display: flex; gap: 8px; margin: 8px 0 16px; }
.tab {
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  font-size: .9rem; font-weight: 600;
}
.tab.active { background: var(--accent); color: #0b0d12; border-color: transparent; }
.text-box { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.text-box textarea {
  width: 100%; padding: 12px; border-radius: 8px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-size: 1rem; font-family: inherit;
}
.text-box .btn { align-self: flex-start; }
.nav-row { display: flex; justify-content: space-between; margin-top: 20px; }

/* ---- voice roadmap ---- */
.roadmap { display: flex; flex-direction: column; gap: 4px; margin: 24px 0; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.step .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--border); flex: none;
}
.step.done .dot { background: var(--accent-2); border-color: var(--accent-2); }
.step.next .dot { background: var(--accent); border-color: var(--accent); }
