*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #2563eb;
  --color-text: #111;
  --color-text-2: #444;
  --color-text-3: #888;
  --color-bg: #fff;
  --color-surface: #f8f8f8;
  --color-border: #e5e5e5;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-mono: 'Menlo', 'Monaco', monospace;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 15px;
  line-height: 1.6;
}

nav {
  padding: 16px 40px;
  border-bottom: 1px solid var(--color-border);
}

nav a {
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 14px;
}

nav a:hover { color: var(--color-primary); }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ── Header ── */

.page-header { margin-bottom: 28px; }

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-text-3);
  font-weight: 500;
}

/* ── Progress bar ── */

.progress-wrap {
  margin-bottom: 36px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 20px;
}

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

.progress-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2);
}

.progress-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.progress-track {
  height: 8px;
  background: var(--color-border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 99px;
  width: 0%;
  transition: width 0.35s ease, background 0.35s;
}

.progress-fill.complete {
  background: var(--color-success);
}

/* ── Checklist sections ── */

.checklist {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.checklist-section {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.section-title {
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-2);
}

.section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-3);
  font-family: var(--font-mono);
  transition: color 0.2s;
}

.section-count.complete {
  color: var(--color-success);
}

/* ── Check list items ── */

.check-list {
  list-style: none;
  padding: 6px 0;
}

.check-list li {
  border-bottom: 1px solid var(--color-border);
}

.check-list li:last-child {
  border-bottom: none;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.1s;
}

.check-item:hover { background: #fafafa; }

.check-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.check-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.check-item input:checked ~ .check-box {
  background: var(--color-success);
  border-color: var(--color-success);
}

.check-item input:checked ~ .check-box::after {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.check-item:focus-within .check-box {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.check-text {
  font-size: 14px;
  color: var(--color-text-2);
  line-height: 1.5;
  transition: color 0.15s;
}

.check-item input:checked ~ .check-text {
  color: var(--color-text-3);
  text-decoration: line-through;
  text-decoration-color: var(--color-border);
}

.check-text code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0 4px;
  border-radius: 3px;
  color: var(--color-text);
}

/* ── Footer ── */

.checklist-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.reset-btn {
  font-size: 13px;
  color: var(--color-text-3);
  background: none;
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color 0.15s, border-color 0.15s;
}

.reset-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-3);
}

/* ── Completion banner ── */

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.completion-banner {
  margin-top: 36px;
  background: var(--color-success-bg);
  border: 2px solid var(--color-success);
  border-radius: 12px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  animation: bannerIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.banner-emoji { font-size: 40px; line-height: 1; }

.banner-content strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: 4px;
}

.banner-content p {
  font-size: 14px;
  color: #166534;
}

/* ── Confetti ── */

.confetti-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120px) rotate(360deg); opacity: 0; }
}

.confetti-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

/* ── Mobile ── */

@media (max-width: 640px) {
  main { padding: 24px 20px 60px; }
  nav  { padding: 14px 20px; }
  .progress-wrap { padding: 14px 16px; }
}
