:root {
  --bmf-red: #e6320f;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --bg: #eef0f2;
  --card-bg: #ffffff;
  --control-hover: #f7f7f7;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark-Mode-Palette. Wird von js/app.js per data-theme="dark" auf <html>
   gesetzt - je nach data.json-Standard ("theme.default"), gespeicherter
   Auswahl oder Systemeinstellung - und lässt sich hier zentral anpassen. */
:root[data-theme="dark"] {
  --bmf-red: #ff6a4a;
  --ink: #f2f2f2;
  --muted: #a6a6ac;
  --line: #34363c;
  --bg: #101114;
  --card-bg: #1c1d21;
  --control-hover: #2a2c31;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Extra top padding keeps room for the language toggle, which sits above
     the card; env(safe-area-inset-top) adds further clearance on phones
     with a notch/dynamic island, so the toggle never gets cut off. */
  padding: calc(56px + env(safe-area-inset-top, 0px)) 16px 32px;
  transition: background-color 0.2s ease;
}

.page {
  width: 100%;
  max-width: 440px;
  position: relative;
}

.top-toggles {
  position: absolute;
  top: -40px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease, transform 0.1s ease;
}

.lang-toggle:hover {
  background: var(--control-hover);
}

.lang-toggle:active {
  transform: scale(0.97);
}

.theme-toggle {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease, transform 0.1s ease;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  display: block;
}

.theme-toggle:hover {
  background: var(--control-hover);
}

.theme-toggle:active {
  transform: scale(0.93);
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.logo-frame {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  transition: background 0.2s ease, padding 0.2s ease;
}

/* Das BMF-Logo hat schwarzen Text auf transparentem Grund - im Dark Mode
   bekommt es daher eine kleine weiße Fläche als Hintergrund, damit es
   lesbar bleibt und seine offiziellen Farben behält. */
:root[data-theme="dark"] .logo-frame {
  background: #ffffff;
  padding: 8px 14px;
}

.logo {
  height: 34px;
  width: auto;
  display: block;
}

/* The English BMF lockup has three text lines instead of two, so it needs
   a bit more height to keep the wordmark at a comparable, legible size. */
.logo[data-lang="en"] {
  height: 50px;
}

.site-link {
  color: var(--bmf-red);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.site-link:hover {
  text-decoration: underline;
}

.card-body {
  padding: 24px 28px 8px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portrait {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--line);
}

.portrait[hidden] {
  display: none;
}

.identity-text {
  min-width: 0;
}

#full-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.subtitle {
  margin: 2px 0 0;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.45;
}

.subtitle-function {
  margin-bottom: 4px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
}

.contact-list li[hidden] {
  display: none;
}

.contact-list a {
  color: var(--ink);
  text-decoration: none;
}

.contact-list a:hover {
  color: var(--bmf-red);
  text-decoration: underline;
}

.icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bmf-red);
}

.icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.card-actions {
  padding: 22px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.btn-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bmf-red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.qrcode {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  line-height: 0;
  font: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.qrcode:hover {
  border-color: #c9c9c9;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.qrcode:active {
  transform: scale(0.97);
}

.qrcode img,
.qrcode svg,
.qrcode table {
  display: block;
  width: 200px;
  height: 200px;
  pointer-events: none;
}

.qr-caption {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 260px;
}

.qr-tap-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--bmf-red);
  font-weight: 600;
}

@media (max-width: 420px) {
  .card-header {
    padding: 20px 20px 16px;
  }

  .card-body {
    padding: 20px 20px 8px;
  }

  .card-actions {
    padding: 20px 20px 24px;
  }
}
