:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-weak: #e8f0ff;
  --success: #16a34a;
  --shadow: 0 15px 60px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at 10% 20%, #eef2ff 0, transparent 25%),
    radial-gradient(circle at 90% 10%, #e0f2fe 0, transparent 22%),
    radial-gradient(circle at 50% 80%, #ecfeff 0, transparent 25%),
    var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
}

.app {
  width: min(560px, 100%);
}

.app__header {
  text-align: center;
  margin-bottom: 18px;
}

.app__eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.app__title {
  margin: 6px 0 0;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.02em;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.task-form__field {
  width: 100%;
}

.task-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: #f9fafb;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.task-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-weak);
  background: #fff;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.primary {
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid var(--primary);
  transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary:not(:disabled):hover {
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.filter {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #f9fafb;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.filter.is-active {
  background: var(--primary-weak);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.25);
  font-weight: 600;
}

.filter:hover {
  transform: translateY(-1px);
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.task-item:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.task-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.task-text {
  margin: 0;
  word-break: break-word;
  flex: 1;
}

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

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.2);
}

.icon-button.danger:hover {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

.checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.edit-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 15px;
  background: #fff;
  box-shadow: 0 0 0 2px var(--primary-weak);
}

.empty-state {
  margin: 16px 0 4px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 520px) {
  .task-form {
    grid-template-columns: 1fr;
  }

  .primary {
    width: 100%;
  }

  .task-item {
    align-items: flex-start;
  }

  .task-actions {
    gap: 4px;
  }
}
