:root {
  --bg: #1e1f22;
  --bg-card: #2b2d31;
  --bg-input: #1e1f22;
  --border: #3f4147;
  --text: #f2f3f5;
  --text-muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #23a55a;
  --danger: #f23f42;
  --ra-accent: #2dd4bf;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px;
}

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

header.topbar a { color: var(--text); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
header.topbar .user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); }
header.topbar img.avatar { width: 28px; height: 28px; border-radius: 50%; }

.lang-switcher { display: flex; gap: 4px; font-size: 12px; }
.lang-switcher a {
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
}
.lang-switcher a:hover { background: var(--bg-input); color: var(--text); }
.lang-switcher a.active { background: var(--accent); color: #fff; }
.lang-switcher-top { position: absolute; top: 16px; right: 20px; }

h1 { font-size: 24px; margin-bottom: 4px; }
h2 { font-size: 18px; margin: 0 0 4px; }
p.muted { color: var(--text-muted); font-size: 14px; }

.center-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 380px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
}
.btn:hover { background: var(--accent-hover); }

.guild-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.guild-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.guild-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: #3f4147;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.ra { background: #5865f2; color: #fff; }

.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.section .badge { margin-left: 8px; }

.plain-fieldset { border: none; padding: 0; margin: 0; }

.group-heading {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 28px 0 12px;
}
.group-heading:first-of-type { margin-top: 20px; }

/* RA-Only Block optisch abgesetzt (türkis), wie gewünscht */
.ra-block {
  border: 2px solid var(--ra-accent);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  background: rgba(45, 212, 191, 0.06);
}
.ra-block .ra-heading { color: var(--ra-accent); margin-top: 0; }
.ra-block .section {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.04);
}

.readonly-value {
  background: var(--bg-input);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin: 0;
}
.field-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.field { margin-bottom: 14px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.mini-heading { font-size: 15px; margin: 0 0 4px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.field input[type="text"], .field select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.field input[type="checkbox"] { width: 18px; height: 18px; vertical-align: middle; margin-right: 8px; }
.field.checkbox-field { display: flex; align-items: center; }
.field.checkbox-field label { margin-bottom: 0; }

.save-row { display: flex; align-items: center; gap: 12px; }
.saved-notice { color: var(--success); font-size: 13px; }

.alert {
  background: rgba(35, 165, 90, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}
.alert.alert-warning {
  background: rgba(242, 63, 66, 0.12);
  border-color: var(--danger);
  color: var(--danger);
}

.error-card {
  background: var(--bg-card);
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 30px;
  max-width: 480px;
  text-align: center;
}
.error-card h1 { color: var(--danger); }

a.back-link { color: var(--text-muted); font-size: 13px; text-decoration: none; }
a.back-link:hover { color: var(--text); }
