/* ============================================================
   Stadt Land Frau – Mitgliederdatenbank
   Design System: brand tokens aus design SLF.css
   ============================================================ */

:root {
  /* Brand */
  --brand-orange:    #dd5513;
  --brand-pink:      #fee5e8;
  --brand-off-white: #fff8f5;
  --brand-blue:      #9fa5d3;
  --brand-dark-red:  #6f2a21;

  /* Semantische Farben (aus Design System) */
  --bg:              var(--brand-off-white);
  --surface:         #ffffff;
  --surface-alt:     #f3f3f5;
  --ink:             #030213;
  --ink-soft:        #717182;
  --ink-faint:       #a0a0b0;
  --line:            rgba(0,0,0,0.1);
  --line-strong:     rgba(0,0,0,0.18);
  --accent:          var(--brand-orange);
  --accent-soft:     #fde8df;
  --accent-dark:     var(--brand-dark-red);
  --good:            #2d6a2b;
  --warn:            #7a4e10;
  --bad:             #d4183d;

  /* Radius */
  --radius:          0.625rem;
  --radius-lg:       1rem;

  /* Schatten */
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:       0 4px 20px rgba(0,0,0,0.08);

  /* Fonts */
  --font-serif:      'Lora', serif;
  --font-sans:       'Inter', sans-serif;

  /* Typoskala (Ratio 1.2) */
  --text-sm:         0.833rem;
  --text-base:       1rem;
  --text-md:         1.2rem;
  --text-lg:         1.44rem;
  --text-xl:         1.728rem;
  --text-2xl:        2.074rem;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
h4 { font-size: var(--text-base); font-weight: 600; }

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

.wrap {
  width: min(100% - 2.5rem, 1100px);
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.brand__name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-dark-red);
  letter-spacing: 0;
}

.main-nav {
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.88rem;
  font-weight: 400;
}

.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .15s;
}

.main-nav a:hover { color: var(--ink); }
.nav-logout { color: var(--ink-faint) !important; }

/* ---------- Layout ---------- */

