/* -------------------------------------------------------------------------
   Farb-Tokens: Standard = dunkles Anthrazit-Theme.
   [data-theme="light"] überschreibt die Werte fürs helle Theme.
   Umgeschaltet wird per Button in der Kopfzeile (siehe base.html).
---------------------------------------------------------------------------*/

:root {
  --bg: #101114;
  --surface: #17181d;
  --surface-2: #1e2027;
  --surface-hover: #24262e;
  --border: #2a2c34;
  --text: #edecf1;
  --muted: #9a9aa6;
  --accent: #8b5cf6;
  --accent-strong: #7c3aed;
  --accent-contrast: #ffffff;
  --danger: #f87171;
  --success: #4ade80;
  --warn: #facc15;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #f2f1f6;
  --surface-hover: #ebe9f2;
  --border: #e1dfe8;
  --text: #18181f;
  --muted: #68667a;
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-contrast: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #b45309;
  --shadow: 0 2px 10px rgba(30, 20, 60, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(23, 24, 29, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.85); }

.topbar .brand { font-weight: 700; color: var(--text); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.link-muted { color: var(--muted); font-size: 0.9rem; }

/* Logo dezent im Header. Die Datei ist reines Weiß auf transparent - passt
   so direkt zum dunklen Standard-Theme; im hellen Theme wird sie per Filter
   eingefärbt, damit sie dort ebenfalls sichtbar bleibt.
   Auf Seiten mit Kopfleiste (eingeloggt) ersetzt sie das Kopfhörer-Emoji
   links im Logo-Schriftzug; auf der Login-Seite (keine Kopfleiste) ist sie
   fest in der oberen rechten Ecke platziert. */
.brand-icon {
  height: 22px;
  width: auto;
  opacity: 0.95;
  pointer-events: none;
}
:root[data-theme="light"] .brand-icon { filter: brightness(0); opacity: 0.8; }

.brand-logo-fixed {
  position: fixed;
  top: 14px;
  right: 16px;
  height: 26px;
  width: auto;
  opacity: 0.9;
  z-index: 50;
  pointer-events: none;
}
:root[data-theme="light"] .brand-logo-fixed { filter: brightness(0); opacity: 0.75; }
@media (max-width: 480px) {
  .brand-icon { height: 18px; }
  .brand-logo-fixed { height: 18px; top: 8px; right: 10px; }
}

.app-footer {
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--muted);
  font-size: 0.78rem;
}

h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 0.95rem; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.page-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 16px;
}

