/* ============================================
   Video Downloader Online — стили
   Минимальный «строгий» дизайн без зависимостей.
   ============================================ */
:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #232730;
  --border: #2a2f3a;
  --text: #e8eaee;
  --muted: #8a93a0;
  --accent: #4f8cff;
  --accent-hover: #3b78ee;
  --ok: #3fb950;
  --warn: #f0883e;
  --err: #f85149;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

.container { max-width: 800px; margin: 0 auto; padding: 24px; }
.container.narrow { max-width: 460px; }
.container.wide { max-width: 1100px; }

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
header.topbar a { color: var(--text); text-decoration: none; margin-right: 16px; }
header.topbar a:hover { color: var(--accent); }
header.topbar .brand { font-weight: 600; font-size: 17px; }
header.topbar .right form { display: inline; }

h1 { font-size: 24px; margin-top: 0; }
h2 { font-size: 18px; margin-top: 32px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; }

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

button, .btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-weight: 500;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  font-family: var(--font);
}
button:hover, .btn:hover { background: var(--accent-hover); }
button.secondary, .btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover, .btn.secondary:hover { background: var(--border); }
button.danger { background: var(--err); }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: #2a1717;
  border: 1px solid #5a2a2a;
  color: #f5b8b8;
}
.alert.info { background: #16242c; border-color: #2a4d5e; color: #b8d8f5; }
.alert.warn { background: #2c2616; border-color: #5e4d2a; color: #f5dfb8; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 500; }

/* --- Job card --- */
.job {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.job .title { font-weight: 500; margin-bottom: 4px; word-break: break-word; }
.job .url { color: var(--muted); font-size: 12px; word-break: break-all; }
.job .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }

.progress-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 10px 0 8px;
}
.progress-bar > div {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
}
.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill.queued { background: #333; color: var(--muted); }
.status-pill.downloading { background: #1e3a5f; color: #9bc9ff; }
.status-pill.ready { background: #1e4a2a; color: #98ee98; }
.status-pill.served { background: #2a3540; color: var(--muted); }
.status-pill.failed { background: #4a1e1e; color: #ff9b9b; }
.status-pill.expired { background: #4a3a1e; color: #ffce9b; }

.qr-code { display: block; max-width: 220px; margin: 16px auto; image-rendering: pixelated; }

ul.invite-list { list-style: none; padding: 0; }
ul.invite-list li {
  background: var(--panel-2); padding: 10px 14px; margin-bottom: 8px;
  border-radius: var(--radius); border: 1px solid var(--border);
  word-break: break-all; font-size: 13px;
}
ul.invite-list .url-box { color: var(--accent); }
