:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #15181e;
  --muted: #5d6573;
  --border: #dfe2e8;
  --accent: #1f5eff;
  --accent-text: #ffffff;
  --danger-bg: #fdecec;
  --danger: #a32020;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #181b21;
    --text: #e8eaee;
    --muted: #9aa2b1;
    --border: #2b3039;
    --accent: #5b8cff;
    --accent-text: #0b0d11;
    --danger-bg: #3a1717;
    --danger: #ffb4b4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
.muted { color: var(--muted); margin: 0 0 1.5rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  font-size: 1rem;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent) url("/assets/favicon.svg") center / cover;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:focus-visible, .tile:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-google { width: 100%; background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-google svg { width: 18px; height: 18px; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); min-height: 34px; font-weight: 500; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card {
  width: 100%;
  max-width: 380px;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card .brand { margin-bottom: 1.5rem; }
.error { background: var(--danger-bg); color: var(--danger); padding: .6rem .8rem; border-radius: 8px; }
.notice { color: var(--muted); font-size: .9rem; }
.dev-login { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--border); display: grid; gap: .75rem; }
.dev-title { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dev-login label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }
.dev-login input {
  min-height: 38px;
  padding: 0 .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

/* Accueil */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.account { display: flex; align-items: center; gap: .6rem; }
.account form { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.avatar-initial { display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: .85rem; }
@media (max-width: 520px) { .account-name { display: none; } }

.home { max-width: 960px; margin: 0 auto; padding: 2.5rem 16px; }
.home h1 { margin-bottom: 1.5rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tile {
  display: grid;
  gap: .35rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-icon svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.tile-icon svg circle { fill: var(--accent); stroke: none; }
.tile-name { font-weight: 650; font-size: 1.05rem; }
.tile-desc { color: var(--muted); font-size: .9rem; }
