/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #222;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.25rem 1rem;
  text-align: center;
}

h1 {
  font-size: 1.75rem;
  color: #2d3748;
}

main {
  flex: 1;
  max-width: 600px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Add todo form */
.add-todo form {
  display: flex;
  gap: 0.5rem;
}

#todo-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
}

button[type="submit"] {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  background: #4299e1;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button[type="submit"]:hover {
  background: #3182ce;
}

/* Todo list */
.todo-list {
  margin-top: 1.5rem;
}

#todo-list {
  list-style: none;
}

.todo-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.2s ease;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #718096;
}

.todo-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.todo-text {
  flex: 1;
  font-size: 1rem;
}

.todo-delete {
  background: #e53e3e;
  color: #fff;
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.todo-delete:hover {
  background: #c53030;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem 0.5rem;
  font-size: 0.875rem;
  color: #718096;
}

/* Responsive tweaks */
@media (min-width: 600px) {
  h1 {
    font-size: 2rem;
  }
}