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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f7;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

.container {
  width: 100%;
  max-width: 500px;
}

h1 {
  font-size: 32px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 24px;
}

#todo-form {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

#todo-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 16px;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  background: white;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#todo-input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

#todo-form button {
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  background: #0071e3;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

#todo-form button:hover {
  background: #0077ed;
}

#todo-list {
  list-style: none;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#todo-list:empty {
  display: none;
}

.todo-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  animation: slideIn 0.2s ease;
}

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

.todo-item:last-child {
  border-bottom: none;
}

.todo-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-right: 14px;
  cursor: pointer;
  accent-color: #0071e3;
}

.todo-item span {
  flex: 1;
  font-size: 16px;
  color: #1d1d1f;
  transition: color 0.2s, text-decoration 0.2s;
}

.todo-item.completed span {
  color: #86868b;
  text-decoration: line-through;
}

.todo-item button {
  padding: 6px 12px;
  font-size: 14px;
  color: #86868b;
  background: none;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}

.todo-item:hover button {
  opacity: 1;
}

.todo-item button:hover {
  color: #ff3b30;
  border-color: #ff3b30;
}

#footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 0 4px;
}

#footer.hidden {
  display: none;
}

#count {
  font-size: 14px;
  color: #86868b;
}

#clear-completed {
  padding: 8px 14px;
  font-size: 14px;
  color: #86868b;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

#clear-completed:hover {
  color: #1d1d1f;
}