.main { padding: 2.5rem 0 5rem; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.page-head h1 { margin: 0; }
.page-head p { color: var(--ink-soft); margin: 0.2rem 0 0; font-size: 0.88rem; }

.subtitle { color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4rem;
  font-size: var(--text-md);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn:active { opacity: 0.8; }

.btn--primary {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #fff;
}
.btn--primary:hover {
  background: var(--brand-dark-red);
  border-color: var(--brand-dark-red);
  color: #fff;
}

.btn--danger {
  background: transparent;
  border-color: var(--bad);
  color: var(--bad);
}
.btn--danger:hover { background: var(--bad); color: #fff; }

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}
.btn--ghost:hover { background: var(--surface-alt); color: var(--ink); }

.btn--sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn--lg { padding: 0.8rem 2rem; font-size: 0.95rem; border-radius: var(--radius-lg); }

/* ---------- Forms ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.form-row { display: flex; flex-direction: column; }
.form-row--full { grid-column: 1 / -1; }

label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

label .req { color: var(--brand-orange); margin-left: 2px; }

input[type=text], input[type=email], input[type=url],
input[type=tel], input[type=password], textarea, select {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
  background: #f3f3f5;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(221,85,19,0.12);
}

textarea { resize: vertical; min-height: 90px; }
input[type=file] { font-size: 0.88rem; padding: 0.4rem 0; background: transparent; }

.hint {
  font-family: var(--font-sans);
  font-size: 0.77rem;
  color: var(--ink-faint);
  margin-top: 0.35rem;
}

.char-count {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-align: right;
  margin-top: 0.2rem;
}

/* Checkboxen */

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: #eceef5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.checkbox-row input[type=checkbox] {
  margin-top: 0.15rem;
  width: 16px; height: 16px;
  accent-color: var(--brand-orange);
  flex-shrink: 0;
}

.checkbox-row span { flex: 1; }

.checkbox-row strong {
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
}

.checkbox-row.required {
  background: #fde8df;
  border-color: rgba(221,85,19,0.25);
}

.checkbox-row.required strong { color: var(--brand-dark-red); }

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-inline input[type=checkbox] {
  width: 15px; height: 15px;
  accent-color: var(--brand-orange);
  flex-shrink: 0;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.form-actions .spacer { flex: 1; }

/* ---------- Tabelle ---------- */

.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.toolbar .search { flex: 1; max-width: 380px; }

table.members {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
}

table.members th, table.members td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

table.members th {
  background: #f3f3f5;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}

table.members tr:last-child td { border-bottom: none; }
table.members tbody tr:hover { background: #fff8f5; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.avatar--lg { width: 110px; height: 110px; }

.name-cell { display: flex; align-items: center; gap: 0.75rem; }
.name-cell strong { display: block; font-weight: 500; }
.name-cell span { font-size: 0.82rem; color: var(--ink-faint); }

.status {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 20px;
}
.status--active   { background: #e2f0e0; color: var(--good); }
.status--inactive { background: #f3e8d6; color: var(--warn); }
.status--deleted  { background: #fde0e6; color: var(--bad); }

.row-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-faint);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

/* ---------- Detail / View ---------- */

.profile-head {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.profile-head h1 { margin-top: 0.2rem; }
.profile-head .business {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
}

.kv-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.6rem 1.5rem;
  font-size: 0.92rem;
}
.kv-list dt {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  padding-top: 0.1rem;
}
.kv-list dd { margin: 0; color: var(--ink); word-break: break-word; }

.qa { margin-bottom: 1.4rem; }
.qa .q {
  font-family: var(--font-serif);
  font-size: 0.97rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.qa .a { color: var(--ink); white-space: pre-wrap; font-size: 0.93rem; }

.gallery { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.8rem; }
.gallery img {
  width: 150px; height: 150px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* ---------- Bilder-Upload ---------- */

.thumb-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.thumb-item { position: relative; width: 120px; }

.thumb-img,
.thumb-item img {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}

.thumb-delete,
.thumb-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--bad);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
}

.thumb-delete-btn input[type=checkbox],
.thumb-delete input[type=checkbox] {
  width: 13px; height: 13px;
  accent-color: var(--bad);
}

.thumb-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px; height: 120px;
  border: 1.5px dashed rgba(0,0,0,0.2);
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, color .15s;
}

.thumb-upload-btn:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.thumb-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.thumb-new-preview { min-height: 0; }

/* ---------- Einwilligungs-Ansicht ---------- */

.consents { display: flex; flex-direction: column; gap: 0.5rem; }

.consents .c-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: #f3f3f5;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.badge-ok {
  color: var(--good);
  font-weight: 500;
  font-family: var(--font-sans);
  font-size: 0.83rem;
}
.badge-no {
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 0.83rem;
}

/* ---------- Flash ---------- */

.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  font-size: 0.92rem;
  border-left: 3px solid;
}
.flash--success { background: #e6f2e4; border-color: var(--good); color: #1a3d18; }
.flash--error   { background: #fde8ec; border-color: var(--bad); color: #6d0d20; }
.flash--info    { background: var(--accent-soft); border-color: var(--brand-orange); color: var(--ink); }

/* ---------- Login ---------- */

.auth-wrap { min-height: 80vh; display: grid; place-items: center; }

.auth-card {
  width: min(100%, 400px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.2rem; }
.auth-card .subtitle { margin-bottom: 1.8rem; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  margin-top: 3rem;
}

/* ---------- Responsiv ---------- */

@media (max-width: 620px) {
  .main-nav { gap: 0.9rem; font-size: 0.85rem; width: 100%; }
  table.members th:nth-child(3),
  table.members td:nth-child(3) { display: none; }
  .kv-list { grid-template-columns: 1fr; gap: 0.3rem 0; }
  .kv-list dt { margin-top: 0.6rem; }
  .auth-card { padding: 1.5rem; }
}

/* ============================================================
   ÖFFENTLICHE SEITEN
   ============================================================ */

.public-page { background: var(--bg); }

.public-header {
  background: var(--bg);
  padding: 2rem 0 1.5rem;
  text-align: center;
}

.public-logo {
  height: 120px;
  width: auto;
  display: inline-block;
  object-fit: contain;
}

.public-hero {
  padding: 2.5rem 0 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.public-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 500;
  color: var(--brand-dark-red);
  margin: 0 0 2rem;
  letter-spacing: -0.01em;
  text-align: center;
}

.public-hero p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 0.85rem;
}

.public-hero ul {
  margin: 0.2rem 0 0.85rem 1.2rem;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

.public-hero .hero-new {
  display: block;
  margin: 1.5rem 0 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--brand-orange);
  border-radius: var(--radius);
  color: var(--brand-dark-red);
  font-size: 0.93rem;
}

.public-hero .hero-tagline {
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 500;
  text-align: center;
  margin: 0 0 1.8rem;
  line-height: 1.5;
}

.hero-box {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.hero-box strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hero-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.hero-box--new {
  background: var(--accent-soft);
  border-left: 3px solid var(--brand-orange);
}

.hero-box--new strong {
  color: var(--brand-dark-red);
}

.hero-box--existing {
  background: var(--brand-pink);
  border-left: 3px solid var(--brand-blue);
}

.hero-box--existing strong {
  color: var(--ink);
}

.public-hero .hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.public-hero em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink);
}

.public-form { max-width: 680px; margin: 0 auto; }
.public-form .card { margin-bottom: 1.5rem; }

.public-form h2 {
  font-size: var(--text-md);
  font-weight: 600;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
}

.public-submit {
  text-align: center;
  padding: 1.5rem 0 3rem;
}

/* Thank-you */

.thankyou-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #e4f0e2;
  color: var(--good);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

@media (max-width: 620px) {
  .public-hero { padding: 1.5rem 0; }
  .public-form { max-width: 100%; }
  .public-form .card { padding: 1.2rem; }
}
