/* ---------------------------------------------------------------------------
   Portal-Stile.

   Die Farb- und Schrift-Variablen sind bewusst dieselben wie in index.html,
   damit Login und Portal nicht wie ein fremdes Produkt wirken. Das eigentliche
   Design kommt in einem spaeteren Schritt — hier geht es nur um eine saubere,
   ruhige Grundlage.
   --------------------------------------------------------------------------- */

:root {
  --ink: #04141f;
  --navy: #004078;
  --navy-deep: #00294d;
  --navy-soft: #e8f0f7;
  --orange: #f05008;
  --orange-deep: #b03a06;
  --mint: #3fcf9e;
  --paper: #fbf8f2;
  --line: rgba(0, 64, 120, 0.14);
  --ink-soft: #4a5568;
  --danger: #c0392b;
  --radius: 14px;
  --maxw: 1080px;
  --font-display: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; line-height: 1.6; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--orange);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.eyebrow::before { content: ''; width: 16px; height: 2px; background: var(--orange); }

/* ------------------------------------------------------------------ Header -- */

header.portal {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 248, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.portal .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
  text-decoration: none;
}
.brand span { color: var(--orange); }
.spacer { flex: 1; }

.whoami {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
  line-height: 1.35;
}
.whoami strong { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------- Cards -- */

main { padding: 44px 0 80px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: 0 18px 50px rgba(0, 41, 77, .08);
}

/* -------------------------------------------------------------- Formulare -- */

label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0, 64, 120, .10);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--orange-deep); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--navy); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(192, 57, 43, .3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 22px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* --------------------------------------------------------------- Meldungen -- */

.msg {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.msg[hidden] { display: none; }
.msg.error { background: #fdecea; color: #8e2419; border: 1px solid rgba(192, 57, 43, .22); }
.msg.ok { background: #e8f7f0; color: #17694a; border: 1px solid rgba(63, 207, 158, .35); }
.msg.info { background: var(--navy-soft); color: var(--navy-deep); border: 1px solid var(--line); }

.hint { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }

/* ------------------------------------------------------------- Video-Grid -- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.video-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.video-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 41, 77, .10); }

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(140deg, var(--navy-deep), var(--navy));
  display: grid;
  place-items: center;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-btn {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  display: grid;
  place-items: center;
}
.play-btn::after {
  content: '';
  border-left: 15px solid var(--navy-deep);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}

.video-body { padding: 16px 18px 18px; }
.video-title { font-weight: 650; font-size: 15.5px; line-height: 1.35; }
.video-desc { font-size: 13.5px; color: var(--ink-soft); margin-top: 6px; }
.video-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 10px;
  letter-spacing: .04em;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--orange);
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 8px;
}

.empty {
  margin-top: 28px;
  padding: 44px 26px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* -------------------------------------------------------------- Player ---- */

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 20, 38, .86);
  display: grid;
  place-items: center;
  padding: 24px;
}
.player-overlay[hidden] { display: none; }
.player-box { width: min(1000px, 100%); }
.player-box video,
.player-box iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
  border-radius: 10px;
  display: block;
}
.player-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  color: #fff;
}
.player-bar h2 { font-size: 17px; flex: 1; }
.player-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  border-radius: 8px;
  padding: 6px 13px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* -------------------------------------------------------------- Tabellen -- */

table.users { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
table.users th, table.users td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; }
table.users td.actions { text-align: right; white-space: nowrap; }
table.users td.actions .btn { margin-left: 6px; }

.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.pill.active { background: #e8f7f0; color: #17694a; }
.pill.disabled { background: #f1f1f1; color: #6b6b6b; }

.copybox {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.copybox input {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.lang-switch { display: flex; gap: 2px; }
.lang-switch button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.lang-switch button.active { background: var(--navy-soft); color: var(--navy-deep); }

/* ------------------------------------------------------------------ Upload -- */

.upload {
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--navy-soft);
}
.upload[hidden] { display: none; }
.upload label { margin-top: 0; }

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.upload-row input[type="file"] {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink-soft);
}

.upload-progress { margin-top: 12px; }
.upload-progress[hidden] { display: none; }

.upload-bar {
  height: 6px;
  border-radius: 99px;
  background: #fff;
  overflow: hidden;
}
.upload-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--orange);
  transition: width .18s linear;
}

.upload-status {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.upload-status.ok { color: var(--navy-deep); font-weight: 500; }
.upload-status.error { color: var(--danger); }

@media (max-width: 640px) {
  header.portal .inner { padding: 12px 18px; gap: 12px; }
  .container { padding: 0 18px; }
  .whoami { display: none; }
  table.users thead { display: none; }
  table.users td { display: block; border: 0; padding: 4px 0; }
  table.users tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.users td.actions { text-align: left; margin-top: 10px; }
  table.users td.actions .btn { margin: 0 6px 6px 0; }
}
