/* ==========================================================================
   Comic Studio - Stylesheet
   ========================================================================== */

:root {
  --cs-primary: #ff4d6d;
  --cs-accent: #4d7cff;
  --ink: #14161a;
  --ink-soft: #5a6070;
  --line: #e3e6ee;
  --bg: #f6f7fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(20, 22, 26, .08);
  --shadow-lg: 0 18px 48px rgba(20, 22, 26, .14);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--cs-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

/* ---------------------------------------------------------------- Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--cs-primary); color: #fff; font-size: .95rem; font-weight: 900;
}
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--ink); font-weight: 600; font-size: .95rem; }
.site-nav a:hover { color: var(--cs-primary); text-decoration: none; }
.nav-plain { color: var(--ink-soft) !important; }
.nav-toggle, .nav-burger { display: none; }
.badge {
  display: inline-block; min-width: 20px; padding: 0 6px;
  background: var(--cs-primary); color: #fff; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-align: center; vertical-align: 2px;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 0; border-radius: 999px;
  font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--cs-primary); color: #fff; box-shadow: 0 8px 20px rgba(255, 77, 109, .28); }
.btn-primary:hover { color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn-outline { background: transparent; color: var(--cs-primary); border: 2px solid var(--cs-primary); }
.btn-danger { background: #e03131; color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------------- Layout */
.site-main { padding-bottom: 70px; }
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-alt { background: #fff; }
.center { text-align: center; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 700px; }
.center .lead { margin-left: auto; margin-right: auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------------------------------------------------------------- Hero */
.hero {
  background:
    radial-gradient(1000px 460px at 12% -10%, rgba(255, 77, 109, .16), transparent 60%),
    radial-gradient(900px 420px at 92% 0%, rgba(77, 124, 255, .16), transparent 60%),
    #fff;
  border-bottom: 1px solid var(--line);
  padding: 74px 0 66px;
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 77, 109, .12); color: var(--cs-primary);
  padding: 7px 15px; border-radius: 999px; font-weight: 800; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px;
}
.hero h1 span { color: var(--cs-primary); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; }
.hero-points li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.hero-points li::before {
  content: "✓"; color: #fff; background: var(--cs-primary);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .8rem; flex: 0 0 22px; margin-top: 3px;
}

.mock-stack { position: relative; min-height: 380px; }
.mock-page {
  position: absolute; background: #fff; border: 3px solid var(--ink);
  border-radius: 8px; box-shadow: var(--shadow-lg); padding: 12px;
  display: grid; gap: 8px;
}
.mock-page.one { width: 62%; left: 0; top: 22px; transform: rotate(-6deg); grid-template-columns: 1fr 1fr; }
.mock-page.two { width: 62%; right: 0; top: 0; transform: rotate(5deg); grid-template-columns: 1fr; }
.mock-cell { background: linear-gradient(135deg, #ffe1e7, #dfe7ff); border: 2px solid var(--ink); border-radius: 4px; min-height: 72px; }
.mock-cell.tall { min-height: 150px; }
.mock-bubble {
  background: #fff; border: 2px solid var(--ink); border-radius: 14px;
  padding: 6px 10px; font-size: .74rem; font-weight: 700;
}

/* ---------------------------------------------------------------- Steps */
.steps { counter-reset: step; }
.step-card { position: relative; padding-top: 34px; }
.step-card::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -18px; left: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-weight: 900;
}

/* ---------------------------------------------------------------- Genres */
.genre-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.genre-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 20px; transition: transform .12s ease, box-shadow .12s ease;
}
.genre-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.genre-card h3 { margin-bottom: 4px; font-size: 1.02rem; }
.genre-card p { margin: 0; color: var(--ink-soft); font-size: .9rem; }

/* ---------------------------------------------------------------- FAQ */
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 12px;
}
.faq summary { font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-weight: 900; color: var(--cs-primary); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; color: var(--ink-soft); }

/* ---------------------------------------------------------------- Formulare */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .92rem; }
.form-row .hint { color: var(--ink-soft); font-size: .84rem; margin: 6px 0 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 11px 14px; border: 2px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cs-accent); }
textarea { min-height: 120px; resize: vertical; }
input[type=file] { font: inherit; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 26px; }
.form-narrow { max-width: 460px; margin: 0 auto; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.checkbox input { margin-top: 5px; }

.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice {
  position: relative; border: 2px solid var(--line); border-radius: 12px;
  padding: 16px; cursor: pointer; background: #fff; transition: border-color .12s ease, box-shadow .12s ease;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice strong { display: block; font-size: .98rem; }
.choice span { color: var(--ink-soft); font-size: .85rem; }
.choice:has(input:checked) { border-color: var(--cs-primary); box-shadow: 0 0 0 3px rgba(255, 77, 109, .14); }

/* ---------------------------------------------------------------- Wizard */
.wizard-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.wizard-steps li {
  list-style: none; padding: 7px 15px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: .85rem; font-weight: 700; color: var(--ink-soft);
}
.wizard-steps li.active { background: var(--cs-primary); border-color: var(--cs-primary); color: #fff; }
.wizard-steps li.done { border-color: var(--cs-primary); color: var(--cs-primary); }

.character-block {
  border: 2px dashed var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; background: #fff;
}
.character-block h3 { margin-bottom: 14px; }
.character-photo { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.character-photo img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); }

/* ---------------------------------------------------------------- Bibliothek */
.comic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.comic-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.comic-cover { aspect-ratio: 5 / 7; background: linear-gradient(135deg, #ffe1e7, #dfe7ff); display: grid; place-items: center; }
.comic-cover img { width: 100%; height: 100%; object-fit: cover; }
.comic-cover .placeholder { color: var(--ink-soft); font-weight: 700; font-size: .85rem; text-align: center; padding: 16px; }
.comic-body { padding: 16px 18px 20px; }
.comic-body h3 { font-size: 1.02rem; margin-bottom: 4px; }
.comic-meta { color: var(--ink-soft); font-size: .84rem; margin-bottom: 12px; }

.status {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.status.is-draft { background: #eef0f5; color: #626a7d; }
.status.is-queued { background: #fff4d6; color: #8a6100; }
.status.is-progress { background: #e0ecff; color: #1c56c4; }
.status.is-ready { background: #dcf6e4; color: #12703a; }
.status.is-revision { background: #ffe6d6; color: #a34700; }
.status.is-failed { background: #ffe0e0; color: #b02020; }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: var(--cs-primary); border-radius: 999px; transition: width .4s ease; }

/* ---------------------------------------------------------------- Reader */
.reader { background: #14161a; min-height: 70vh; padding: 26px 0 46px; }
.reader .wrap { color: #fff; }
.reader-stage { display: grid; place-items: center; }
.reader-stage img { max-height: 82vh; width: auto; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.reader-bar a, .reader-bar span { color: #fff; }
.reader-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 18px 0 4px; }
.reader-thumbs a { flex: 0 0 74px; }
.reader-thumbs img { width: 74px; border-radius: 4px; border: 2px solid transparent; }
.reader-thumbs a.active img { border-color: var(--cs-primary); }

/* ---------------------------------------------------------------- Seiten */
.page-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.page-tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.page-tile img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; background: #eef0f5; }
.page-tile .page-tile-body { padding: 8px 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.page-tile small { color: var(--ink-soft); font-weight: 700; }

/* ---------------------------------------------------------------- Tabellen */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
.table th { background: #f2f4f9; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.table tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Meldungen */
.alert { padding: 14px 18px; border-radius: 10px; margin: 20px 0; font-weight: 600; border: 1px solid transparent; }
.alert-success { background: #dcf6e4; color: #12703a; border-color: #b6e6c6; }
.alert-error { background: #ffe0e0; color: #a01c1c; border-color: #f5bcbc; }
.alert-info { background: #e0ecff; color: #1c56c4; border-color: #bcd4f7; }
.alert-warning { background: #fff4d6; color: #8a6100; border-color: #f3e0a8; }
.alert ul { margin: 8px 0 0 18px; padding: 0; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty h3 { color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .meta { color: var(--ink-soft); font-size: .84rem; }

.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat strong { display: block; font-size: 1.9rem; line-height: 1.1; }
.stat span { color: var(--ink-soft); font-size: .85rem; font-weight: 700; }

/* ---------------------------------------------------------------- Footer */
.site-footer { background: var(--ink); color: #c9ccd6; padding: 34px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-footer strong { color: #fff; font-size: 1.05rem; }
.site-footer p { margin: 4px 0 0; font-size: .9rem; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: #c9ccd6; font-size: .9rem; }

/* ---------------------------------------------------------------- Admin */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 68px); }
.admin-side { background: #fff; border-right: 1px solid var(--line); padding: 22px 0; }
.admin-side a {
  display: block; padding: 11px 24px; color: var(--ink); font-weight: 700; font-size: .92rem;
  border-left: 3px solid transparent;
}
.admin-side a:hover { background: #f5f6fa; text-decoration: none; }
.admin-side a.active { border-left-color: var(--cs-primary); color: var(--cs-primary); background: rgba(255, 77, 109, .07); }
.admin-content { padding: 28px 30px 60px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1000px) {
  .grid-4, .genre-grid, .comic-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner, .split { grid-template-columns: 1fr; }
  .mock-stack { min-height: 320px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; padding: 8px; }
  .admin-side a { border-left: 0; border-bottom: 3px solid transparent; padding: 10px 14px; }
  .admin-side a.active { border-left: 0; border-bottom-color: var(--cs-primary); }
  .admin-content { padding: 22px 18px 50px; }
}

@media (max-width: 760px) {
  .nav-burger {
    display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px;
  }
  .nav-burger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }
  .site-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: 10px 20px 18px;
  }
  .site-nav a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 12px; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .grid-2, .grid-3, .grid-4, .genre-grid, .comic-grid, .choice-grid, .stat-grid { grid-template-columns: 1fr; }
  .page-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 46px 0; }
}
