/* =========================================
   Pflegenotizen · Modern colorful design
   ========================================= */

:root {
  --bg: #0b0f1a;
  --bg-2: #0f172a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --text-dim: #cbd5e1;
  --text-soft: #94a3b8;

  --c-violet: #7c3aed;
  --c-pink: #ec4899;
  --c-orange: #f97316;
  --c-teal: #14b8a6;
  --c-blue: #3b82f6;
  --c-amber: #f59e0b;
  --c-rose: #f43f5e;
  --c-lime: #84cc16;

  --grad-1: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f97316 100%);
  --grad-2: linear-gradient(135deg, #14b8a6 0%, #3b82f6 100%);
  --grad-3: linear-gradient(135deg, #f59e0b 0%, #f43f5e 100%);
  --grad-4: linear-gradient(135deg, #84cc16 0%, #14b8a6 100%);

  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(124, 58, 237, 0.25);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Animated background blobs ---------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top left, rgba(124, 58, 237, 0.15), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(236, 72, 153, 0.12), transparent 50%),
    linear-gradient(180deg, #0b0f1a 0%, #0f172a 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.blob.b1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #7c3aed, transparent);
  top: -120px; left: -80px;
}

.blob.b2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #ec4899, transparent);
  top: 30%; right: -120px;
  animation-delay: -7s;
}

.blob.b3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #14b8a6, transparent);
  bottom: -100px; left: 30%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  display: inline-flex;
  filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.4));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text small {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.nav a {
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.25s ease;
}

.nav a:hover {
  background: var(--surface);
  color: var(--text);
}

.nav a.active {
  background: var(--grad-1);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 14px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-1);
  color: #fff;
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(236, 72, 153, 0.5);
}

.btn-secondary {
  background: var(--grad-2);
  color: #fff;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}
.btn-secondary:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 18px;
}

/* ---------- Main area ---------- */
.app-root {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  min-height: calc(100vh - 160px);
}

/* ---------- Hero (home) ---------- */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-lime);
  box-shadow: 0 0 10px var(--c-lime);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}

.hero h1 .grad {
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Feature book preview ---------- */
.book-preview {
  margin: 80px auto 40px;
  max-width: 680px;
  perspective: 2000px;
}

.book {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  transform: rotateX(6deg) rotateY(-16deg);
  transform-style: preserve-3d;
  animation: bookIn 1.2s cubic-bezier(.2,.9,.2,1) both;
}

@keyframes bookIn {
  from { transform: rotateX(30deg) rotateY(-40deg) translateY(40px); opacity: 0; }
  to   { transform: rotateX(6deg) rotateY(-16deg); opacity: 1; }
}

.book::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-1);
  border-radius: 10px 22px 22px 10px;
  box-shadow:
    0 40px 80px rgba(124, 58, 237, 0.35),
    inset -30px 0 40px rgba(0, 0, 0, 0.25);
}

.book::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 18px;
  background: linear-gradient(90deg, rgba(0,0,0,.4), transparent);
  border-radius: 10px 0 0 10px;
}

.book .cover-content {
  position: absolute;
  inset: 16px 40px 16px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.book .cover-content h2 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.5vw, 44px);
  font-weight: 800;
  margin: 0;
  line-height: 1;
}

.book .cover-content .tag {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.85;
}

.book .cover-content .plus {
  font-size: 48px;
  opacity: 0.3;
}

/* ---------- Feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 60px 0;
}

.feature {
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.feature:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.feature .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: #fff;
}

.feature:nth-child(1) .icon { background: var(--grad-1); }
.feature:nth-child(2) .icon { background: var(--grad-2); }
.feature:nth-child(3) .icon { background: var(--grad-3); }
.feature:nth-child(4) .icon { background: var(--grad-4); }

.feature h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.feature p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ---------- Section title ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 28px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 0;
  color: var(--text-dim);
  max-width: 560px;
}

/* ---------- Search ---------- */
.search {
  position: relative;
  margin: 20px 0 32px;
}

