/* SCB Link-Seiten – App-Oberfläche (Landing, Editor, Admin) im SCB-Look */

* { box-sizing: border-box; }

:root {
  --bg: #0f0f0f;
  --card: #1a1a1a;
  --card-2: #202020;
  --gold: #c5a880;
  --gold-glow: #d4af37;
  --text: #ffffff;
  --text-soft: #a3a3a3;
  --hairline: rgba(197, 168, 128, 0.25);
  --danger: #d97d7d;
  --ok: #9ec9a0;
  --radius: 16px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-glow); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.brand {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand small { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: 0.28em; color: var(--text-soft); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--text-soft);
  white-space: nowrap;
}
.badge.approved { color: var(--ok); border-color: rgba(158, 201, 160, 0.4); }
.badge.pending { color: var(--gold); border-color: var(--hairline); }
.badge.rejected, .badge.blocked { color: var(--danger); border-color: rgba(217, 125, 125, 0.4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: none;
  padding: 13px 22px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
}
.btn-gold {
  background: linear-gradient(135deg, #c5a880, #b3966c);
  color: #141414;
  box-shadow: 0 6px 20px rgba(197, 168, 128, 0.25);
}
.btn-gold:hover { box-shadow: 0 8px 26px rgba(212, 175, 55, 0.35); transform: translateY(-1px); color: #141414; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: transparent; border: 1px solid rgba(217, 125, 125, 0.45); color: var(--danger); }
.btn-danger:hover { background: rgba(217, 125, 125, 0.1); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ---------- Cards & Formulare ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px;
}

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 7px; letter-spacing: 0.02em; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="url"], .field textarea {
  width: 100%;
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text);
  padding: 13px 15px;
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.field .hint { font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.field .hint.ok { color: var(--ok); }
.field .hint.bad { color: var(--danger); }
.char-count { float: right; }

.slug-row { display: flex; align-items: center; gap: 0; }
.slug-row .prefix {
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-right: none;
  border-radius: 12px 0 0 12px;
  padding: 13px 4px 13px 15px;
  color: var(--text-soft);
  font-size: 14px;
  white-space: nowrap;
}
.slug-row input { border-radius: 0 12px 12px 0 !important; }

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 64px 0 40px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 52px);
  margin: 0 0 14px;
  line-height: 1.15;
}
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { color: var(--text-soft); max-width: 56ch; margin: 0 auto; font-size: 16px; }

.auth-card { max-width: 460px; margin: 34px auto 80px; }
.tabs { display: flex; gap: 6px; margin-bottom: 24px; background: var(--card-2); padding: 5px; border-radius: 12px; }
.tabs button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-soft);
  padding: 11px;
  border-radius: 9px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tabs button.active { background: var(--card); color: var(--gold); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }

.form-error {
  display: none;
  background: rgba(217, 125, 125, 0.12);
  border: 1px solid rgba(217, 125, 125, 0.4);
  color: var(--danger);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 14px;
  margin-bottom: 16px;
}
.form-error.show { display: block; }

/* ---------- Editor-Layout ---------- */
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
  align-items: start;
  padding: 28px 0 90px;
}

.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--hairline);
  background: none;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.step-pill .num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.step-pill.active { border-color: var(--gold); color: var(--gold); }
.step-pill.active .num { background: var(--gold); color: #141414; font-weight: 700; }
.step-pill.done .num { background: rgba(158, 201, 160, 0.2); color: var(--ok); }

.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-panel h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 4px; }
.step-panel .step-sub { color: var(--text-soft); font-size: 14px; margin: 0 0 22px; }

.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }

.save-state { font-size: 12px; color: var(--text-soft); min-height: 16px; transition: opacity 0.3s; }
.save-state.ok { color: var(--ok); }
.save-state.bad { color: var(--danger); font-weight: 600; }
.field input.input-error, .field textarea.input-error { border-color: var(--danger) !important; }

/* Uploads */
.upload-row { display: flex; align-items: center; gap: 16px; }
.upload-preview {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: var(--card-2);
}
.upload-preview.bg-style { border-radius: 12px; width: 110px; height: 76px; }
.upload-preview.empty { display: flex; align-items: center; justify-content: center; color: var(--text-soft); font-size: 22px; border-style: dashed; border-color: var(--hairline); }
input[type="file"] { display: none; }

/* SCB-Buttons im Editor */
.scb-link-block {
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.scb-link-block .blk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-weight: 600; font-size: 15px; }
.scb-link-block .blk-sub { color: var(--text-soft); font-size: 13px; margin-bottom: 12px; }
.scb-link-block input { margin-bottom: 0 !important; }

