/* Design angelehnt an gingismile.com. Die Werte in :root sind Rückfallwerte,
   die eigentlichen Farben kommen aus config.php ('design') und überschreiben sie. */

@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-sans-regular.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/instrument-sans-500.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/instrument-sans-600.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/instrument-sans-700.woff2) format('woff2'); }

:root {
  --schrift: 'Instrument Sans', system-ui, sans-serif;
  --primaer: #d63a3a;
  --link: #c43333;
  --flaeche: #f85151;
  --text: #1e1a2d;
  --leise: #5f5a6e;
  --hintergrund: #f3efef;
  --karte: #ffffff;
  --akzent: #fdf1f0;
  --rand: #e2d8d8;
  --radius: 4px;
  --fehler: #b42318;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--hintergrund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }

/* Kopfband mit Bogenkante wie der Header der Website: der helle Grund wölbt sich in die Koralle */
.farbband {
  position: relative;
  background: var(--flaeche);
  padding: 22px 16px 62px;
  text-align: center;
}
.farbband::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 40px;
  background: radial-gradient(ellipse 50% 100% at 50% 100%, var(--hintergrund) 97%, transparent 100%) center bottom / 132px 40px repeat-x;
}
.logo { height: 36px; width: auto; display: inline-block; vertical-align: middle; }
.marke-text { color: #fff; font-weight: 700; font-size: 1.4rem; letter-spacing: .02em; }

.karte {
  max-width: 720px;
  margin: 16px auto 24px;
  padding: 36px;
  background: var(--karte);
  border-radius: calc(var(--radius) * 2);
  box-shadow: 0 1px 2px rgba(17, 17, 26, .05), 0 8px 24px rgba(17, 17, 26, .06);
}
.karte.breit { max-width: 1100px; }

h1, h2 { font-weight: 600; letter-spacing: -0.4px; line-height: 1.3; }
h1 { font-size: 1.85rem; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 0 0 8px; }
.einleitung, .klein { color: var(--leise); }
.einleitung { margin: 0; }
.klein { font-size: .875rem; }

form { display: grid; gap: 18px; margin-top: 28px; }
.reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
input, textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  padding: 11px 12px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  width: 100%;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #8c8799; }
input:focus, textarea:focus, .ablage:focus, button:focus-visible, .wahl label:focus-within {
  outline: 3px solid color-mix(in srgb, var(--flaeche) 30%, transparent);
  outline-offset: 1px;
  border-color: var(--primaer);
}

/* Auswahl Patient/in oder Praxis als zwei Kacheln */
.wahl { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wahl legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: 8px; }
.wahl label {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.wahl input { width: auto; margin: 0; accent-color: var(--primaer); }
.wahl label:has(input:checked) { border-color: var(--primaer); background: var(--akzent); }

.ablage {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  padding: 30px 16px;
  border: 2px dashed color-mix(in srgb, var(--flaeche) 45%, var(--rand));
  border-radius: calc(var(--radius) * 2);
  background: var(--akzent);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ablage:hover, .ablage.aktiv { border-color: var(--flaeche); background: color-mix(in srgb, var(--flaeche) 10%, #fff); }
.ablage-symbol { color: var(--primaer); margin-bottom: 4px; }
.ablage u { color: var(--link); text-underline-offset: 2px; }
.ablage small { color: var(--leise); margin-top: 4px; }

.dateiliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dateiliste:empty { display: none; }
.dateiliste li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border: 1px solid var(--rand); border-radius: var(--radius); background: #fff;
}
.dateiliste li span:first-child { flex: 1; overflow-wrap: anywhere; }
.entfernen {
  border: 0; background: none; font-size: 1.3rem; line-height: 1;
  color: var(--leise); cursor: pointer; padding: 4px 8px;
}
.entfernen:hover { color: var(--primaer); background: none; }

.einwilligung { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .88rem; color: var(--leise); }
.einwilligung input { width: auto; margin-top: 4px; accent-color: var(--primaer); }

button, .knopf {
  font: inherit; font-weight: 600; font-size: 1.05rem;
  padding: 13px 28px;
  border: 0; border-radius: var(--radius);
  background: var(--primaer); color: #fff;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: background .15s;
}
button:hover, .knopf:hover { background: color-mix(in srgb, var(--primaer) 88%, #000); }
button:disabled { opacity: .6; cursor: wait; }
#senden { justify-self: start; }
.knopf.leise, .knopf.gefahr { background: #fff; font-size: .88rem; border: 1px solid var(--rand); padding: 6px 12px; }
.knopf.leise { color: var(--text); }
.knopf.gefahr { color: var(--fehler); }
.knopf.leise:hover, .knopf.gefahr:hover { background: var(--hintergrund); }

.meldung { color: var(--fehler); margin: 0; font-weight: 500; }

.fortschritt, .fertig { margin-top: 28px; }
.balken { height: 12px; background: var(--hintergrund); border-radius: 99px; overflow: hidden; margin: 18px 0 8px; }
#balken-wert { height: 100%; width: 0; background: var(--flaeche); border-radius: 99px; transition: width .3s; }
.haken { color: #59b55c; margin-bottom: 8px; }

.fuss { max-width: 720px; margin: 0 auto 32px; padding: 0 16px; display: flex; gap: 20px; justify-content: center; font-size: .85rem; }
.fuss a { color: var(--leise); }

/* Verwaltung */
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle th { color: var(--leise); font-weight: 600; }
.tabelle ul { margin: 0; padding-left: 18px; }
.tabelle td p { margin: 6px 0 0; }
.marke { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #fff1e0; color: #8a4b00; white-space: nowrap; }
.marke.ok { background: #e7f6ec; color: #1d6b3a; }
.marke.praxis { background: #ece9f6; color: #3d3566; }
.marke.patient { background: var(--akzent); color: #9b2727; }
.leiste { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.leiste h1 { margin: 0; }
.inline { display: inline; margin: 0; }

/* Anmeldung und Kontoeinrichtung */
.karte.schmal { max-width: 480px; }
.anmeldung { margin-top: 20px; }
.code-feld { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.schritte { list-style: none; padding: 0; margin: 20px 0; display: flex; gap: 8px; counter-reset: s; font-size: .85rem; }
.schritte li { flex: 1; padding: 8px 10px; border-radius: var(--radius); background: var(--hintergrund); color: var(--leise); counter-increment: s; }
.schritte li::before { content: counter(s) ". "; font-weight: 600; }
.schritte li.aktiv { background: var(--akzent); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--flaeche); }
.schritte li.erledigt::before { content: "✓ "; color: #2f7d32; }
.qr { width: 220px; height: 220px; margin: 16px auto; padding: 8px; background: #fff; border: 1px solid var(--rand); border-radius: var(--radius); }
.qr svg { width: 100%; height: 100%; display: block; }
.schluessel { display: inline-block; margin-top: 6px; padding: 6px 10px; background: var(--hintergrund); border-radius: var(--radius); font-size: 1rem; letter-spacing: .05em; user-select: all; }
details summary { cursor: pointer; color: var(--link); }
.downloads li { margin-bottom: 6px; }

/* Eingebettet per iframe: ohne Karte und Hintergrund, die Website liefert den Rahmen */
body.eingebettet { background: transparent; }
body.eingebettet .karte { max-width: none; margin: 0; padding: 4px; border-radius: 0; box-shadow: none; background: transparent; }

@media (max-width: 640px) {
  .karte { margin: 0 0 16px; border-radius: 0; padding: 28px 16px; }
  h1 { font-size: 1.5rem; }
  .reihe, .wahl { grid-template-columns: 1fr; }
  #senden { justify-self: stretch; }
  body.eingebettet .karte { margin: 0; padding: 4px; }
  .tabelle thead { display: none; }
  .tabelle tr { display: block; border-bottom: 1px solid var(--rand); padding: 8px 0; }
  .tabelle td { display: block; border: 0; padding: 4px 0; }
}
