/* ORX Downloader (ytdl.orx.ma) — ORX STREAM palette, light-weight, no frameworks.
   Same tokens as beta.orx.ma: bg #07070d, bg2 #0e0e18, card #151522,
   card2 #1c1c30, text #f5f5fa, muted #a2a2b8, accent #7c3aed,
   accent2 #c084fc, gold #f5c518, radius 14px. */
:root {
  --bg: #07070d;
  --bg2: #0e0e18;
  --card: #151522;
  --card2: #1c1c30;
  --text: #f5f5fa;
  --muted: #a2a2b8;
  --accent: #7c3aed;
  --accent2: #c084fc;
  --gold: #f5c518;
  --green: #22c55e;
  --red: #ef4444;
  --border: #2b2b48;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  background: rgba(7, 7, 13, .96);
  border-bottom: 1px solid #1e1e32;
}
.logo { font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.logo b { color: var(--accent2); }
.top-tag { color: var(--muted); font-size: 13px; font-weight: 600; }

.wrap { max-width: 820px; margin: 0 auto; padding: 20px 16px 40px; }
.hero { text-align: center; padding: 18px 0 8px; }
.hero h1 { font-size: 30px; font-weight: 900; margin-bottom: 8px; }
.sub { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 560px; margin: 0 auto 18px; }

.urlbox { display: flex; gap: 8px; max-width: 680px; margin: 0 auto; }
.urlbox input {
  flex: 1; min-width: 0;
  background: rgba(20, 20, 35, .85); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 18px; font-size: 15px; outline: none;
}
.urlbox input:focus { border-color: var(--accent); }
.btn-primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 22px; cursor: pointer; font-size: 15px; font-weight: 700;
  white-space: nowrap;
}
.btn-primary:hover { background: #8b5cf6; }
.btn-primary:disabled { opacity: .5; cursor: wait; }
.btn-ghost {
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 16px; cursor: pointer; font-size: 14px; font-weight: 700;
}
.btn-big { display: block; width: 100%; margin-top: 16px; padding: 15px; font-size: 16px; border-radius: var(--radius); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.pills span {
  background: rgba(124, 58, 237, .18); color: var(--accent2);
  border: 1px solid rgba(124, 58, 237, .35);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700;
}
.status { margin-top: 14px; color: var(--accent2); font-size: 14px; min-height: 20px; }
.status.error { color: #f87171; }

.card { background: var(--card); border: 1px solid #1e1e32; border-radius: var(--radius); }
.preview { display: flex; gap: 14px; padding: 14px; margin-top: 18px; align-items: center; }
.thumb { width: 168px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: #23233a; flex-shrink: 0; }
.preview-info h2 { font-size: 17px; line-height: 1.4; margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.6; }
.ready { color: var(--green); font-weight: 800; font-size: 13px; letter-spacing: .5px; margin-top: 8px; }

.qualities { margin-top: 22px; }
.qualities h2 { font-size: 20px; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.hint strong { color: var(--text); }
.group { margin-bottom: 18px; }
.group > h3 { font-size: 15px; margin-bottom: 8px; color: var(--accent2); }
.fmt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.fmt {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--card); color: var(--text);
  border: 1px solid #1e1e32; border-radius: 12px;
  padding: 11px 12px; cursor: pointer; font-size: 14px;
}
.fmt:hover { border-color: var(--accent); }
.fmt.selected { border-color: var(--accent); background: rgba(124, 58, 237, .18); box-shadow: 0 0 0 1px var(--accent); }
.fmt.disabled { opacity: .55; cursor: not-allowed; }
.fmt.disabled:hover { border-color: #1e1e32; }
.fmt .fmt-label { font-weight: 800; }
.fmt .fmt-size { color: var(--muted); font-size: 12px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 2px 8px; width: fit-content;
}
.badge-sound { background: rgba(34, 197, 94, .18); color: #4ade80; }
.badge-noaudio { background: rgba(245, 197, 24, .15); color: var(--gold); }
.badge-audio { background: rgba(124, 58, 237, .22); color: var(--accent2); }
.badge-vps { background: rgba(239, 68, 68, .15); color: #f87171; }

.audio-box { padding: 16px; margin-top: 6px; }
.audio-box h3 { font-size: 16px; margin-bottom: 6px; }
.audio-box select {
  width: 100%; margin-top: 10px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px;
}
.audio-label { font-weight: 700; font-size: 14px; }
.audio-dl { display: inline-block; margin-top: 12px; }
.center { text-align: center; }
#dlNote { margin-top: 10px; }

.how { padding: 18px; margin-top: 26px; }
.how h2 { font-size: 17px; margin-bottom: 10px; }
.how ol { padding-inline-start: 20px; line-height: 1.9; font-size: 14px; }
.how p { margin-top: 10px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 30px; line-height: 1.7; }

@media (max-width: 600px) {
  .hero h1 { font-size: 24px; }
  .urlbox { flex-wrap: wrap; }
  .urlbox input { flex-basis: 100%; }
  .urlbox .btn-ghost, .urlbox .btn-primary { flex: 1; }
  .preview { flex-direction: column; align-items: stretch; }
  .thumb { width: 100%; }
  .top-tag { display: none; }
}
