/* FragDasLand.de – Design nach Vorlage */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2f7df6;
  --blue-light: #4aa8f5;
  --text: #0f172a;
  --text-muted: #64748b;
  --bg: #f1f3f6;
  --card: #ffffff;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #b45309;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 48px 16px 64px;
  background:
    radial-gradient(ellipse at top left, #dbe8ff 0%, transparent 55%),
    radial-gradient(ellipse at top right, #e4ecff 0%, transparent 55%),
    linear-gradient(180deg, #f6f8fb 0%, #eef1f5 100%);
}

.date-pill {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 28px;
}

.brand {
  font-size: 64px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Unterlängen (g, j, q) würden vom background-clip: text sonst abgeschnitten. */
  line-height: 1.25;
  padding-bottom: 0.08em;
}

.small-brand { font-size: 32px; margin-bottom: 8px; }

.tagline { font-size: 52px; font-weight: 800; line-height: 1.1; margin-bottom: 14px; }
.subtitle { font-size: 20px; color: var(--text-muted); margin-bottom: 40px; }

.stats { display: flex; justify-content: center; gap: 64px; }
.stat { text-align: center; }
.stat-value { display: block; font-size: 26px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* === Layout === */
.container { width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; flex: 1; }
.container.narrow { max-width: 480px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h2 { font-size: 28px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* === Tabs === */
.tabs {
  display: flex;
  background: #e6e9ee;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* === Poll Cards === */
.poll-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Fullscreen-Button oben rechts */
.fullscreen-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.fullscreen-btn:hover { color: var(--blue); border-color: var(--blue); background: #f5f9ff; }
/* Titel nicht unter den Button laufen lassen */
.poll-card .poll-title { padding-right: 44px; }

/* === Fullscreen-Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  padding: 24px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 820px;
  margin: auto;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  z-index: 1;
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); }
/* Karte im Modal randlos einbetten */
.modal-body .poll-card {
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.modal-body .poll-title { padding-right: 44px; font-size: 24px; }

.poll-title { color: var(--blue); font-size: 20px; font-weight: 700; margin-bottom: 20px; line-height: 1.35; }

.option-result { margin-bottom: 16px; }
.option-result.mine .option-row span:first-child { color: var(--blue); font-weight: 700; }
.option-row {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.pct { color: var(--text-muted); }
.bar { height: 6px; background: #e6e9ee; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-light)); border-radius: 3px; }
.votes-label { text-align: right; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.option-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.option-choice:hover { border-color: var(--blue); background: #f5f9ff; }

.hint { margin-top: 12px; font-size: 14px; color: var(--text-muted); }

/* === Kontext === */
.context-details { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 14px; }
.context-details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text); list-style: none; }
.context-details summary::-webkit-details-marker { display: none; }

.context-post {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
}
.context-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.badge {
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
}
.badge-update { background: var(--success); }
.context-post p { font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
.source-link { color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; }
.source-link:hover { text-decoration: underline; }

/* === Perspektiven & Einordnung === */
.insight-heading { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }

.perspectives { margin-top: 18px; }
.perspectives-summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  list-style: none;
}
.perspectives-summary::-webkit-details-marker { display: none; }
.perspectives-summary::before { content: '▸ '; color: var(--text-muted); }
.perspectives[open] .perspectives-summary::before { content: '▾ '; }
.perspectives-intro { margin: 4px 0 4px; }
.perspective-post { border-left: 4px solid var(--border); }
.perspective-leaning {
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  text-transform: lowercase;
}

.assessment {
  margin-top: 18px;
  background: #f4f9f5;
  border: 1px solid #cfe6d5;
  border-left: 3px solid var(--success);
  border-radius: 10px;
  padding: 14px 16px;
}
.assessment p { font-size: 14px; line-height: 1.6; }

/* === Buttons === */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2468d4; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: #fff; border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost:hover { color: var(--blue); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.inline-form { display: inline-block; }

/* === Forms === */
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
input:not([type="radio"]):not([type="checkbox"]):focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
input[type="radio"], input[type="checkbox"] { display: inline-block; width: auto; margin: 0; accent-color: var(--blue); }
input[type="radio"]:focus, input[type="checkbox"]:focus { outline: none; }
/* Tastatur-Fokus sichtbar an der Option statt Rechteck um den Kreis */
.option-choice:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0, 90, 200, 0.15); }
.code-input { letter-spacing: 8px; font-size: 20px; text-align: center; font-family: 'Courier New', monospace; }
.stacked-form { margin-top: 12px; }

/* === Auth/Profil Cards === */
.auth-card, .profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.auth-card { text-align: center; margin-top: 40px; }
.auth-card form { text-align: left; margin-top: 20px; }
.auth-card h2 { margin-bottom: 6px; }
.auth-card .muted { margin-top: 16px; font-size: 14px; }

.profile-card h3 { margin-bottom: 12px; font-size: 17px; }
.profile-card p { margin-bottom: 8px; font-size: 14px; }
.status-ok { color: var(--success); font-weight: 600; }
.status-warn { color: var(--warn); font-weight: 600; }
.danger-zone { border-color: #fecaca; }
.danger-zone h3 { color: var(--danger); }

.back-link { display: inline-block; color: var(--text-muted); text-decoration: none; font-size: 14px; margin-bottom: 16px; }
.back-link:hover { color: var(--blue); }

/* === Flash === */
.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.flash-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.flash-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* === Empty State === */
.empty-state { text-align: center; padding: 64px 16px; }
.empty-state p:first-child { font-size: 17px; margin-bottom: 8px; }
.empty-state .muted, .empty-state p:nth-child(2) { font-size: 14px; color: var(--text-muted); }

/* === Admin === */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.source-add-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.source-add-form input { width: auto; flex: 1; min-width: 160px; margin-top: 0; }
.source-list { list-style: none; }
.source-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.update-details { margin-top: 6px; }
.update-details summary { cursor: pointer; }
.update-details input, .update-details textarea { margin-bottom: 8px; }

/* === Archiv === */
.archive-cta { text-align: center; margin-top: 32px; }

.search-form { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 180px; margin-top: 0; }
.search-form .btn { flex-shrink: 0; }

.result-info { margin-bottom: 16px; }

.poll-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 32px; }
.page-info { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.btn-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 28px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.footer-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--blue); text-decoration: underline; }

/* === Rechtstexte (Impressum / Datenschutz / AGB) === */
.legal-doc { max-width: 820px; }
.legal-doc h2 { margin-bottom: 4px; }
.legal-doc .legal-updated { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.legal-doc section { margin-bottom: 28px; }
.legal-doc h3 { margin: 0 0 10px; font-size: 19px; }
.legal-doc h4 { margin: 18px 0 6px; font-size: 16px; }
.legal-doc p { line-height: 1.65; margin: 0 0 12px; }
.legal-doc ul { line-height: 1.65; margin: 0 0 12px; padding-left: 22px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc address { font-style: normal; line-height: 1.6; }
.legal-doc a { color: var(--blue); }
.legal-toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 28px; }
.legal-toc ul { margin: 8px 0 0; }
.consent-field { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; font-size: 14px; }
.consent-field input { margin-top: 3px; flex-shrink: 0; }

/* === Responsive === */
@media (max-width: 640px) {
  .brand { font-size: 42px; }
  .tagline { font-size: 32px; }
  .subtitle { font-size: 16px; }
  .stats { gap: 32px; }
  .admin-table { display: block; overflow-x: auto; }
}