.search input {
  width: 100%;
  padding: 18px 24px 18px 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.search input::placeholder { color: var(--text-soft); }

.search input:focus {
  outline: none;
  border-color: var(--c-violet);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

.search::before {
  content: '';
  position: absolute;
  left: 22px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3-3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ---------- Category filter ---------- */
.cat-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.cat-filter button {
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}
.cat-filter button:hover { color: var(--text); }
.cat-filter button.active {
  background: var(--grad-1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}

/* ---------- Library card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: transform 0.35s cubic-bezier(.2,.9,.2,1), box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-lg);
}

.card .cover {
  aspect-ratio: 4 / 5;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 22px;
  overflow: hidden;
}

.card .cover::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.96;
}

.card:nth-child(5n+1) .cover::before { background: var(--grad-1); }
.card:nth-child(5n+2) .cover::before { background: var(--grad-2); }
.card:nth-child(5n+3) .cover::before { background: var(--grad-3); }
.card:nth-child(5n+4) .cover::before { background: var(--grad-4); }
.card:nth-child(5n+5) .cover::before { background: linear-gradient(135deg, #8b5cf6, #0ea5e9); }

.card .cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,.25), transparent 50%);
}

.card .cover-text {
  position: relative;
  z-index: 2;
  color: #fff;
}

.card .cover-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  backdrop-filter: blur(8px);
}

.card .cover-text h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.card .cover-text .subtitle {
  font-size: 12px;
  opacity: 0.9;
  font-style: italic;
}

.card .body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.card .body p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.card .price {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.card .price .free {
  color: var(--c-lime);
}

.card .card-actions {
  display: flex;
  gap: 8px;
}
.card .buy-btn {
  padding: 8px 14px;
  background: var(--grad-1);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.card .buy-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.card .read-btn {
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.card .read-btn:hover {
  background: var(--grad-1);
  border-color: transparent;
  color: #fff;
}

/* ---------- Book reader ---------- */
.reader {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.reader-header {
  padding: 40px 48px 32px;
  position: relative;
  color: #fff;
}

.reader-header.g1 { background: var(--grad-1); }
.reader-header.g2 { background: var(--grad-2); }
.reader-header.g3 { background: var(--grad-3); }
.reader-header.g4 { background: var(--grad-4); }

.reader-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.2), transparent 50%);
}

.reader-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(255,255,255,.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.reader-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.05;
  text-shadow: 0 2px 16px rgba(0,0,0,.2);
  position: relative;
  z-index: 2;
}

.reader-header .subtitle {
  font-size: 16px;
  font-style: italic;
  opacity: 0.92;
  position: relative;
  z-index: 2;
}

.reader-body {
  padding: 36px 48px 48px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.75;
  color: #0f172a;
  background: #fdfcf7;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(0,0,0,0.05) calc(50% - 0.5px), rgba(0,0,0,0.05) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  background-size: 40px 100%;
  position: relative;
}

.reader-body h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  margin: 32px 0 12px;
  color: var(--c-violet);
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-body h2::before {
  content: '';
  width: 6px;
  height: 28px;
  background: var(--grad-1);
  border-radius: 4px;
}

.reader-body h2:first-child {
  margin-top: 0;
}

.reader-body h3 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 22px 0 8px;
}

.reader-body p {
  margin: 0 0 16px;
  color: #1e293b;
}

.reader-body ul, .reader-body ol {
  margin: 12px 0 20px;
  padding-left: 24px;
  color: #1e293b;
}

.reader-body li {
  margin-bottom: 6px;
}

.reader-body .note {
  background: #fef3c7;
  border-left: 4px solid var(--c-amber);
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-family: var(--font-sans);
  font-size: 15px;
}

.reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
}

.reader-body th,
.reader-body td {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  text-align: left;
  vertical-align: top;
}

.reader-body thead tr {
  background: #f3f4f6;
}

.reader-body th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #374151;
}

.reader-body tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