/* Theme-Umschalter */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.theme-toggle:hover { background: var(--surface-hover); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; background: var(--surface-hover); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: var(--accent-strong);
  color: var(--accent-contrast);
  font-weight: 600;
}
.btn-accent:hover { filter: brightness(1.06); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-muted { background: var(--surface-2); color: var(--text); }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.link-danger { background: none; border: none; padding: 0; color: var(--danger); text-decoration: underline; cursor: pointer; font-size: 0.85rem; }

/* Flash messages */
.flash-stack { margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.flash-success { background: rgba(74, 222, 128, 0.14); color: var(--success); }
.flash-error { background: rgba(248, 113, 113, 0.14); color: var(--danger); }

/* Login */
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
}
.login-card h1 { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0; background: var(--surface); }
legend { padding: 0 6px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; display: flex; gap: 8px; align-items: baseline; }
.form-card { margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.checkbox-inline { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); margin-top: 0; }
.checkbox-inline input { width: auto; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 4px 0 2px; }

/* Veranstaltungsfragebogen (öffentliche, freundliche Ansicht fürs Brautpaar) */
.fragebogen-hero {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(139, 92, 246, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 20px;
  margin: 18px 0 20px;
  text-align: center;
}
.fragebogen-hero-eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.fragebogen-hero h1 { font-size: 1.7rem; margin: 0 0 6px; }
.fragebogen-hero-date { margin: 0; color: var(--muted); font-size: 1.05rem; }

.deadline-note {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 16px;
}
.deadline-note p { margin: 0; font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.deadline-note strong { color: var(--accent); }

#fragebogen-form { gap: 18px; }
#fragebogen-form fieldset { border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
#fragebogen-form legend {
  font-size: 1.02rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  padding: 0 8px;
}

@media (max-width: 480px) {
  .fragebogen-hero { padding: 20px 16px; margin: 12px 0 16px; }
  .fragebogen-hero h1 { font-size: 1.4rem; }
  .fragebogen-hero-date { font-size: 0.95rem; }
  #fragebogen-form fieldset { padding: 16px; }
}

/* Adress-Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 4px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
}
.autocomplete-list li {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
}
.autocomplete-list li:hover { background: var(--surface-hover); }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 0 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-value { font-size: 1.5rem; font-weight: 700; background: linear-gradient(135deg, var(--text), var(--muted)); -webkit-background-clip: text; background-clip: text; }
.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  align-items: center;
}
.filter-bar input[type="search"] { flex: 1 1 200px; }
.filter-bar select { flex: 0 1 160px; }

/* Card list */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.inquiry-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.inquiry-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.inquiry-card-title { font-weight: 600; }
.inquiry-card-meta { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.inquiry-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.badge-anfrage { background: rgba(139, 92, 246, 0.18); color: var(--accent); }
.badge-angebot-verschickt { background: rgba(56, 130, 246, 0.18); color: #60a5fa; }
.badge-gebucht { background: rgba(74, 222, 128, 0.18); color: var(--success); }
.badge-erledigt { background: rgba(154, 154, 166, 0.18); color: var(--muted); }
.badge-abgesagt { background: rgba(248, 113, 113, 0.18); color: var(--danger); }

.tag { display: inline-block; font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; margin-left: 6px; white-space: nowrap; line-height: 1.3; }
.tag-soon { background: rgba(250, 204, 21, 0.18); color: var(--warn); }
.tag-past { background: rgba(154, 154, 166, 0.18); color: var(--muted); }
.tag-success { background: rgba(74, 222, 128, 0.18); color: var(--success); }

/* Detail page */
.detail-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.spacer { flex: 1; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
dl { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: 8px 10px; }
dt { color: var(--muted); font-size: 0.85rem; }
dd { margin: 0; }
.pre { white-space: pre-wrap; }

.file-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.upload-form input[type="file"] { flex: 1 1 200px; padding: 6px; }

/* Fragebogen */
.contact-footer { margin-top: 24px; }
.link-row { display: flex; gap: 8px; margin: 10px 0; }
.send-row { flex-wrap: wrap; align-items: center; margin: 10px 0; }
.email-form-wrap { margin: 4px 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.link-row input { flex: 1; font-size: 0.85rem; }
.status-line { margin: 4px 0 12px; font-size: 0.9rem; }
.questionnaire-summary { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.questionnaire-summary h3 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); margin: 16px 0 8px;
}
.questionnaire-summary h3:first-child { margin-top: 0; }

/* Übersicht (Dashboard): Kalender links, Suche/Anfragenliste rechts daneben */
.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 20px;
  align-items: start;
}
.dashboard-col-list { display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 760px) {
  .dashboard-columns { grid-template-columns: 1fr; }
}

/* Monatskalender (Dashboard) */
.calendar-card { margin: 0; padding: 14px 16px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.calendar-title { font-size: 0.88rem; font-weight: 600; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-weekday { text-align: center; font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; padding-bottom: 3px; }
.calendar-cell {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.calendar-cell-outside { opacity: 0.35; }
.calendar-cell-today { border-color: var(--accent); border-width: 2px; }
.calendar-daynum { font-size: 0.62rem; color: var(--muted); }
.calendar-event {
  display: block;
  font-size: 0.58rem;
  padding: 1px 3px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
}
.calendar-event:hover { text-decoration: underline; }
.cal-status-anfrage { background: rgba(139, 92, 246, 0.18); color: var(--accent); }
.cal-status-angebot-verschickt { background: rgba(56, 130, 246, 0.18); color: #60a5fa; }
.cal-status-gebucht { background: rgba(74, 222, 128, 0.18); color: var(--success); }
.cal-status-erledigt { background: rgba(154, 154, 166, 0.18); color: var(--muted); }

@media (max-width: 480px) {
  .calendar-card { padding: 10px 12px; }
  .calendar-cell { min-height: 32px; padding: 2px; }
  .calendar-event { font-size: 0.52rem; }
}

/* Einstellungen: Feldverwaltung */
.field-mgmt-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 10px; }
.field-mgmt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

@media (min-width: 640px) {
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .page-head { flex-direction: row; align-items: baseline; justify-content: space-between; }
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  dl { grid-template-columns: 110px 1fr; }
  .topbar nav { gap: 10px; }
}
