:root {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg), #020617);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
}

.screen { width: 100%; max-width: 720px; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
}

h1 { margin: 0 0 6px; font-size: 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); font-weight: 600; min-height: 1.2em; }
code { background: #0f172a; padding: 1px 6px; border-radius: 5px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

/* --- formulaire --- */
label { display: block; margin: 14px 0 6px; font-weight: 600; }
input[type="password"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  font-size: 1rem;
}
input[type="password"]:focus { outline: 2px solid var(--accent); }

/* --- boutons --- */
button, .button {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #052e16;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 0;
}
button.ghost:hover { color: var(--text); border-color: var(--muted); }

/* --- zone de dépôt --- */
.drop-zone {
  border: 2px dashed var(--border);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgb(34 197 94 / 0.06);
  outline: none;
}
.drop-icon { font-size: 2.2rem; margin: 6px 0; }

/* --- progression --- */
.progress-track {
  height: 10px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* --- résultat --- */
.report { padding-left: 20px; line-height: 1.7; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#preview {
  width: 100%;
  height: 480px;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

footer { max-width: 720px; text-align: center; margin-top: 8px; }

/* --- Profils de traitement --- */
fieldset.profiles {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px 20px;
  margin-bottom: 18px;
  background: var(--card);
}
fieldset.profiles legend {
  padding: 0 8px;
  font-weight: 700;
  color: var(--muted);
}
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  margin: 6px 0;
  transition: border-color 0.15s, background 0.15s;
}
.profile-card:hover { border-color: var(--accent); }
.profile-card:has(input:checked) {
  border-color: var(--accent);
  background: rgb(34 197 94 / 0.08);
}
.profile-card input { margin-top: 4px; accent-color: var(--accent); }
.profile-body { display: flex; flex-direction: column; gap: 2px; }
#custom-prefix-block { margin-top: 10px; }