@media (max-width: 600px) {
  .reader-body table {
    font-size: 12.5px;
  }
  .reader-body th,
  .reader-body td {
    padding: 6px 8px;
  }
}

/* ---------- Preview lock overlay ---------- */
.locked {
  position: relative;
}

.locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, #fdfcf7 90%);
  pointer-events: none;
}

.paywall {
  background: #fdfcf7;
  padding: 32px 48px 48px;
  text-align: center;
  border-top: 1px dashed rgba(0,0,0,0.12);
}

.paywall-inner {
  max-width: 520px;
  margin: 0 auto;
}

.paywall .lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad-1);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.paywall h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: #0f172a;
  margin: 0 0 10px;
}

.paywall p {
  color: #475569;
  font-family: var(--font-sans);
  font-size: 15px;
  margin: 0 0 24px;
}

.paywall .price-tag {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 800;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 20px;
}

/* ---------- Back bar ---------- */
.back-bar {
  margin-bottom: 18px;
}

.back-bar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}
.back-bar a:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- Modal (Checkout) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.75);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.35s cubic-bezier(.2,.9,.2,1);
}

@keyframes modalIn {
  from { transform: translateY(30px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--surface-2); transform: rotate(90deg); }

.modal h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  margin: 0 0 6px;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal .modal-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 24px;
}

/* ---------- Form ---------- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-violet);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.file-drop:hover {
  border-color: var(--c-violet);
  background: rgba(124, 58, 237, 0.1);
}
.file-drop .hint {
  font-size: 12px;
  color: var(--text-soft);
}
.file-drop input { display: none; }
.file-drop.has-file {
  border-color: var(--c-lime);
  background: rgba(132, 204, 22, 0.08);
}

/* ---------- Bank box ---------- */
.bank-box {
  background: var(--grad-2);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.bank-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.2), transparent 50%);
}
.bank-box h4 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
  position: relative;
}
.bank-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  position: relative;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.bank-row:last-child { border-bottom: none; }
.bank-row strong { font-size: 16px; font-family: var(--font-serif); }
.bank-row button {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 10px;
}

/* ---------- Success / Info ---------- */
.success-box {
  text-align: center;
  padding: 20px 0;
}
.success-box .check {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--grad-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(20, 184, 166, 0.4);
  animation: pop 0.5s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ---------- About page ---------- */
.about {
  max-width: 760px;
  margin: 0 auto;
}
.about h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 56px);
  margin: 0 0 20px;
}
.about p {
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.75;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 40px 20px 30px;
  color: var(--text-soft);
  font-size: 13px;
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.footer-admin {
  color: var(--text-soft);
  text-decoration: none;
  opacity: 0.6;
  transition: all 0.2s;
}
.footer-admin:hover {
  color: var(--c-violet);
  opacity: 1;
}

/* ---------- Admin ---------- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #14b8a6, #10b981);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(20, 184, 166, 0.35);
  margin-left: 8px;
  transition: all 0.25s ease;
}
.admin-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.5);
}
.admin-badge span {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #14b8a6, #10b981);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.reader-admin-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 2;
}

/* ========================================
   ADMIN DASHBOARD
   ======================================== */

.admin-dashboard {
  max-width: 900px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 4px;
}
.admin-header p {
  color: var(--text-dim);
  margin: 0;
  font-size: 14px;
}
.admin-header-actions {
  display: flex;
  gap: 10px;
}

.admin-alert {
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 13px;
  margin-bottom: 24px;
}
.admin-alert-ok {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
}
.stat-label {
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.stat-neu .stat-num { color: #f59e0b; }
.stat-verifiziert .stat-num { color: #3b82f6; }
.stat-gesendet .stat-num { color: #10b981; }

.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-section-title h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0;
}

.admin-empty {
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  color: var(--text-dim);
}

.admin-orders {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}
.order-card:hover {
  border-color: rgba(255,255,255,0.2);
}

.order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.order-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.order-date {
  font-size: 12px;
  color: var(--text-soft);
}

.order-main {
  margin-bottom: 14px;
}
.order-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.order-customer {
  font-size: 14px;
  color: var(--text-dim);
}
.order-customer a {
  color: var(--c-blue);
  text-decoration: none;
}
.order-customer a:hover {
  text-decoration: underline;
}
.order-ref {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
}
.order-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 10px;
}

.order-done-label {
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
}

.order-delete {
  margin-left: auto;
  font-size: 18px;
  color: var(--text-soft) !important;
  padding: 5px 10px !important;
}
.order-delete:hover {
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.1) !important;
}

@media (max-width: 600px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-header {
    flex-direction: column;
  }
  .order-actions {
    gap: 6px;
  }
}

/* ========================================
   FULL-SCREEN BOOK READER MODE
   ======================================== */

/* Hide chrome when in book mode */
body.book-mode .topbar,
body.book-mode .footer {
  display: none !important;
}

body.book-mode .app-root {
  max-width: none;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

body.book-mode {
  overflow: hidden;
}

.book-view {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #faf9f5;
}

/* --- Book top bar --- */
.book-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 210;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.book-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.2s;
}
.book-back:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.book-topbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

.book-toc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}
.book-toc-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* --- Sidebar TOC --- */
.book-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 300px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 205;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}

