@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #18181b;
  --surface: #222226;
  --surface-raised: #2a2a2f;
  --border: #38383f;
  --text: #ece9e4;
  --text-muted: #93939c;
  --matin: #f2b134;
  --apres-midi: #4fb0c6;
  --nuit: #8b7cf6;
  --done: #55b57e;
  --danger: #e2685a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(242,177,52,0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(139,124,246,0.07), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.screen { width: 100%; }
.screen[hidden] { display: none; }

/* ---------- Login ---------- */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.login-mark {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.bulb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.bulb--matin { background: var(--matin); box-shadow: 0 0 10px var(--matin); }
.bulb--apres-midi { background: var(--apres-midi); box-shadow: 0 0 10px var(--apres-midi); }
.bulb--nuit { background: var(--nuit); box-shadow: 0 0 10px var(--nuit); }

.login-card h1 { font-size: 1.4rem; }
.login-sub { margin: 0 0 8px; color: var(--text-muted); font-size: 0.9rem; }

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.login-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
.login-card input:focus,
input:focus,
button:focus-visible {
  outline: 2px solid var(--matin);
  outline-offset: 1px;
}

.login-card button[type="submit"] {
  margin-top: 6px;
  background: var(--matin);
  color: #1a1305;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.login-card button[type="submit"]:hover { filter: brightness(1.07); }

.error { color: var(--danger); font-size: 0.85rem; margin: 0; }

/* ---------- App shell ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 1.15rem; }

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.ghost-btn:hover { color: var(--text); border-color: var(--text-muted); }

.day-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
}
.nav-btn:hover { border-color: var(--matin); }

.day-label-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.day-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  text-transform: capitalize;
  pointer-events: none;
}

#date-picker {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- Board ---------- */
.board {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.add-form input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.add-form button {
  background: var(--matin);
  color: #1a1305;
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
}
.add-form button:hover { filter: brightness(1.07); }

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.task-item.done { opacity: 0.55; }
.task-item.done .task-text { text-decoration: line-through; }

.task-check {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--done);
  cursor: pointer;
}

.task-body { flex: 1; min-width: 0; }
.task-text { font-size: 0.95rem; word-break: break-word; }

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.shift-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  text-transform: capitalize;
}
.shift-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.shift-tag--matin::before { background: var(--matin); }
.shift-tag--apres-midi::before { background: var(--apres-midi); }
.shift-tag--nuit::before { background: var(--nuit); }

.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.delete-btn:hover { color: var(--danger); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 40px 20px;
}

@media (max-width: 480px) {
  .topbar, .day-nav { padding: 14px 16px; }
  .board { padding: 20px 14px 60px; }
}

#login-screen[hidden],
#app-screen[hidden] {
  display: none;
}
