:root {
  --bg: #14110f;
  --bg-soft: #1d1916;
  --bg-card: #211c18;
  --line: #322b25;
  --ink: #ece5db;
  --ink-soft: #a9a097;
  --ink-faint: #6f675f;
  --accent: #d08a4e;
  --accent-soft: #b9763e;
  --danger: #b5524a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0.2px;
}

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.brand { font-family: Georgia, serif; font-size: 1.6rem; }
.brand .dot { color: var(--accent); }
.topbar .meta { color: var(--ink-faint); font-size: 0.85rem; }
.topbar .meta a { color: var(--ink-soft); }

/* Card / form */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
}
.card h2 { margin: 0 0 6px; font-size: 1.3rem; }
.card .lead { color: var(--ink-soft); margin: 0 0 24px; font-size: 0.95rem; }

label.field { display: block; margin-bottom: 22px; }
label.field > span {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 13px 14px;
  font-size: 1rem;
  font-family: inherit;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
}
textarea { resize: vertical; min-height: 80px; }

.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  position: relative;
  flex: 1;
  min-width: 90px;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.95rem;
}
.choice input:checked + span {
  border-color: var(--accent);
  color: var(--ink);
  background: #2a221b;
}

button.primary {
  width: 100%;
  margin-top: 8px;
  background: var(--accent);
  color: #1a140e;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
button.primary:hover { background: var(--accent-soft); }

/* Episode list */
.section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 16px;
}
.episode {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.episode .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.episode .topic { font-size: 1.08rem; font-family: Georgia, serif; }
.episode .sub { color: var(--ink-faint); font-size: 0.82rem; margin-top: 3px; }
.badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.badge.done { color: #8fbf86; border-color: #3a5236; }
.badge.busy { color: var(--accent); border-color: var(--accent-soft); }
.badge.error { color: var(--danger); border-color: #5a2f2b; }

.empty { color: var(--ink-faint); font-style: italic; }

/* Custom audio player */
.player {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.playbtn {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #1a140e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.playbtn:hover { background: var(--accent-soft); }
.track { flex: 1; }
.bar {
  height: 6px;
  background: var(--line);
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
}
.bar .fill { height: 100%; width: 0; background: var(--accent); }
.time { font-size: 0.78rem; color: var(--ink-faint); margin-top: 6px; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.actions a, .actions button {
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.actions a:hover { color: var(--ink); border-color: var(--ink-faint); }
.actions .del:hover { color: var(--danger); border-color: #5a2f2b; }

/* Login */
.login-wrap {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 0 24px;
}
.login-wrap .brand { font-size: 2rem; text-align: center; display: block; margin-bottom: 6px; }
.login-wrap .tagline { text-align: center; color: var(--ink-faint); margin-bottom: 36px; }
.error-msg {
  background: #2a1c1a;
  border: 1px solid #5a2f2b;
  color: #e3a39b;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* Generatiepagina */
.gen-wrap { max-width: 620px; margin: 12vh auto 0; padding: 0 24px; text-align: center; }
.gen-topic { font-size: 1.5rem; margin: 8px 0 30px; }
.steps { text-align: left; margin: 0 auto 30px; max-width: 360px; }
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: none; }
.step .ic {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
}
.step.active { color: var(--ink); }
.step.active .ic { border-color: var(--accent); color: var(--accent); }
.step.done { color: var(--ink-soft); }
.step.done .ic { background: var(--accent); border-color: var(--accent); color: #1a140e; }
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text { color: var(--ink-soft); min-height: 1.5em; }