.book-sidebar-head {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.book-sidebar-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff;
  margin-bottom: 10px;
}
.book-sidebar-cat.g1 { background: var(--grad-1); }
.book-sidebar-cat.g2 { background: var(--grad-2); }
.book-sidebar-cat.g3 { background: var(--grad-3); }
.book-sidebar-cat.g4 { background: var(--grad-4); }

.book-sidebar-head h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 4px;
  line-height: 1.2;
}

.book-sidebar-head p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  font-style: italic;
}

.book-toc {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.toc-link {
  display: block;
  padding: 10px 24px;
  font-size: 13px;
  color: #94a3b8;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  line-height: 1.4;
}
.toc-link:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.04);
}
.toc-link.active {
  color: #fff;
  background: rgba(124, 58, 237, 0.15);
  border-left-color: var(--c-violet);
  font-weight: 600;
}

.book-sidebar-admin {
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 600;
  color: #14b8a6;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.book-sidebar-overlay {
  display: none;
}

/* --- Main reading area --- */
.book-content {
  flex: 1;
  margin-left: 300px;
  margin-top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #faf9f5;
}

.book-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 40px;
}

/* --- Chapter header --- */
.book-chapter-head {
  padding: 60px 0 48px;
  margin-bottom: 8px;
  border-bottom: 3px double rgba(0,0,0,0.12);
  position: relative;
}

.book-ch-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.book-chapter-head.g1 .book-ch-cat { background: var(--grad-1); color: #fff; }
.book-chapter-head.g2 .book-ch-cat { background: var(--grad-2); color: #fff; }
.book-chapter-head.g3 .book-ch-cat { background: var(--grad-3); color: #fff; }
.book-chapter-head.g4 .book-ch-cat { background: var(--grad-4); color: #fff; }

.book-chapter-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 8px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.book-ch-sub {
  font-size: 17px;
  color: #64748b;
  margin: 0;
  font-style: italic;
  font-family: var(--font-serif);
}

.book-ch-admin {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #14b8a6;
}

/* --- Book text content --- */
.book-text {
  font-family: var(--font-serif);
  font-size: 17.5px;
  line-height: 1.85;
  color: #1e293b;
}

.book-section {
  padding: 36px 0 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  scroll-margin-top: 72px;
}
.book-section:last-child {
  border-bottom: none;
}

.book-text h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  color: #7c3aed;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(124, 58, 237, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
}
.book-text h2::before {
  content: '';
  width: 5px;
  height: 26px;
  background: var(--grad-1);
  border-radius: 3px;
  flex-shrink: 0;
}

.book-text h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: #334155;
  margin: 24px 0 8px;
}

.book-text p {
  margin: 0 0 16px;
  color: #334155;
  text-align: justify;
  hyphens: auto;
}

.book-text ul, .book-text ol {
  margin: 10px 0 18px;
  padding-left: 24px;
  color: #334155;
}
.book-text li {
  margin-bottom: 6px;
}

.book-text .note {
  background: #fef9e7;
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

.book-text strong {
  color: #0f172a;
}

.book-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font-sans);
}
.book-text th,
.book-text td {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  text-align: left;
  vertical-align: top;
}
.book-text thead tr {
  background: #f3f0e8;
}
.book-text th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}
.book-text tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.02);
}

