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

:root {
  --bg: #0b0b12;
  --bg2: #13131f;
  --card: #191927;
  --border: #2a2a3f;
  --text: #eef0ff;
  --muted: #8b8fa8;
  --accent: #a855f7;
  --accent2: #ec4899;
  --green: #34d399;
  --red: #f87171;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
}

h1, h2, h3, .logo { font-family: 'Sora', sans-serif; }

.hidden { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,11,18,.85); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-size: 1.3rem; font-weight: 800; }
.logo span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.user-area { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; }
.user-area button {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: .85rem;
}
.user-area button:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Auth ---------- */
.auth-view {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 70px); padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px; text-align: center;
}
.auth-card h1 { font-size: 1.7rem; margin-bottom: 10px; }
.tagline { color: var(--muted); font-size: .92rem; margin-bottom: 26px; line-height: 1.5; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
  flex: 1; padding: 10px; background: var(--bg2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600;
}
.tab.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff; border-color: transparent;
}
#authForm { display: flex; flex-direction: column; gap: 12px; }
.auth-error, .form-error { color: var(--red); font-size: .85rem; margin-top: 12px; min-height: 1.2em; }

/* ---------- Formular ---------- */
input, textarea, select {
  width: 100%; padding: 12px 14px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: .95rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 74px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
label small { color: var(--muted); font-weight: 400; }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff; border: none; padding: 12px 22px; border-radius: 12px;
  font-weight: 700; font-size: .95rem; cursor: pointer;
  font-family: 'Sora', sans-serif; text-decoration: none; display: inline-block; text-align: center;
  transition: transform .12s, box-shadow .12s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(168,85,247,.35); }
.btn-primary:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.btn-primary.big { width: 100%; padding: 15px; font-size: 1.05rem; margin-top: 20px; }
.btn-secondary {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 12px; font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); }

/* ---------- Layout ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 80px; }
.create-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px; margin-bottom: 36px;
}
.create-panel h2, .gallery-panel h2 { margin-bottom: 6px; font-size: 1.25rem; }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .row, .row.two { grid-template-columns: 1fr; } }

/* ---------- Galerie ---------- */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px; margin-top: 18px;
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; position: relative;
}
.card .thumb {
  width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block;
  background: var(--bg2); cursor: pointer;
}
.card .thumb-placeholder {
  width: 100%; aspect-ratio: 9/16; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: var(--bg2); padding: 16px; text-align: center;
}
.card .step { color: var(--muted); font-size: .82rem; }
.card .bar { width: 80%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.card .bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .6s;
}
.card .meta { padding: 12px 14px; }
.card .meta h4 { font-size: .88rem; line-height: 1.35; margin-bottom: 4px; font-family: 'Sora',sans-serif; }
.card .meta .date { color: var(--muted); font-size: .75rem; }
.card .status-err { color: var(--red); font-size: .8rem; }
.card .del {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.55); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: .85rem;
}
.card .del:hover { background: var(--red); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  display: flex; gap: 22px; padding: 22px; max-width: 860px; width: 100%;
  max-height: 92vh; position: relative;
}
.modal-box video { height: min(78vh, 640px); aspect-ratio: 9/16; border-radius: 12px; background: #000; }
.modal-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.modal-info h3 { margin-bottom: 10px; }
.caption {
  color: var(--muted); font-size: .88rem; line-height: 1.5;
  white-space: pre-wrap; overflow-y: auto; flex: 1; margin-bottom: 16px;
}
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
}
@media (max-width: 720px) {
  .modal-box { flex-direction: column; overflow-y: auto; }
  .modal-box video { height: auto; width: 100%; max-height: 60vh; }
}
