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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  background: #1e293b;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* ── App header with user info ── */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  padding-top: 0.25rem;
}

.user-email {
  font-size: 0.78rem;
  color: #94a3b8;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  background: transparent;
  color: #64748b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.logout-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

/* ── Auth form ── */

.auth-container {
  max-width: 400px;
}

.auth-container h1 {
  text-align: center;
}

.auth-container .subtitle {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: #0f172a;
  border-radius: 8px;
  padding: 0.25rem;
}

.auth-tab {
  flex: 1;
  background: transparent;
  color: #64748b;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-tab:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.auth-tab.active {
  background: #6366f1;
  color: white;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
}

.form-group input {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-group input:focus {
  border-color: #6366f1;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-submit-btn {
  width: 100%;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.25rem;
}

.auth-submit-btn:hover {
  background: #4f46e5;
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Input row ── */

.input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  margin-top: 1.25rem;
}

input[type="text"] {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: #6366f1;
}

button {
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

button:hover {
  background: #4f46e5;
}

/* ── Filter tabs ── */

.filter-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.filter-tab {
  background: transparent;
  color: #64748b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-tab:hover {
  background: #334155;
  color: #e2e8f0;
}

.filter-tab.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}

/* ── Todo list ── */

#todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 60px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #0f172a;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  transition: opacity 0.2s;
}

.todo-item.done {
  opacity: 0.5;
}

.todo-item.done span {
  text-decoration: line-through;
}

.todo-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-item span {
  flex: 1;
  font-size: 0.95rem;
}

.delete-btn {
  background: transparent;
  color: #475569;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
  border-radius: 4px;
}

.delete-btn:hover {
  background: #ef4444;
  color: white;
}

.empty-state {
  text-align: center;
  color: #475569;
  font-size: 0.88rem;
  padding: 1.5rem 0;
}

/* ── Stats bar ── */

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
  font-size: 0.85rem;
  color: #64748b;
}

#clear-btn {
  background: transparent;
  color: #64748b;
  border: 1px solid #334155;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

#clear-btn:hover {
  background: #334155;
  color: #e2e8f0;
}
