:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --accent: #4f8cff;
  --accent-2: #00d4aa;
  --text: #e6e8ec;
  --muted: #8b909a;
  --danger: #ff5c6c;
  --border: #2a2e38;
}

* { box-sizing: border-box; }

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

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}
header h1 { margin: 0; font-size: 2rem; }
.subtitle { color: var(--muted); margin: .25rem 0 0; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card h3 { margin: 0 0 .5rem; font-size: 1rem; }

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: .6rem 1.1rem;
  font-size: .95rem;
  cursor: pointer;
  transition: filter .15s;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: #2a2e38; }
button.danger { background: var(--danger); }
button.recording { background: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse { 50% { opacity: .55; } }

.actions { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; flex-wrap: wrap; }
.status { color: var(--muted); }
.hint { color: var(--muted); font-size: .85rem; }
code { background: #000; padding: .1rem .35rem; border-radius: 4px; }

.breadcrumb { font-size: .9rem; margin-bottom: .5rem; color: var(--muted); }
.breadcrumb span { cursor: pointer; color: var(--accent); }
.breadcrumb span:hover { text-decoration: underline; }

.folder-list, .song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.folder-list li, .song-list li {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}
.folder-list li:last-child, .song-list li:last-child { border-bottom: none; }
.folder-list li:hover { background: #232732; }
.folder-list li.selected { background: rgba(79,140,255,.18); }
.song-list li { cursor: default; }
.song-list .count { color: var(--muted); font-size: .8rem; }

.progress { margin-top: 1rem; }
.bar { background: #000; border-radius: 6px; height: 12px; overflow: hidden; }
.bar-fill { background: var(--accent-2); height: 100%; width: 0; transition: width .3s; }
.progress-text { font-size: .85rem; color: var(--muted); margin-top: .4rem; }

.recognize-options { display: flex; gap: 1rem; flex-wrap: wrap; }
.opt {
  flex: 1;
  min-width: 200px;
  background: #14171d;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
input[type=file] { color: var(--muted); font-size: .85rem; }

.result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.result.match { border-color: var(--accent-2); background: rgba(0,212,170,.08); }
.result.nomatch { border-color: var(--danger); background: rgba(255,92,108,.08); }
.result h3 { margin: 0 0 .5rem; }
.result .big { font-size: 1.35rem; font-weight: 600; color: var(--accent-2); }
.result .meta { color: var(--muted); font-size: .85rem; margin-top: .5rem; }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--muted); border-top-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Page de connexion --- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card { max-width: 380px; width: 100%; text-align: center; }
.login-card h1 { margin: 0 0 .25rem; }
.login-card form { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.25rem; }
.login-card input[type="password"] {
  padding: .7rem .9rem;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}
