/* style.css — Design System TODOPRO (stessi token visivi di CheckList Pro) */
@import url('https://fonts.googleapis.com/css2?family=Allerta+Stencil&display=swap');

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

body {
  font-family: 'Allerta Stencil', Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f0eeff;
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  min-height: 100vh;
}

/* ── Header ── */
.page-header { text-align: center; margin-bottom: 8px; }
.page-header h1 {
  font-size: 2rem;
  letter-spacing: 2px;
  color: #5e17eb;
}
.page-header h1 span { color: #00FF41; }
.slogan { text-align: center; font-size: 0.8rem; color: #888; margin-bottom: 28px; font-family: Arial, Helvetica, sans-serif; }

/* ── Buttons ── */
.btn-primary {
  background: linear-gradient(135deg, #5e17eb, #7c4dff);
  color: white;
  font-family: 'Allerta Stencil', Arial, Helvetica, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.3s;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: #5e17eb;
  font-family: 'Allerta Stencil', Arial, Helvetica, sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  border: 2px solid #5e17eb;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
}

.btn-xs {
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 2px solid #5e17eb;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-xs:hover { background: rgba(94,23,235,0.08); }

/* ── Badges (stato) ── */
.badge { font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.stato-attivo      { background: #ede9ff; color: #5e17eb; }
.stato-completato  { background: #e6ffed; color: #166534; border: 1px solid #00FF41; }
.stato-posticipato { background: #fef3c7; color: #92400e; }
.stato-congelato   { background: #e0f2fe; color: #075985; }

/* ── Task list ── */
.task-grid { display: flex; flex-direction: column; gap: 12px; }

.card-task {
  background: white;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-task.is-frozen { opacity: 0.6; }

.task-title { font-weight: 700; font-size: 1rem; color: #5e17eb; }
.task-note { font-size: 0.82rem; color: #666; margin-top: 2px; font-style: italic; }
.task-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 0.78rem; color: #666; }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Form nuovo task ── */
.form-nuova {
  background: white;
  border: 2px solid #ddd;
  border-radius: 15px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: #333; }
.form-group input, .form-group select, .form-group textarea {
  font-family: 'Allerta Stencil', Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #5e17eb; }
.form-actions { display: flex; justify-content: flex-end; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #5e17eb;
  color: white;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { border-left: 4px solid #00FF41; }
.toast-error   { border-left: 4px solid #dc3545; }
.toast-info    { border-left: 4px solid #7c4dff; }

/* ── Empty / loading ── */
.empty-state { text-align: center; color: #666; padding: 48px 16px; }
.loading-state { text-align: center; padding: 48px 16px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #ddd;
  border-top-color: #5e17eb;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 480px) {
  .page-header h1 { font-size: 1.5rem; }
  .card-task { flex-direction: column; align-items: flex-start; }
  .task-actions { width: 100%; justify-content: flex-end; }
}
