/* Visually hidden utility for accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Modern, responsive, and accessible styles for the Task Manager */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --background: #f3f4f6;
  --surface: #fff;
  --text: #1f2937;
  --border: #e5e7eb;
  --completed: #a3a3a3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
}

main {
  max-width: 480px;
  margin: 2rem auto;
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
}

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--primary-dark);
}

form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
}

button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover,
button[type="submit"]:focus {
  background: var(--primary-dark);
}

ul.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

li.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}

li.task-item.completed {
  text-decoration: line-through;
  color: var(--completed);
  background: #e5e7eb;
}

.task-label {
  flex: 1;
  margin-left: 0.75rem;
  font-size: 1rem;
  word-break: break-word;
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

button.delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.2s;
}

button.delete-btn:hover,
button.delete-btn:focus {
  background: #fee2e2;
}

@media (max-width: 600px) {
  main {
    padding: 1rem 0.5rem;
  }
  h1 {
    font-size: 1.5rem;
  }
  form {
    flex-direction: column;
    gap: 0.75rem;
  }
  button[type="submit"] {
    width: 100%;
  }
}
