/* Modal guide téléchargement / VLC — thème secours violet glass */
.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 100000200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.dl-modal.open {
  display: flex;
}

.dl-modal[hidden] {
  display: none !important;
}

.dl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 14, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dl-modal__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(155, 140, 248, 0.28);
  background: linear-gradient(165deg, rgba(22, 22, 34, 0.98) 0%, rgba(14, 14, 22, 0.99) 100%);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 48px rgba(155, 140, 248, 0.08);
  color: #f0f0f8;
  animation: dlModalIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dlModalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dl-modal__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 1.35rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(155, 140, 248, 0.1), transparent);
}

.dl-modal__icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(155, 140, 248, 0.16);
  border: 1px solid rgba(155, 140, 248, 0.32);
  color: #b4a8ff;
}

.dl-modal__icon svg {
  width: 22px;
  height: 22px;
}

.dl-modal__head-text {
  flex: 1;
  min-width: 0;
}

.dl-modal__head-text h2 {
  margin: 0;
  font-family: var(--font-display, 'Instrument Serif', Georgia, serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.dl-modal__sub {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: rgba(240, 240, 248, 0.52);
  line-height: 1.45;
}

.dl-modal__close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.dl-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.dl-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.35rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 140, 248, 0.35) transparent;
}

.dl-modal__status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.1rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
}

.dl-modal__status::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dl-modal__status--ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.dl-modal__status--ok::before {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.55);
}

.dl-modal__status--warn {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

.dl-modal__status--warn::before {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.dl-modal__block {
  margin-bottom: 1.15rem;
}

.dl-modal__block:last-child {
  margin-bottom: 0;
}

.dl-modal__label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 240, 248, 0.48);
}

.dl-modal__link-row {
  display: flex;
  gap: 8px;
}

.dl-modal__link-field {
  flex: 1;
  min-width: 0;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.78rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
}

.dl-modal__copy {
  flex-shrink: 0;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid rgba(155, 140, 248, 0.45);
  background: rgba(155, 140, 248, 0.18);
  color: #ddd6fe;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dl-modal__copy:hover {
  background: rgba(155, 140, 248, 0.28);
  transform: translateY(-1px);
}

.dl-modal__hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(240, 240, 248, 0.45);
}

.dl-modal__vlc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.dl-modal__vlc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dl-modal__vlc-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff8800, #ff6600);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.dl-modal__vlc-brand strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
}

.dl-modal__vlc-brand span {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: rgba(240, 240, 248, 0.48);
}

.dl-modal__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dl-modal__stores a {
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.dl-modal__stores a:hover {
  border-color: rgba(155, 140, 248, 0.45);
  background: rgba(155, 140, 248, 0.12);
  color: #fff;
}

.dl-modal__guide-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 240, 248, 0.48);
}

.dl-modal__tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 0.85rem;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 3;
}

.dl-modal__tab {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(240, 240, 248, 0.52);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 4;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.dl-modal__tab:hover {
  color: rgba(255, 255, 255, 0.85);
}

.dl-modal__tab.is-active {
  background: rgba(155, 140, 248, 0.22);
  color: #fff;
  box-shadow: 0 2px 12px rgba(155, 140, 248, 0.18);
}

.dl-modal__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: dl-step;
}

.dl-modal__steps li {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(240, 240, 248, 0.78);
}

.dl-modal__steps li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dl-modal__steps li::before {
  counter-increment: dl-step;
  content: counter(dl-step);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #c4b5fd;
  background: rgba(155, 140, 248, 0.14);
  border: 1px solid rgba(155, 140, 248, 0.28);
}

.dl-modal__panel-block {
  display: none;
}

.dl-modal__panel-block.is-active {
  display: block;
}

.dl-modal__foot {
  padding: 0.85rem 1.35rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}

.dl-modal__done {
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #9b8cf8 0%, #7c6cf0 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(124, 108, 240, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dl-modal__done:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(124, 108, 240, 0.45);
}

body.download-guide-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .dl-modal__panel {
    border-radius: 18px;
  }

  .dl-modal__head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .dl-modal__body {
    padding: 0.95rem 1.1rem 1rem;
  }

  .dl-modal__foot {
    padding: 0.75rem 1.1rem 1rem;
  }

  .dl-modal__vlc {
    flex-direction: column;
    align-items: stretch;
  }

  .dl-modal__stores {
    justify-content: stretch;
  }

  .dl-modal__stores a {
    flex: 1;
    text-align: center;
  }

  .dl-modal__link-row {
    flex-direction: column;
  }

  .dl-modal__copy {
    width: 100%;
    padding: 0.72rem;
  }
}

/* Progression telechargement MP4 */
.dl-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px 8px;
}
.dl-progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.dl-progress__label {
  font-size: 14px;
  font-weight: 700;
  color: #f3f0ff;
}
.dl-progress__pct {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}
.dl-progress__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.dl-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f77f00, #a855f7);
  transition: width 0.25s ease;
}
.dl-progress__detail {
  margin: 0;
  font-size: 13px;
  color: rgba(235, 230, 255, 0.7);
  min-height: 1.2em;
}
.dl-progress__hint {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(235, 230, 255, 0.5);
}
.dl-modal__cancel {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.dl-modal__cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}
.dl-modal__foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Selecteur de sources */
.dl-picker { display: flex; flex-direction: column; gap: 12px; }
.dl-picker__status {
  margin: 0;
  font-size: 13.5px;
  color: rgba(235, 230, 255, 0.78);
  line-height: 1.45;
}
.dl-picker__loading {
  padding: 18px;
  text-align: center;
  color: rgba(235, 230, 255, 0.55);
  font-size: 13px;
}
.dl-picker__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding-right: 2px;
}
.dl-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.dl-opt:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(247, 127, 0, 0.35);
}
.dl-opt.is-rec {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(247, 127, 0, 0.12), rgba(168, 85, 247, 0.1));
}
.dl-opt__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dl-opt__src { font-size: 15px; font-weight: 800; }
.dl-opt__meta { display: flex; flex-wrap: wrap; gap: 5px; }
.dl-opt__cta {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f77f00, #c084fc);
  color: #1a1020;
}
.dl-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
.dl-pill--rec {
  background: rgba(251, 191, 36, 0.22);
  color: #fbbf24;
}
.dl-pill--tier { text-transform: capitalize; }
.dl-pill--size {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-variant-numeric: tabular-nums;
}
.dl-pill--size.is-loading {
  opacity: 0.55;
}
