:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c1e21;
  --muted: #7a7f87;
  --border: #e3e5e9;
  --accent: #4f6bed;
  --accent-hover: #3b57d6;
  --danger: #e0576b;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #16181d;
  --surface: #1f2229;
  --text: #e8eaed;
  --muted: #8a9099;
  --border: #2c3038;
  --accent: #6d84f2;
  --accent-hover: #8397f5;
  --danger: #ef6f81;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
  transition: background 0.25s ease, color 0.25s ease;
}

.app {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
  height: fit-content;
}

.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.app__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease;
}

.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }

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

.task-form__input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.task-form__input:focus { border-color: var(--accent); }

.task-form__btn {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.task-form__btn:hover { background: var(--accent-hover); }

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.filters__btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.task__checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.task__checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.task__checkbox:checked::after {
  content: "✓";
  color: #fff;
  font-size: 0.8rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.task__text {
  flex: 1;
  font-size: 0.95rem;
  word-break: break-word;
}

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

.task__delete {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.task__delete:hover {
  color: var(--danger);
  background: rgba(224, 87, 107, 0.12);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 24px 0;
}

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

.link-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.link-btn:hover { color: var(--danger); }
