* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #0b1329;
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.container {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Authentication Layout */
.auth-card {
  background: #141f36;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  margin-top: 30px;
}

.auth-card h2 {
  font-size: 1.7rem;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
}

.auth-card p#authSubtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  text-align: center;
  margin-top: -8px;
  margin-bottom: 8px;
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1329;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #3b82f6;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 6px;
  cursor: pointer;
}

.auth-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
}

.text-link {
  background: none;
  border: none;
  color: #3b82f6;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}

.text-link:hover {
  text-decoration: underline;
}

.auth-error-msg {
  color: #ef4444;
  font-size: 0.82rem;
  text-align: center;
  min-height: 18px;
}

/* Header & Meta */
header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #94a3b8;
}

.user-badge {
  background: #1e293b;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.logout-btn {
  background: #ef444420;
  border: 1px solid #ef444450;
  color: #f87171;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}

.logout-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease;
}

/* Controls */
.search-bar {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  background: #141f36;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.categories-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.cat-chip.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.task-card-form {
  background: #141f36;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card-form input[type="text"] {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  outline: none;
  padding: 4px;
}

.form-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

select,
input[type="date"] {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  outline: none;
}

.submit-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Task List */
ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

li {
  background: #141f36;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

li.completed {
  opacity: 0.55;
}

.priority-indicator {
  width: 4px;
  height: 32px;
  border-radius: 4px;
  flex-shrink: 0;
}

.pri-high { background-color: #ef4444; }
.pri-med  { background-color: #f59e0b; }
.pri-low  { background-color: #10b981; }

.check-box {
  width: 20px;
  height: 20px;
  border: 2px solid #64748b;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

li.completed .check-box {
  background: #10b981;
  border-color: #10b981;
}

li.completed .check-box::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: bold;
}

.task-details {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.95rem;
  color: #f8fafc;
  word-break: break-word;
}

li.completed .task-title {
  text-decoration: line-through;
  color: #64748b;
}

.task-meta {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 4px;
}

.tag {
  background: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
}

.due-tag {
  color: #f87171;
}

.del-btn {
  background: none;
  border: none;
  color: #475569;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
}

.del-btn:hover {
  color: #ef4444;
}

.empty-msg {
  text-align: center;
  color: #64748b;
  margin-top: 30px;
  font-size: 0.9rem;
}