:root {
  --ground: #faf8f4;
  --card: #ffffff;
  --ink: #2a2620;
  --muted: #8a8378;
  --accent: #5a6b4a;
  --accent-ink: #ffffff;
  --line: #e6e1d7;
  --error: #a4392f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1b1916;
    --card: #242119;
    --ink: #ece7de;
    --muted: #9a9285;
    --accent: #8fa47c;
    --accent-ink: #1b1916;
    --line: #37332b;
    --error: #e08a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: "Seravek", "Avenir Next", "Gill Sans", system-ui, sans-serif;
  line-height: 1.5;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
}
.brand { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
#user-nav { display: flex; gap: 1rem; align-items: center; }
.user-email { color: var(--muted); font-size: 0.85rem; }

main {
  flex: 1;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1.75rem;
}

.auth-card, .subscribe-card {
  max-width: 26rem;
  margin: 3rem auto 0;
}
h1 { font-size: 1.35rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.25rem; }
.sub { color: var(--muted); margin: 0 0 1.25rem; }

form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}
form input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
}
form input:focus, button:focus-visible, .as-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button { font: inherit; cursor: pointer; }

.primary {
  display: inline-block;
  width: 100%;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 0.375rem;
  font-weight: 650;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.primary.big { padding: 0.85rem 1.2rem; font-size: 1.05rem; }
.as-link { text-align: center; text-decoration: none; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font-size: 0.9rem;
}

.switch { margin: 1.1rem 0 0; color: var(--muted); font-size: 0.9rem; }

.perks { margin: 0 0 1.25rem; padding-left: 1.2rem; color: var(--ink); }
.perks li { margin-bottom: 0.4rem; }

.error { color: var(--error); font-size: 0.9rem; margin: 0.5rem 0; }

/* App steps */
.steps { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1rem; }
.step { position: relative; padding-left: 4.25rem; }
.step-num {
  position: absolute;
  left: 1.4rem;
  top: 1.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.9rem; }

.picker {
  padding: 0.6rem 1.1rem;
  background: var(--ground);
  color: var(--ink);
  border: 1px dashed var(--accent);
  border-radius: 0.375rem;
  font-weight: 600;
}
.picked { font-size: 0.9rem; color: var(--accent); font-weight: 600; margin: 0.6rem 0 0; }

#btn-generate { max-width: 22rem; }

.bar {
  height: 0.6rem;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1.1rem;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-label { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 0; font-variant-numeric: tabular-nums; }

.done-msg { font-weight: 650; margin: 1rem 0 0.75rem; }
#done-wrap .as-link { display: block; max-width: 22rem; margin-bottom: 0.6rem; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.25rem;
}

@media (max-width: 40rem) {
  .step { padding-left: 1.75rem; }
  .step-num { position: static; margin-bottom: 0.5rem; }
}