/* --- Paywall in book mode --- */
.book-paywall {
  padding: 48px 0 60px;
  text-align: center;
  border-top: 2px dashed rgba(0,0,0,0.1);
  margin-top: 20px;
}
.book-paywall-inner {
  max-width: 480px;
  margin: 0 auto;
}
.book-lock-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}
.book-paywall h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: #1e293b;
  margin: 0 0 10px;
}
.book-paywall p {
  color: #64748b;
  font-family: var(--font-sans);
  font-size: 15px;
  text-align: center;
  margin: 0 0 20px;
}
.book-price {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 800;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 20px;
}

/* --- Bottom chapter navigation --- */
.book-bottom-nav {
  display: flex;
  gap: 16px;
  padding: 32px 0 60px;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 32px;
}
.book-bottom-nav a,
.book-bottom-nav span {
  flex: 1;
}
.book-nav-prev,
.book-nav-next {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: #f1ede4;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.25s;
  border: 1px solid rgba(0,0,0,0.06);
}
.book-nav-prev:hover,
.book-nav-next:hover {
  background: #e8e3d8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.book-nav-prev span,
.book-nav-next span {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.book-nav-prev strong,
.book-nav-next strong {
  font-family: var(--font-serif);
  font-size: 15px;
  color: #334155;
}
.book-nav-next {
  text-align: right;
}

/* --- Reading progress bar --- */
.book-progress {
  position: fixed;
  top: 56px;
  left: 300px;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.06);
  z-index: 211;
}
.book-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-1);
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* --- Mobile responsive --- */
@media (max-width: 900px) {
  .book-sidebar {
    transform: translateX(-100%);
  }
  .book-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.4);
  }
  .book-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 204;
    background: rgba(0,0,0,0.5);
    display: none;
  }
  .book-sidebar-overlay.open {
    display: block;
  }
  .book-content {
    margin-left: 0;
  }
  .book-progress {
    left: 0;
  }
  .book-page {
    padding: 0 24px;
  }
  .book-chapter-head {
    padding: 40px 0 32px;
  }
  .book-text {
    font-size: 16.5px;
    line-height: 1.8;
  }
}

@media (max-width: 480px) {
  .book-topbar-title {
    display: none;
  }
  .book-back span {
    display: none;
  }
  .book-page {
    padding: 0 16px;
  }
  .book-chapter-head h1 {
    font-size: 28px;
  }
  .book-text h2 {
    font-size: 20px;
  }
  .book-bottom-nav {
    flex-direction: column;
  }
  .book-nav-next {
    text-align: left;
  }
}

/* Desktop: show sidebar, hide toggle */
@media (min-width: 901px) {
  .book-toc-btn {
    display: none;
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar { padding: 14px 18px; gap: 12px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { display: none; }
  .nav a { padding: 8px 12px; font-size: 13px; }
  .app-root { padding: 24px 18px 60px; }
  .hero { padding: 30px 10px 20px; }
  .reader-header { padding: 28px 24px 22px; }
  .reader-body { padding: 26px 24px 32px; font-size: 16px; }
  .paywall { padding: 24px 24px 32px; }
  .modal-card { padding: 28px 22px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
}

@media (max-width: 420px) {
  .nav a:not(.active) { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .card .cover { padding: 16px; }
  .card .cover-text h3 { font-size: 17px; }
  .card .body { padding: 14px 16px 16px; }
  .card .price { font-size: 17px; }
}
