:root {
  --bg: #0d0f14;
  --bg-elevated: #161922;
  --bg-card: #1b1f2a;
  --border: #2a2f3d;
  --text: #e8e9ee;
  --text-dim: #9198a8;
  --accent: #5eb0ef;
  --accent-dim: #2c5a78;
  --good: #4fbf7a;
  --good-dim: #1e4530;
  --warn: #e0a858;
  --danger: #e06a6a;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* --- Login screen --- */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 16px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.login-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  margin: 0 0 8px;
}

input[type="text"], input[type="password"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
}

input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #06101a;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.btn-primary:active { opacity: 0.85; }

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.1em;
}

/* --- Header / tabs --- */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.app-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 4px 0;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 10px 4px;
  font-size: 0.82rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

main {
  flex: 1;
  padding: 16px;
  padding-bottom: 48px;
}

.panel { display: none; }
.panel.active { display: block; }

/* --- Progress bar --- */
.progress-wrap {
  margin-bottom: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.progress-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* --- Acquisitions (What I Have) --- */
.category-group {
  margin-bottom: 20px;
}

.category-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 8px 2px;
}

.acq-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acq-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.acq-item.acquired {
  border-color: var(--good-dim);
  background: linear-gradient(0deg, var(--good-dim), var(--good-dim)), var(--bg-card);
  background-blend-mode: overlay;
}

.checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.acq-item.acquired .checkbox {
  background: var(--good);
  border-color: var(--good);
  color: #06170e;
}

.acq-name { flex: 1; }

/* --- Steps (Next Steps) --- */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.step-check:active { transform: scale(0.92); }

.step-text {
  flex: 1;
  font-size: 0.94rem;
  line-height: 1.4;
}

.step-grants {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.grant-chip {
  font-size: 0.68rem;
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 3px 9px;
  border: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 16px;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* --- Cheat sheet --- */
.cheat-section {
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.cheat-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
  color: var(--accent);
}

.cheat-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
}

.cheat-list li { margin-bottom: 3px; }

/* --- Toast --- */
#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
  max-width: 90%;
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.reset-row {
  margin-top: 24px;
  text-align: center;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
