/* ==========================================================================
   OceanForge — style.css
   Dunkles Tech-Design, kein Framework, mobile-first, responsive.
   ========================================================================== */

:root {
  --bg: #0a0e14;
  --bg-alt: #0f1520;
  --panel: #131b28;
  --panel-alt: #182234;
  --panel-border: #223049;
  --line: #1e2a3d;

  --text: #e6edf5;
  --text-dim: #9fb0c3;
  --text-faint: #6a7d94;

  --accent: #22d3c8;        /* Ocean-Cyan */
  --accent-dim: #17998f;
  --accent-glow: rgba(34, 211, 200, 0.18);
  --forge: #ff8a3d;         /* Forge-Orange, sparsam für CTAs/Status */
  --forge-dim: #cc6a26;

  --ok: #34d399;
  --warn: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --maxw: 1180px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #0a0e14;
    --bg-alt: #0f1520;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(34, 211, 200, 0.08), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(255, 138, 61, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg, canvas { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #6fe6dd; text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--text-dim); }

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

code, pre { font-family: var(--font-mono); }
pre {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  overflow-x: auto;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 20, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--forge));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #06110f;
  font-weight: 800;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-link.is-active { color: var(--accent); }

.nav-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--panel-border);
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.nav-credits .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

/* Mobile nav toggle (kein JS-Framework nötig — Checkbox-Hack) */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--panel);
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  border-radius: 2px;
}
.nav-toggle-label span::before { content: ""; position: absolute; top: -6px; }
.nav-toggle-label span::after { content: ""; position: absolute; top: 6px; }

@media (max-width: 780px) {
  .nav-toggle-label { display: block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    order: 3;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-link { padding: 12px; }
  .nav-credits { align-self: flex-start; margin: 6px 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #06110f;
}
.btn-primary:hover { background: linear-gradient(135deg, #4fe2d8, var(--accent)); color: #06110f; }

.btn-forge {
  background: linear-gradient(135deg, var(--forge), var(--forge-dim));
  color: #200f04;
}
.btn-forge:hover { background: linear-gradient(135deg, #ffa563, var(--forge)); color: #200f04; }

.btn-ghost {
  background: transparent;
  border-color: var(--panel-border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--panel); border-color: var(--accent-dim); }

.btn-danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--error);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.field .hint { font-size: 0.78rem; color: var(--text-faint); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { font-size: 0.88rem; color: var(--text-dim); font-weight: 400; }

.auth-card {
  max-width: 420px;
  margin: 56px auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-faint); font-size: 0.88rem; margin-bottom: 24px; }
.auth-links { margin-top: 20px; font-size: 0.85rem; color: var(--text-faint); display: flex; flex-direction: column; gap: 6px; }

/* ---------- Flash messages ---------- */
.flashes { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-success { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); color: #a8f0d3; }
.flash-error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }
.flash-info { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.35); color: #bfdbfe; }
.flash-warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.35); color: #fde68a; }

/* ---------- Layout helpers ---------- */
main { flex: 1; padding: 32px 0 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--text-faint); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--panel-border);
  white-space: nowrap;
}
.badge-queued { color: var(--info); border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.08); }
.badge-generating { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.badge-running { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.badge-ready { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.badge-ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.badge-failed { color: var(--error); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.badge-error { color: var(--error); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.badge-active { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.badge-pending { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.badge-blocked { color: var(--error); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.badge-admin { color: var(--forge); border-color: rgba(255, 138, 61, 0.4); background: rgba(255, 138, 61, 0.08); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--panel-border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 0.88rem; white-space: nowrap; }
th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; background: var(--bg-alt); }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
tbody tr:last-child td { border-bottom: none; }
td.wrap, th.wrap { white-space: normal; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Landing ---------- */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--panel-border);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero h1 { max-width: 780px; margin-left: auto; margin-right: auto; }
.hero .lead { max-width: 640px; margin: 0 auto 32px; font-size: 1.08rem; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.section-head p { margin: 0; }
.eyebrow { color: var(--accent); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; display: block; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.step-card, .usp-card, .price-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px;
  height: 100%;
}

.step-num {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--panel-alt);
  border: 1px solid var(--panel-border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 16px;
}

.usp-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 1.1rem;
}

.price-card { display: flex; flex-direction: column; }
.price-card.is-highlight { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim), var(--shadow); position: relative; }
.price-card.is-highlight::before {
  content: "Beliebt";
  position: absolute;
  top: -11px;
  left: 24px;
  background: var(--accent);
  color: #06110f;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.price-name { font-weight: 700; color: var(--text-dim); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.06em; }
.price-amount { font-size: 2.1rem; font-weight: 800; margin: 10px 0 4px; }
.price-amount small { font-size: 0.95rem; color: var(--text-faint); font-weight: 500; }
.price-credits { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.price-card .btn { margin-top: auto; }

.cta-band {
  text-align: center;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--text-faint);
  font-size: 0.82rem;
}
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-faint); }
.footer-links a:hover { color: var(--text); }

/* ---------- Dashboard ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; } }
.stat-card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .stat-label { color: var(--text-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-card .stat-value.accent { color: var(--accent); }

.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s ease;
}
.job-row:hover { border-color: var(--accent-dim); }
.job-row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.job-row-title { font-weight: 700; }
.job-row-meta { font-size: 0.8rem; color: var(--text-faint); }
.job-row-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-faint); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* ---------- Job Detail / Viewer ---------- */
.job-detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 980px) { .job-detail-grid { grid-template-columns: 1fr; } }

.viewer-wrap {
  background: radial-gradient(circle at 50% 30%, #1c2635, #0c121c 75%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
#stl-viewer {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  touch-action: none;
}
.viewer-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background: rgba(10, 14, 20, 0.72);
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}
.viewer-overlay.is-hidden { display: none; }
.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--panel-border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.viewer-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--panel-border); flex-wrap: wrap; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; padding: 0 0 20px 26px; border-left: 2px solid var(--line); }
.timeline-item:last-child { border-color: transparent; padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--accent-dim);
}
.timeline-item.is-error::before { border-color: var(--error); }
.timeline-item.is-ok::before { border-color: var(--ok); }
.timeline-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.timeline-title { font-weight: 700; font-size: 0.92rem; }
.timeline-meta { font-size: 0.78rem; color: var(--text-faint); }
.timeline-body { font-size: 0.85rem; color: var(--text-dim); }
.timeline-error { margin-top: 6px; font-size: 0.82rem; color: var(--error); background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.25); border-radius: var(--radius-sm); padding: 10px 12px; }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.admin-tab { padding: 10px 16px; color: var(--text-dim); font-size: 0.9rem; font-weight: 600; border-bottom: 2px solid transparent; }
.admin-tab:hover { color: var(--text); text-decoration: none; }
.admin-tab.is-active { color: var(--accent); border-color: var(--accent); }

.kbd { font-family: var(--font-mono); background: var(--bg-alt); border: 1px solid var(--panel-border); border-radius: 4px; padding: 1px 6px; font-size: 0.82rem; }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  main { padding: 24px 0 48px; }
  .auth-card { margin: 24px auto; padding: 24px 20px; }
  .hero { padding: 48px 0 36px; }
  .section { padding: 40px 0; }
}
