/* ── Tokens ── */
:root {
  --bg:        #101010;
  --panel:     #13131a;
  --panel-2:   #18181f;
  --surface:   #1c1c26;
  --inputs:    #232323;
  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.04);
  --text:      #e6e6f0;
  --muted:     #7a7d8c;
  --accent:    #7c74f5;
  --accent-lo: rgba(124,116,245,.12);
  --danger:    #ff6b6b;
  --danger-lo: rgba(255,107,107,.1);
  --r:         14px;
  --r-sm:      10px;
  --hit:       46px;
  --font:      'DM Sans', system-ui, sans-serif;
  --mono:      'DM Mono', monospace;
  --header-h:  73px;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────
   Layout shell
───────────────────────────────────────── */
.nm {
  min-height: 100svh;
  padding: 0 0 60px;
}

/* ─────────────────────────────────────────
   Header / Stepper — fixed at top
───────────────────────────────────────── */
.nm__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: fixed;
  top: 0;
  left: var(--sidebar-w, 260px);
  right: 0;
  z-index: 100;
}

.nm__back {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.nm__back:hover { color: var(--text); border-color: rgba(255,255,255,.14); background: var(--inputs); }
.nm__back svg { width: 16px; height: 16px; }

.nm__header-ghost { width: 38px; flex-shrink: 0; }

/* Stepper */
.nm__stepper {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  max-width: 340px;
}

.nm__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  user-select: none;
}

.nm__step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--inputs);
  display: grid;
  place-items: center;
  transition: border-color .25s, background .25s, box-shadow .25s;
}

.nm__step-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
  transition: color .25s;
}

.nm__step-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  transition: color .25s;
}

.nm__step.is-active .nm__step-dot {
  border-color: var(--accent);
  background: var(--accent-lo);
  box-shadow: 0 0 0 4px rgba(124,116,245,.12);
}
.nm__step.is-active .nm__step-num   { color: var(--accent); }
.nm__step.is-active .nm__step-label { color: var(--text); }

.nm__step.is-done .nm__step-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.nm__step.is-done .nm__step-num   { color: #fff; }
.nm__step.is-done .nm__step-label { color: var(--muted); }

.nm__step-line {
  flex: 1;
  height: 1px;
  background: var(--line);
  margin: 0 8px;
  margin-bottom: 16px;
  transition: background .25s;
}
.nm__step-line.is-done { background: var(--accent); }

/* ─────────────────────────────────────────
   Alert (Symfony form error banner)
───────────────────────────────────────── */
.nm__alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: calc(var(--header-h) + 16px) clamp(16px, 4vw, 40px) 0;
  padding: 12px 14px;
  color: #ffc8c8;
  background: rgba(255,107,107,.08);
  border: 1px solid rgba(255,107,107,.2);
  border-radius: var(--r);
  font-size: 14px;
}
.nm__alert svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─────────────────────────────────────────
   Panels wrapper — offset by header height
───────────────────────────────────────── */
.nm__panels {
  display: grid;
  padding: calc(var(--header-h) + clamp(20px, 4vw, 48px)) clamp(16px, 4vw, 40px) 0;
}

/* ─────────────────────────────────────────
   Panel
───────────────────────────────────────── */
.nm__panel {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vw, 32px);
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.nm__panel[hidden] { display: none; }

.nm__panel.is-active {
  animation: panelIn .3s cubic-bezier(.22,1,.36,1) both;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nm__panel-head { display: flex; flex-direction: column; gap: 4px; }

.nm__panel-count {
  margin: 0;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nm__panel-title {
  margin: 0;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.nm__panel-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─────────────────────────────────────────
   Fields
───────────────────────────────────────── */
.nm__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nm__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nm__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Inputs */
.nm__input,
.nm__select {
  height: var(--hit);
  padding: 0 14px;
  background: var(--inputs);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.nm__input::placeholder { color: var(--muted); }

.nm__input:focus,
.nm__select:focus,
.nm__textarea:focus,
.tagify:focus-within {
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

/* Validation error state */
.nm__input.is-error,
.nm__select.is-error,
.nm__textarea.is-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-lo) !important;
}
.tagify.is-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-lo) !important;
}
.nm__dropzone.is-error {
  border-color: var(--danger) !important;
}

/* Inline JS validation message */
.nm__field-error {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--danger);
  display: none;
}
.nm__field-error.is-visible { display: block; }

/* Select */
.nm__select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-color: var(--inputs);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237a7d8c' viewBox='0 0 16 16'><path d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.nm__select option { background: var(--inputs); color: var(--text); }
.nm__select::-ms-expand { display: none; }

