/* povkaktus – gemeinsame Grundlagen für Website und Panel */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #04060c;
  --bg-2: #070b15;
  --line: rgba(130, 170, 255, 0.11);
  --line-2: rgba(130, 170, 255, 0.2);
  --line-3: rgba(130, 170, 255, 0.32);
  --text: #e9eef9;
  --text-2: #b9c4da;
  --muted: #8693ac;
  --dim: #5d6882;
  --green: #3dffa2;
  --cyan: #2ee6ff;
  --violet: #8b6cff;
  --violet-hell: #bba9ff;
  --pink: #ff5fd2;
  --amber: #ffc857;
  --red: #ff5f7a;
  --grad: linear-gradient(100deg, #3dffa2 0%, #2ee6ff 48%, #8b6cff 100%);
  --grad-loop: linear-gradient(90deg, #3dffa2 0%, #2ee6ff 25%, #8b6cff 50%, #2ee6ff 75%, #3dffa2 100%);
  --karte: linear-gradient(180deg, rgba(18, 27, 46, 0.74), rgba(9, 14, 26, 0.74));
  --radius: 22px;
  --radius-s: 14px;
  --wrap: 1200px;
  --kopf-h: 76px;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--kopf-h) + 16px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: rgba(46, 230, 255, 0.32); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
p, li { text-wrap: pretty; }

.wrap { width: min(var(--wrap), calc(100% - 48px)); margin-inline: auto; }
.wrap-schmal { width: min(880px, calc(100% - 48px)); }
@media (max-width: 600px) {
  .wrap, .wrap-schmal { width: calc(100% - 32px); }
}

.ic { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Hintergrund: Aurora, Gitter, Partikel, Rauschen ---------- */

.hintergrund {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 78% -12%, rgba(139, 108, 255, 0.16), transparent 62%),
    radial-gradient(900px 520px at -5% 8%, rgba(61, 255, 162, 0.08), transparent 60%),
    var(--bg);
}
.aurora {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
  animation: treiben 28s var(--ease) infinite alternate;
}
.a1 { background: #3dffa2; top: -20vmax; left: -12vmax; opacity: 0.16; }
.a2 { background: #2ee6ff; top: 18vmax; right: -18vmax; opacity: 0.13; animation-duration: 34s; animation-delay: -6s; }
.a3 { background: #8b6cff; bottom: -24vmax; left: 28vw; opacity: 0.21; animation-duration: 40s; animation-delay: -12s; }
@keyframes treiben {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); }
  100% { transform: translate3d(-4vmax, 8vmax, 0) scale(0.94); }
}
.gitter {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(130, 170, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 170, 255, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 15%, transparent 75%);
}
#partikel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.75; }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typo-Bausteine ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 0.78rem/1.2 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow .ic { width: 16px; height: 16px; }
.grad-text {
  background: var(--grad-loop);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: schimmer 10s linear infinite;
}
@keyframes schimmer { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
.zusammen { white-space: nowrap; }
.lead { font-size: 1.1rem; color: var(--text-2); }
.klein { font-size: 0.85rem; color: var(--muted); }
.klein-hinweis { font-size: 0.85rem; color: var(--muted); line-height: 1.55; }

.puls {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.puls::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid currentColor;
  animation: puls 2.2s var(--ease) infinite;
}
@keyframes puls { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(3.2); opacity: 0; } }

/* ---------- Knöpfe ---------- */

.btn {
  --h: 50px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  height: var(--h);
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s, opacity 0.2s;
}
.btn .ic { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.btn:hover .ic-arrow { transform: translateX(3px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary {
  color: #021710;
  background: var(--grad);
  box-shadow: 0 10px 36px -12px rgba(46, 230, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px -12px rgba(46, 230, 255, 0.95), 0 0 0 1px rgba(61, 255, 162, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  border-color: rgba(46, 230, 255, 0.55);
  background: rgba(46, 230, 255, 0.07);
  box-shadow: 0 0 32px -10px rgba(46, 230, 255, 0.65);
  transform: translateY(-2px);
}
.btn-gefahr {
  color: #ffd0d8;
  background: rgba(255, 95, 122, 0.08);
  border-color: rgba(255, 95, 122, 0.35);
}
.btn-gefahr:hover { background: rgba(255, 95, 122, 0.16); border-color: rgba(255, 95, 122, 0.6); }
.btn-klein { --h: 40px; padding: 0 16px; font-size: 0.88rem; }
.btn-klein .ic { width: 16px; height: 16px; }
.btn[disabled], .btn.laedt { opacity: 0.55; pointer-events: none; }
.btn.laedt::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: drehen 0.7s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

.link-pfeil {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s, gap 0.25s var(--ease);
}
.link-pfeil .ic { width: 18px; height: 18px; }
.link-pfeil:hover { color: var(--cyan); gap: 12px; }

/* ---------- Karten (Glas mit Lichtkegel am Mauszeiger) ---------- */

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--karte);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 30px 60px -32px rgba(0, 0, 0, 0.7);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(440px circle at var(--mx, -999px) var(--my, -999px), rgba(46, 230, 255, 0.09), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(320px circle at var(--mx, -999px) var(--my, -999px), rgba(61, 255, 162, 0.8), rgba(46, 230, 255, 0.35) 35%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::before, .card:hover::after { opacity: 1; }

.icon-box {
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--green);
  background: linear-gradient(135deg, rgba(61, 255, 162, 0.17), rgba(46, 230, 255, 0.07));
  border: 1px solid rgba(61, 255, 162, 0.32);
  box-shadow: 0 0 30px -8px rgba(61, 255, 162, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.icon-box .ic { width: 27px; height: 27px; }
.icon-box.violett {
  color: var(--violet-hell);
  background: linear-gradient(135deg, rgba(139, 108, 255, 0.22), rgba(46, 230, 255, 0.06));
  border-color: rgba(139, 108, 255, 0.42);
  box-shadow: 0 0 30px -8px rgba(139, 108, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.chip, .status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font: 500 0.72rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.chip .ic { width: 14px; height: 14px; }
.chip .puls { width: 6px; height: 6px; }
.chip-gruen { color: var(--green); border-color: rgba(61, 255, 162, 0.36); background: rgba(61, 255, 162, 0.07); }
.chip-violett { color: var(--violet-hell); border-color: rgba(139, 108, 255, 0.42); background: rgba(139, 108, 255, 0.1); }
.chip-cyan { color: var(--cyan); border-color: rgba(46, 230, 255, 0.4); background: rgba(46, 230, 255, 0.08); }
.chip-amber { color: var(--amber); border-color: rgba(255, 200, 87, 0.4); background: rgba(255, 200, 87, 0.08); }
.chip-grau { color: var(--muted); }

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

.feld { display: grid; align-content: start; gap: 8px; min-width: 0; }
.feld > label, .feld-label { font-size: 0.86rem; font-weight: 600; color: var(--text-2); }
.feld-info { font: 0.74rem var(--font-mono); color: var(--dim); justify-self: end; }
.eingabe, .feld input, .feld select, .feld textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-2);
  background: rgba(3, 7, 15, 0.6);
  color: var(--text);
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.feld textarea, textarea.eingabe { min-height: 120px; resize: vertical; }
.eingabe::placeholder, .feld input::placeholder, .feld textarea::placeholder { color: var(--dim); }
.eingabe:focus, .feld input:focus, .feld select:focus, .feld textarea:focus {
  outline: none;
  border-color: rgba(46, 230, 255, 0.6);
  background: rgba(6, 12, 24, 0.85);
  box-shadow: 0 0 0 4px rgba(46, 230, 255, 0.12), 0 0 26px -6px rgba(46, 230, 255, 0.5);
}
.feld.fehlerhaft input, .feld.fehlerhaft textarea, .feld.fehlerhaft select { border-color: rgba(255, 95, 122, 0.75); }
select.eingabe, .feld select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232ee6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}
select option { background: #0b1220; color: var(--text); }
.form-zeile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 720px) { .form-zeile { grid-template-columns: 1fr; } }

.check { display: flex; align-items: flex-start; gap: 12px; font-size: 0.92rem; color: var(--text-2); cursor: pointer; }
.check input {
  appearance: none;
  width: 21px;
  height: 21px;
  flex: none;
  margin: 1px 0 0;
  display: grid;
  place-content: center;
  border-radius: 7px;
  border: 1px solid var(--line-3);
  background: rgba(3, 7, 15, 0.6);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.check input::before {
  content: "";
  width: 11px;
  height: 11px;
  background: #021710;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform 0.15s var(--ease);
}
.check input:checked { background: var(--grad); border-color: transparent; box-shadow: 0 0 16px -2px rgba(46, 230, 255, 0.7); }
.check input:checked::before { transform: scale(1); }
.check a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(46, 230, 255, 0.4); }
.check.fehlerhaft input { border-color: rgba(255, 95, 122, 0.8); }

.form-fehler {
  padding: 13px 16px;
  border-radius: var(--radius-s);
  border: 1px solid rgba(255, 95, 122, 0.38);
  background: rgba(255, 95, 122, 0.1);
  color: #ffc6d0;
  font-size: 0.93rem;
}
.form-ok {
  padding: 13px 16px;
  border-radius: var(--radius-s);
  border: 1px solid rgba(61, 255, 162, 0.38);
  background: rgba(61, 255, 162, 0.08);
  color: #c4ffe3;
  font-size: 0.93rem;
}

.lader {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(46, 230, 255, 0.25);
  border-top-color: var(--cyan);
  animation: drehen 0.8s linear infinite;
}

/* ---------- Nachrichtenverlauf (Ticketseite und Panel) ---------- */

.verlauf { display: grid; gap: 18px; }
.nachricht { display: grid; gap: 8px; max-width: min(720px, 88%); animation: auftauchen 0.45s var(--ease) both; }
.nachricht.kunde { justify-self: end; }
.nachricht.admin { justify-self: start; }
.nachricht.system { justify-self: center; max-width: 100%; }
.nachricht-kopf { display: flex; align-items: center; gap: 10px; font: 0.76rem var(--font-mono); color: var(--muted); }
.nachricht.kunde .nachricht-kopf { justify-content: flex-end; }
.nachricht-kopf strong { color: var(--text-2); font-weight: 600; }
.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}
.avatar .ic { width: 16px; height: 16px; }
.avatar img { width: 20px; height: 20px; }
.nachricht.admin .avatar { border-color: rgba(61, 255, 162, 0.38); background: rgba(61, 255, 162, 0.08); }
.blase {
  padding: 15px 19px;
  border-radius: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  color: var(--text);
}
.nachricht.kunde .blase {
  background: linear-gradient(135deg, rgba(46, 230, 255, 0.15), rgba(139, 108, 255, 0.15));
  border: 1px solid rgba(46, 230, 255, 0.3);
  border-bottom-right-radius: 6px;
}
.nachricht.admin .blase {
  background: rgba(13, 21, 38, 0.88);
  border: 1px solid var(--line-2);
  border-bottom-left-radius: 6px;
  box-shadow: inset 3px 0 0 rgba(61, 255, 162, 0.55);
}
.nachricht.system .blase {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px dashed var(--line-2);
  font: 0.76rem var(--font-mono);
  color: var(--muted);
}
@keyframes auftauchen { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.status-offen { color: var(--amber); border-color: rgba(255, 200, 87, 0.4); background: rgba(255, 200, 87, 0.08); }
.status-beantwortet { color: var(--green); border-color: rgba(61, 255, 162, 0.38); background: rgba(61, 255, 162, 0.07); }
.status-geschlossen { color: var(--muted); }

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #partikel { display: none; }
}
