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

:root {
  --bg: #eef1f8;
  --card-bg: #ffffff;
  --text-main: #1f2430;
  --text-sub: #7a8194;
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --border: #e6e8f0;
  --done: #b2b6c2;
  --shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
}

body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system,
    BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, #eef1f8 0%, #e4e9fb 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 48px 16px;
}

.app {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-header {
  text-align: center;
  margin-bottom: 8px;
}

.app-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-sub);
}

.progress-card,
.add-card,
.list-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  margin-bottom: 12px;
}

.progress-label span:first-child {
  font-weight: 600;
  color: var(--text-main);
}

.progress-count {
  color: var(--primary);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #edeefb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-main);
}

.add-form {
  display: flex;
  gap: 10px;
}

.add-form input[type="text"] {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: #fafbff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.add-form input[type="text"]:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.add-form button {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.add-form button:hover {
  background: #5b4bd6;
}

.add-form button:active {
  transform: scale(0.97);
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-sub);
}

.todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.todo-item:hover {
  background: #f7f7fd;
}

.todo-item + .todo-item {
  border-top: 1px solid var(--border);
}

.todo-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.todo-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.checkbox-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border);
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.todo-item input[type="checkbox"]:checked + label .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}

.todo-item input[type="checkbox"]:checked + label .checkbox-box::after {
  opacity: 1;
}

.todo-item input[type="checkbox"]:focus-visible + label .checkbox-box {
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
}

.todo-text {
  font-size: 15px;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.todo-item input[type="checkbox"]:checked + label .todo-text {
  color: var(--done);
  text-decoration: line-through;
}

.tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.tag-work {
  background: #eef0ff;
  color: #5b4bd6;
}

.tag-life {
  background: #e6f7f0;
  color: #1e9e6b;
}

.tag-health {
  background: #fff0ee;
  color: #e0562f;
}

.tag-study {
  background: #fff8e0;
  color: #b98900;
}

.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
}

@media (max-width: 420px) {
  .app-header h1 {
    font-size: 24px;
  }

  .add-form {
    flex-direction: column;
  }

  .add-form button {
    width: 100%;
  }
}