/* Textarea */
.nm__textarea {
  min-height: 100px;
  max-height: 240px;
  resize: none;
  overflow: hidden;
  padding: 12px 14px;
  background: var(--inputs);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.nm__textarea::placeholder { color: var(--muted); }

/* Tagify overrides */
.tagify {
  --tag-bg: var(--inputs) !important;
  --tag-text-color: var(--text) !important;
  --tag-border-radius: 8px !important;
  --tag-remove-btn-color: var(--muted) !important;
  --placeholder-color: var(--muted) !important;
  --input-color: var(--text) !important;

  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  min-height: var(--hit);
  height: auto !important;
  background: var(--inputs);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  transition: border-color .15s, box-shadow .15s;
}
.tagify::-webkit-scrollbar { display: none; }
.tagify__tag {
  margin: 0 !important;
  background: var(--inputs) !important;
  border-radius: 7px !important;
}
.tagify__tag-text { color: var(--text) !important; }
.tagify__input { min-width: 100px; color: var(--text) !important; }
.tagify__input::before { color: var(--muted) !important; }

/* Grid rows */
.nm__row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .nm__row--2 { grid-template-columns: 1fr 1fr; }
  .nm__row--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ─────────────────────────────────────────
   Dropzone
───────────────────────────────────────── */
.nm__dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r);
  background: var(--inputs);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
  position: relative;
  overflow: hidden;
}
.nm__dropzone:hover,
.nm__dropzone.is-dragover {
  border-color: rgba(255,255,255,.2);
}

.nm__file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.nm__dropzone-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.nm__dz-icon { width: 32px; height: 32px; color: var(--muted); }

.nm__dz-text { font-size: 14px; color: var(--muted); line-height: 1.4; }
.nm__dz-text u { color: var(--text); text-decoration-color: rgba(255,255,255,.3); }

.nm__dz-hint {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  opacity: .6;
}

.nm__dz-preview {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  pointer-events: none;
}
.nm__dropzone--cover.has-file { padding: 12px; }

.nm__dropzone--audio.has-file { flex-direction: row; padding: 14px 18px; gap: 12px; }

.nm__dz-audio-chosen {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.nm__dz-audio-chosen svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.nm__dz-filename {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────────────────────────────────────
   Audio player
───────────────────────────────────────── */
.nm__player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--inputs);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.nm__player[hidden] { display: none !important; }

.nm__play {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.nm__play:hover { opacity: .85; }
.nm__icon { width: 14px; height: 14px; display: block; }
.nm__icon--pause { display: none; }
.nm__play.is-playing .nm__icon--play  { display: none; }
.nm__play.is-playing .nm__icon--pause { display: block; }

.nm__time {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  min-width: 34px;
  text-align: center;
  flex-shrink: 0;
}

.nm__seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border: none;
  background: var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.nm__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: var(--text);
  border-radius: 50%; border: none;
}
.nm__seek::-moz-range-thumb {
  width: 12px; height: 12px;
  background: var(--text);
  border-radius: 50%; border: none;
}

.nm__mute {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s;
}
.nm__mute:hover { color: var(--text); }
.nm__mute svg { width: 13px; height: 13px; }
.nm__mute.is-muted { opacity: .4; }

.nm__vol {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  flex-shrink: 0;
  cursor: pointer;
}
.nm__vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  background: var(--text);
  border-radius: 50%; border: none;
}
.nm__vol::-moz-range-thumb {
  width: 10px; height: 10px;
  background: var(--text);
  border-radius: 50%; border: none;
}

/* ─────────────────────────────────────────
   Nav row
───────────────────────────────────────── */
.nm__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 12px;
}

/* ─────────────────────────────────────────
   Buttons
───────────────────────────────────────── */
.nm__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--hit);
  padding: 0 20px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.nm__btn:hover  { opacity: .88; }
.nm__btn:active { transform: scale(.98); }
.nm__btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.nm__btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.nm__btn--ghost:hover { color: var(--text); border-color: rgba(255,255,255,.18); }

.nm__btn--publish {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(124,116,245,0);
  transition: opacity .15s, transform .1s, box-shadow .2s;
}
.nm__btn--publish:hover {
  opacity: 1;
  box-shadow: 0 0 24px rgba(124,116,245,.35);
}

/* ─────────────────────────────────────────
   Symfony form errors
───────────────────────────────────────── */
.form-error,
ul.form-error {
  color: var(--danger);
  font-size: 12px;
  font-family: var(--mono);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 700px) {
  :root { --header-h: 60px; }
  .nm__header { left: 0; }
  .nm__player { flex-wrap: wrap; }
  .nm__vol { width: 60px; }
  .nm__step-label { display: none; }
  .nm__back { width: 32px; height: 32px; }
  .nm__header-ghost { width: 32px; }
}

@media (max-width: 480px) {
  :root { --hit: 48px; --header-h: 56px; }

  .nm__header { padding: 0 16px; }
  .nm__panels { padding-left: 16px; padding-right: 16px; }
  .nm__panel-title { font-size: 20px; }

  .nm__input,
  .nm__select,
  .nm__textarea { font-size: 16px; }

  .nm__dropzone { padding: 24px 16px; }

  .nm__player { padding: 8px 10px; gap: 8px; }
  .nm__vol  { display: none; }
  .nm__mute { display: none; }

  .nm__nav { flex-direction: row; gap: 10px; }
  .nm__btn { flex: 1; justify-content: center; }
  .nm__btn--ghost { flex: 0 0 auto; }

  .nm__row--2,
  .nm__row--3 { grid-template-columns: 1fr !important; }
}
