/* VoiceOver International — Linara Corporate Design (lokal, kein Tailwind/CDN). */

@font-face { font-family:'Roboto Flex'; src:url('/static/fonts/roboto-flex-vf.woff2') format('woff2-variations'); font-weight:100 900; font-display:swap; }
@font-face { font-family:'Roboto'; src:url('/static/fonts/roboto-400.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Roboto'; src:url('/static/fonts/roboto-500.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'Roboto'; src:url('/static/fonts/roboto-700.woff2') format('woff2'); font-weight:700; font-display:swap; }
@font-face { font-family:'Roboto Condensed'; src:url('/static/fonts/roboto-condensed-600.woff2') format('woff2'); font-weight:600; font-display:swap; }

:root {
  /* Linara-Palette (warm, Material-Theme) */
  --bg: #fbf9f8;
  --surface: #ffffff;
  --surface-2: #f5f3f3;
  --border: #e4e2e2;
  --text: #1b1c1c;
  --text-muted: #45493f;
  --text-faint: #757965;
  /* Lime = Hauptakzent: Links, Fokus, Erfolg, Fortschritt */
  --primary: #516600;
  --primary-hover: #3c4d00;
  --primary-soft: #eef3d6;
  --on-primary: #ffffff;
  /* Magenta = High-Impact-CTAs */
  --magenta: #ab2478;
  --magenta-hover: #8a005e;
  --magenta-soft: #ffd8e8;
  --on-magenta: #ffffff;
  --success: #516600;
  --success-soft: #eef3d6;
  --warning: #8a6100;
  --warning-soft: #f7ecc8;
  --danger: #ba1a1a;
  --danger-soft: #ffdad6;
  --radius: 16px;     /* Karten/Bilder */
  --radius-sm: 8px;   /* Buttons/Inputs */
  --shadow-sm: 0 1px 2px rgba(27, 28, 28, 0.05);
  --shadow: 0 8px 24px rgba(27, 28, 28, 0.10);
  --shadow-lg: 0 16px 40px rgba(27, 28, 28, 0.14);
  --font: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-head: 'Roboto Flex', 'Roboto', sans-serif;
  --font-label: 'Roboto Condensed', 'Roboto', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.4em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: auto; display: block;
}
.topnav { display: flex; gap: 6px; align-items: center; }
.topnav a {
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-weight: 550;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar-spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 0.9rem;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 0.8rem;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head .subtitle { color: var(--text-muted); margin: 0; }
.breadcrumb { color: var(--text-faint); font-size: 0.85rem; margin-bottom: 6px; }
.breadcrumb a { color: var(--text-muted); }

.grid { display: grid; gap: 20px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .cols-2 { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 0.85rem; }

/* ---------- Video cards ---------- */
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
  display: flex; flex-direction: column;
}
.video-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.video-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  background-size: cover; background-position: center;
  display: grid; place-items: center; color: var(--text-faint);
}
.video-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.video-card-body h3 { font-size: 1rem; margin: 0; }
.video-card-body a { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 0.92rem; font-weight: 600; font-family: inherit;
  cursor: pointer; line-height: 1;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--magenta); color: var(--on-magenta); }
.btn-primary:hover { background: var(--magenta-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
label { display: block; font-family: var(--font-label); font-weight: 600; font-size: 0.88rem; letter-spacing: 0.01em; margin-bottom: 6px; color: var(--text); }
.field { margin-bottom: 16px; }
input[type=text], input[type=password], input[type=number], input[type=url],
input[type=file], select, textarea {
  width: 100%;
  font-family: inherit; font-size: 0.95rem;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.help { font-size: 0.8rem; color: var(--text-faint); margin-top: 4px; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 650;
  background: var(--surface-2); color: var(--text-muted);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }

/* ---------- Alerts ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--primary-soft); color: #3730a3; border-color: #c7d2fe; }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.alert-success { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }

/* ---------- Embed ---------- */
.embed {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  background: #000; box-shadow: var(--shadow);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Tables / lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row audio { height: 36px; }
.result-row { flex-wrap: wrap; }
.result-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-faint); }

/* ---------- TTS / dub specifics ---------- */
audio { width: 100%; max-width: 320px; }
.cost-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--primary-soft); color: var(--primary);
  padding: 6px 14px; border-radius: 999px; font-weight: 700;
}
.cost-pill .label { font-family: var(--font-label); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }

.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lang-tile {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.lang-tile.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow-sm); }
.lang-tile .lang-head { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.lang-tile .lang-config { display: flex; flex-direction: column; gap: 8px; }
.lang-tile select { background: var(--surface); font-size: 0.85rem; padding: 7px 9px; }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--primary-soft); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-line { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.9rem; }

/* htmx-Lade-Indikator: nur während eines laufenden Requests sichtbar.
   htmx setzt die Klasse .htmx-request auf das auslösende Element (hier das <form>). */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }
form.htmx-request [type="submit"] { opacity: .55; pointer-events: none; }

.empty {
  text-align: center; padding: 36px 20px; color: var(--text-faint);
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}

.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.stack > * + * { margin-top: 16px; }
.tag-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 18% -10%, #eef3d6, transparent),
    radial-gradient(900px 520px at 100% 110%, #ffe3f1, var(--bg));
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 1.2rem; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; }
