@import url("https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  --background-color: #1a1a1a;
  --card-background: #2b2b2b;
  --text-color: #e0e0e0;
  --accent-color: #9a7bca;
  --border-color: #444444;
  --border-radius: 0.2rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: "Noto Sans", sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.2;
}

body {
  min-width: 320px;
  min-height: 90dvh;
  padding: 1rem;
  margin: 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  font-size: 1.8rem;
  padding: 0.3rem 0;
}

.form,
.todos {
  max-width: 30rem;
  width: 100%;
}

.form {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.input {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  color: var(--text-color);
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
}

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

.button {
  font-size: 1rem;
  color: var(--text-color);
  background-color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: var(--border-radius);
  padding: 0.3rem 0.6rem;
  transition: opacity 0.2s;
  outline: none;
  cursor: pointer;
}

.button:not(:disabled):focus-visible {
  outline: 1px solid var(--accent-color);
  outline-offset: 2px;
}

.button:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

@media (any-hover: hover) {
  .button:not(:disabled):hover {
    opacity: 0.85;
  }
}

.todo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
  border-radius: var(--border-radius);
  background-color: var(--card-background);
}

.todo:last-child {
  margin-bottom: 0;
}

.todo.completed {
  opacity: 0.7;
}

.todo.completed .todo-text {
  text-decoration: line-through;
}

.todo-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.todo-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  line-height: 1.5;
}
