/* ============================================================
   AUTH — Header-Button, Modal, User-Menü
   ============================================================ */
.btn-auth {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.auth-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}

/* Auth Modal */
.auth-modal { width: 360px; }
.auth-tabs {
  display: flex; gap: 4px; background: var(--bg-elevated);
  border-radius: var(--r-md); padding: 3px; margin-bottom: 16px;
}
.auth-tab {
  flex: 1; padding: 6px 10px; border-radius: calc(var(--r-md) - 2px);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  border: none; background: none; cursor: pointer; transition: background .12s, color .12s;
}
.auth-tab.active { background: var(--bg-hover); color: var(--text-primary); }
.auth-tab-panel { display: flex; flex-direction: column; gap: 12px; }
.auth-tab-panel.hidden { display: none; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.auth-hint { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-close { width: 100%; justify-content: center; margin-top: 8px; }
.auth-error {
  font-size: 12px; color: var(--danger);
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25);
  border-radius: var(--r-sm); padding: 7px 10px;
}
.auth-success {
  font-size: 12px; color: var(--success);
  background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.25);
  border-radius: var(--r-sm); padding: 7px 10px;
}
.auth-error.hidden, .auth-success.hidden { display: none; }

/* User-Menü Popup */
.user-menu-popup {
  position: fixed; z-index: 300;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
  padding: 6px; min-width: 220px;
}
.user-menu-email {
  font-size: 12px; color: var(--text-muted);
  padding: 5px 10px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-sep { border-top: 1px solid var(--border-muted); margin: 4px 0; }
.user-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  border: none; background: none; cursor: pointer; transition: background .12s;
}
.user-menu-item:hover { background: var(--bg-hover); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: rgba(248,113,113,.1); }

/* Konto-Einstellungen & Konto löschen */
.accsett-modal { width: min(96vw, 460px); }
.accsett-modal .modal-title { font-size: 17px; }

.accsett-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border-muted);
}
.accsett-label {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  width: 140px; flex-shrink: 0;
}
.accsett-value { font-size: 14px; color: var(--text-primary); }
.accsett-field {
  margin-top: 16px; display: flex; flex-direction: column; gap: 6px;
}
.accsett-field .accsett-label { width: auto; font-size: 13px; }
.accsett-field .input-text { width: 100%; font-size: 14px; padding: 8px 10px; }

.accsett-danger-zone {
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(239,68,68,.25);
}
.accsett-danger-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--danger);
  margin-bottom: 6px;
}
.accsett-danger-desc {
  font-size: 12px; color: var(--text-muted); margin: 0 0 12px;
  line-height: 1.5;
}
.accsett-delete-btn {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--danger); font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: var(--r-md);
  border: 1px solid rgba(239,68,68,.45);
  background: rgba(239,68,68,.06);
  transition: background .14s, border-color .14s;
}
.accsett-delete-btn:hover {
  background: rgba(239,68,68,.18); border-color: var(--danger);
}

.delete-account-warn {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--r-md); padding: 12px 14px;
  font-size: 13px; line-height: 1.5; color: var(--text-primary);
  margin-bottom: 16px;
}

/* Sharing Modal */
.share-public-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-muted); margin-bottom: 4px;
}
.share-link-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 10px;
}
.share-link-text {
  flex: 1; font-size: 11px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.share-invite-row { display: flex; gap: 6px; align-items: center; }
.share-member-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border-muted);
}
.share-member-row:last-child { border-bottom: none; }
.share-member-name { flex: 1; font-size: 13px; color: var(--text-primary); }
.share-member-role {
  font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: var(--r-full);
}
.share-member-role.editor  { background: var(--brand-subtle); color: var(--brand); }
.share-member-role.viewer  { background: var(--bg-elevated); color: var(--text-muted); }

.tm-empty, .tm-error {
  font-size: 13px; color: var(--text-muted);
  padding: 10px 0; text-align: center;
}
.tm-error { color: var(--danger); }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-full); cursor: pointer; transition: background .2s;
}
.toggle-track::before {
  content: ''; position: absolute;
  left: 3px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-muted); transition: transform .2s, background .2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--brand); border-color: var(--brand); }
.toggle-switch input:checked + .toggle-track::before {
  transform: translate(18px, -50%); background: #fff;
}

/* Play-Card Sharing Badges */
.play-card-shared-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: var(--r-full);
  background: var(--brand-subtle); color: var(--brand);
  vertical-align: middle;
}
.play-card-readonly { opacity: .85; }
.play-card-readonly .play-card-thumb { filter: saturate(.7); }

/* Share badge in playbook list */
.share-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: var(--r-full);
  background: rgba(74,222,128,.15); color: var(--success);
  vertical-align: middle; margin-left: 4px;
}

/* Lib section title */
.lib-section-title {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 6px 12px 4px;
}
.lib-pb-shared .lib-pb-name { color: var(--text-secondary); }


/* ============================================================
   AUTH GATE (Landing Page)
   ============================================================ */
#auth-gate {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg-base);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
#auth-gate.hidden { display: none; }
/* Footer immer an den unteren Rand schieben (Inhalt füllt den Rest). */
#auth-gate > .lp-footer { margin-top: auto; }