.custom-link-row {
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.custom-link-row .row-head { display: flex; gap: 10px; align-items: center; }
.custom-link-row .row-head input { flex: 1; }
.custom-link-row input { width: 100%; background: var(--card); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: var(--text); padding: 11px 14px; font-size: 14px; font-family: var(--sans); outline: none; }
.custom-link-row input:focus { border-color: var(--gold); }
.remove-link { background: none; border: 1px solid var(--hairline); color: var(--text-soft); border-radius: 10px; width: 40px; height: 40px; flex-shrink: 0; cursor: pointer; font-size: 16px; }
.remove-link:hover { color: var(--danger); border-color: var(--danger); }

/* Live-Event-Schalter */
.toggle-row { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; cursor: pointer; user-select: none; }
.toggle-row input[type="checkbox"] { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--card); border: 1px solid var(--hairline); position: relative; cursor: pointer; transition: background 0.2s ease; margin: 0; flex-shrink: 0; }
.toggle-row input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-soft); transition: all 0.2s ease; }
.toggle-row input[type="checkbox"]:checked { background: linear-gradient(135deg, #c5a880, #b3966c); border-color: transparent; }
.toggle-row input[type="checkbox"]:checked::after { left: 23px; background: #141414; }
.toggle-row .t-label { font-size: 14px; }
.toggle-row .t-label small { display: block; color: var(--text-soft); font-size: 12px; }
.field input[type="datetime-local"] { width: 100%; background: var(--card); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: var(--text); padding: 11px 14px; font-size: 14px; font-family: var(--sans); outline: none; color-scheme: dark; }
.field input[type="datetime-local"]:focus { border-color: var(--gold); }

/* Design-Auswahl */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.theme-card {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--card-2);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.selected { border-color: var(--gold); }
.theme-card .swatch { height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.theme-card .swatch .dot { width: 22px; height: 22px; border-radius: 50%; }
.theme-card .swatch .bar { width: 60%; height: 9px; border-radius: 5px; }
.theme-card .t-name { font-size: 12.5px; color: var(--text-soft); padding: 9px 0 11px; text-align: center; }
.theme-card.selected .t-name { color: var(--gold); }

.palette-row { display: flex; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }

/* Hintergrund-Muster-Kacheln */
.bg-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bg-tile {
  position: relative;
  height: 64px;
  border-radius: 12px;
  background: #101014;
  border: 2px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.bg-tile:hover { transform: translateY(-2px); }
.bg-tile.selected { border-color: var(--gold); }
.bg-tile .lp-pattern { position: absolute; inset: 0; pointer-events: none; }
.bg-tile .bt-label {
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-soft);
  font-family: var(--sans);
  z-index: 1;
}
.bg-tile.selected .bt-label { color: var(--gold); }
.bg-tile .bt-icon {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 20px;
  z-index: 1;
}
@media (max-width: 560px) { .bg-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.palette-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--card-2);
  transition: transform 0.14s ease;
  padding: 0;
}
.palette-dot:hover { transform: scale(1.1); }
.palette-dot.selected { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); }

/* ---------- Vorschau ---------- */
.preview-col { position: sticky; top: 22px; }
.phone {
  width: 320px;
  height: 620px;
  margin: 0 auto;
  border-radius: 38px;
  border: 1px solid var(--hairline);
  background: #000;
  padding: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(197, 168, 128, 0.07);
}
.phone-screen { width: 100%; height: 100%; border-radius: 29px; overflow: hidden; overflow-y: auto; scrollbar-width: none; background: #0f0f0f; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-screen .lp { min-height: 100%; }
.preview-caption { text-align: center; color: var(--text-soft); font-size: 12px; margin-top: 14px; letter-spacing: 0.06em; }

/* Mobile Vorschau-Overlay */
.preview-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 18px;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.preview-overlay.open { display: flex; }
.preview-overlay .phone { width: min(320px, 88vw); height: min(620px, 74vh); }

@media (max-width: 940px) {
  .editor-grid { grid-template-columns: 1fr; }
  .preview-col { display: none; }
  .preview-fab { display: inline-flex; }
}

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; padding: 26px 0 80px; }
.admin-card { display: flex; flex-direction: column; gap: 14px; }
.admin-card .mini-preview {
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: none;
}
.admin-card .mini-preview .lp { min-height: 100%; zoom: 0.82; }
.admin-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-card .meta .who { font-weight: 600; }
.admin-card .meta .slug { color: var(--text-soft); font-size: 13px; }
.admin-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Teilnehmer-Tabelle */
.table-wrap { overflow-x: auto; padding-bottom: 80px; }
.p-table { width: 100%; border-collapse: collapse; margin-top: 20px; min-width: 640px; }
.p-table th, .p-table td { text-align: left; padding: 13px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); font-size: 14px; vertical-align: middle; }
.p-table th { color: var(--text-soft); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.p-table td.actions-cell { white-space: nowrap; }
.p-table td.actions-cell .btn { margin-right: 6px; }
.p-table .p-name { font-weight: 600; }
.p-table .p-mail { color: var(--text-soft); }

/* ---------- Modal ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.8);
  z-index: 90;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal { max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto; }
.modal h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 12px; }
.modal p { color: var(--text-soft); font-size: 14px; white-space: pre-line; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(80px);
  background: var(--card);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.divider { border: none; border-top: 1px solid var(--hairline); margin: 26px 0; }
.muted { color: var(--text-soft); font-size: 13px; }
.center { text-align: center; }
