:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1e2433;
  --muted: #8a93a6;
  --accent: #5b6cff;
  --accent-dark: #4654d6;
  --danger: #e5484d;
  --ring: rgba(91, 108, 255, 0.18);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #eef1f8 0%, #f7f3ff 100%);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 48px 16px;
}

.app {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(30, 36, 51, 0.12);
  padding: 32px 28px;
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.5px;
}

.tagline {
  margin: 4px 0 24px;
  color: var(--muted);
}

.task-form {
  display: flex;
  gap: 10px;
}

.task-form input {
  flex: 1;
  padding: 12px 14px;
  font-size: 1rem;
  border: 2px solid #e4e8f2;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.task-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.btn-add {
  padding: 0 22px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-add:hover { background: var(--accent-dark); }

.filters {
  display: flex;
  gap: 8px;
  margin: 20px 0 12px;
}

.filter {
  padding: 7px 16px;
  font-size: 0.9rem;
  border: 1px solid #e4e8f2;
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter:hover { border-color: var(--accent); color: var(--accent); }

.filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid #eef1f6;
}

.task:last-child { border-bottom: none; }

.task .toggle {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid #c9d0e2;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.task.done .toggle {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.task .label {
  flex: 1;
  font-size: 1rem;
  word-break: break-word;
  cursor: pointer;
}

.task.done .label {
  text-decoration: line-through;
  color: var(--muted);
}

.task .edit-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 1rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  outline: none;
}

.task .btn-delete {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.task .btn-delete:hover { color: var(--danger); background: #fdecec; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eef1f6;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-clear {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}

.btn-clear:hover { color: var(--danger); background: #fdecec; }

@media (max-width: 480px) {
  .app { padding: 24px 18px; }
}