#tsparticles-bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}

/* ---- Theme toggle in mini-header ---- */
.lp-mini-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-secondary);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.lp-mini-theme:hover { color: var(--text-primary); border-color: var(--brand); }
.lp-mini-theme .lp-theme-sun  { display: none; }
.lp-mini-theme .lp-theme-moon { display: block; }
[data-theme="light"] .lp-mini-theme .lp-theme-sun  { display: block; }
[data-theme="light"] .lp-mini-theme .lp-theme-moon { display: none; }

/* ---- Roomy full-height entry: hero + login ---- */
.gate-stage {
  position: relative; z-index: 1;
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  width: 100%; max-width: 1180px; margin: 0 auto;
  box-sizing: border-box;
  padding: clamp(48px, 8vh, 96px) clamp(20px, 5vw, 64px);
}

/* Hero (left) */
.gate-hero { text-align: left; }
.gate-headline {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.2vw, 68px); font-weight: 900; line-height: 1.04;
  letter-spacing: -.025em;
  color: var(--text-primary);
  margin: 0 0 20px;
}
.gate-headline span {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gate-sub {
  font-size: clamp(16px, 1.4vw, 19px); color: var(--text-secondary);
  line-height: 1.6; margin: 0; max-width: 560px;
}

/* Two product teaser chips */
.gate-products {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 32px; text-align: left;
}
.gate-product {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 18px; border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.gate-product-tag {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--r-full);
  color: #fff;
}
.gate-product--play  { border-color: rgba(249,115,22,0.32); }
.gate-product--play  .gate-product-tag  { background: var(--brand); }
.gate-product--studio { border-color: rgba(14,165,233,0.32); }
.gate-product--studio .gate-product-tag { background: var(--brand-2); }
.gate-product-line {
  font-size: 14px; line-height: 1.5; color: var(--text-secondary);
}

/* Login card (right) */
.gate-card {
  position: relative;
  width: 100%; max-width: 460px; justify-self: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.04) inset;
  overflow: hidden;
}
[data-theme="light"] .gate-card {
  box-shadow: 0 18px 50px rgba(20,20,30,0.12), 0 0 0 1px rgba(0,0,0,0.02);
}
/* Brand accent bar on top of the card */
.gate-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 50%, var(--brand-2) 50%, var(--brand-2) 100%);
}

.gate-card-body { padding: 36px 38px 34px; }
.gate-login-head { margin-bottom: 24px; text-align: center; }
.gate-login-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800; letter-spacing: -.01em;
  color: var(--text-primary); margin-bottom: 8px;
}
.gate-login-sub {
  font-size: 15px; color: var(--text-muted); line-height: 1.5;
  max-width: 380px; margin: 0 auto;
}
.gate-oauth-stack { display: flex; flex-direction: column; gap: 12px; }
.gate-privacy {
  margin: 24px 0 0; padding-top: 20px;
  border-top: 1px solid var(--border-muted);
  text-align: center;
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
}

/* Einstiegs-Kontext-Banner (Kauf/Einladung/kostenlos) */
.gate-context { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }
.gate-context:empty { display: none; }
.gate-context.is-ctx {
  background: var(--brand-subtle, rgba(249,115,22,.12)); color: var(--text-primary);
  border: 1px solid rgba(249,115,22,.32); border-radius: 10px; padding: 11px 14px; font-weight: 600;
}

/* OAuth Buttons */
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 14px 20px;
  border-radius: var(--r-md); border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; font-family: var(--font-ui);
  transition: opacity .15s, transform .12s, box-shadow .15s;
}
.btn-oauth:hover { opacity: 0.84; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.btn-oauth:active { transform: translateY(0); opacity: 1; }
.btn-oauth:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-oauth-google { background: #fff; color: #1f1f1f; border: 1px solid rgba(0,0,0,0.15); }
.btn-oauth-google:hover { background: #f8f8f8; opacity: 1; }
.btn-oauth-github { background: #24292e; color: #fff; }
.btn-oauth-apple  { background: #111; color: #fff; border: 1px solid rgba(255,255,255,0.12); }

/* Export Scope Radio */
.export-scope-row {
  display: flex; gap: 16px; padding: 6px 0;
}
.export-scope-opt {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.export-scope-opt input[type="radio"] { accent-color: var(--brand); }
.export-scope-opt:has(input:checked) { color: var(--text-primary); }

@media (max-width: 960px) {
  .gate-stage {
    grid-template-columns: 1fr;
    gap: 40px; max-width: 620px;
    padding: clamp(40px, 6vh, 72px) 24px;
  }
  .gate-hero { text-align: center; }
  .gate-sub { margin-left: auto; margin-right: auto; }
  .gate-card { justify-self: stretch; }
}
@media (max-width: 560px) {
  .gate-stage { padding: 40px 16px; gap: 32px; }
  .gate-card-body { padding: 26px 22px 28px; }
  .gate-products { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #tsparticles-bg { display: none; }
  .btn-oauth:hover { transform: none; }
}

