:root {
  --bg: #0e1116;
  --card: #171c24;
  --border: #262d39;
  --text: #e8ecf2;
  --muted: #8b95a5;
  --accent: #22d3ee;
  --accent2: #0ea5e9;
  --danger: #f87171;
  --ok: #4ade80;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }
.error { color: var(--danger); font-size: 0.85rem; margin-top: 8px; }

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

#login-screen .card { width: 340px; display: flex; flex-direction: column; gap: 12px; }
#login-screen h1 { font-size: 1.4rem; }

input, textarea, select {
  width: 100%;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}
textarea { resize: vertical; }

button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #06222a;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.95rem;
}
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); width: 100%; margin-top: 12px; }
button.primary:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(14,17,22,0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}
header h1 { font-size: 1.15rem; }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h2 { font-size: 1rem; margin-bottom: 12px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); }
.dropzone img {
  max-height: 300px;
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 10px auto 0;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; flex: 1; }
.field span { font-size: 0.85rem; color: var(--muted); }

.row { display: flex; gap: 14px; }

.templates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.chip {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 500;
  font-size: 0.8rem;
}
.chip:hover { border-color: var(--accent); }

#result-area { min-height: 140px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; }
#result-area video { max-width: 100%; max-height: 480px; border-radius: 10px; }
#result-area .meta { font-size: 0.85rem; color: var(--muted); }
.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-running { background: #1e3a5f; color: #7dd3fc; }
.status-completed { background: #143a26; color: var(--ok); }
.status-error { background: #3a1414; color: var(--danger); }
.status-cancelled { background: #2d2d2d; color: var(--muted); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.gallery-item {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.gallery-item:hover { border-color: var(--accent); }
.gallery-item video { width: 100%; display: block; }
.gallery-item .g-meta { padding: 8px 10px; font-size: 0.72rem; color: var(--muted); display: flex; justify-content: space-between; }
.gallery-item .g-title { padding: 8px 10px 2px; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
