/* Freigabe-Oberflaeche, Corporate Identity nach ADR 0004.
   Farbwerte gemessen auf ecofit-biofrucht.de, Schriften aus dem
   Bild-Designsystem (ADR 0002), damit Rahmen und Inhalt eine Sprache
   sprechen. Fixe Designregeln des Kunden gelten auch hier: keine
   Schatten, keine Verlaeufe, viel Leerraum. */

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/web/montserrat-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/web/inter-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/web/inter-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* CI-Rollen der Oberflaeche */
  --ink: #1d1d1b;          /* Logo-Schwarz */
  --ink-weich: #5f5d57;    /* Sekundaertext */
  --linie: #e4e1da;        /* Rahmen statt Schatten */
  --linie-stark: #cfcbc1;
  --bg: #f7f6f3;           /* Seitenflaeche */
  --flaeche: #ffffff;      /* Karten */

  --gelb: #fbba00;         /* Primaerakzent, Website-Header */
  --gelb-weich: #fdf1cc;
  --koralle: #ed6b5b;      /* Signalfarbe, Website-Akzent */
  --koralle-weich: #fbe3df;
  --koralle-dunkel: #b23b2e; /* Signal als Text auf hell */
  --gelb-dunkel: #8a6400;    /* Wartet-Status als Text auf hell */
  --gruen: #4f6b43;        /* Bestaetigung */
  --gruen-weich: #e2ebdc;

  /* Flaechenfarben des Bildsystems, hier nur fuer Status und Badges */
  --salbei: #b7c6ab;
  --ocker: #f5ce55;
  --lavendel: #8e8bb3;
  --cream: #fde8d4;

  --radius: 4px;
  --radius-klein: 2px;
  --serif-frei: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --versal: "Montserrat", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--serif-frei);
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 900px; margin: 0 auto; padding: 20px 16px 64px; }

/* Versalien mit Sperrung wie Logo und Website */
h1, h2 {
  font-family: var(--versal);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
h1 { font-size: 1rem; margin: 0; }
h2 { font-size: .82rem; margin: 34px 0 12px; color: var(--ink); }
/* H3 traegt die Versalschrift, bleibt aber gemischt gesetzt: sonst wird
   die Ebene unter H2 unruhig. */
h3 { font-family: var(--versal); font-weight: 600; font-size: .92rem; margin: 22px 0 8px; }

a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Kundenvorschau: die Agentur sieht die Kundenansicht, die Session bleibt
   die eigene. Die Leiste macht den Modus unübersehbar und führt zurück. */
.vorschau-leiste {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: .85rem;
}
.vorschau-leiste strong {
  font-family: var(--versal);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
  margin-right: 8px;
}
.vorschau-leiste form { flex: 0 0 auto; }
.vorschau-leiste button { width: auto; padding: 9px 14px; font-size: .72rem; }

.abstand-oben { margin-top: 10px; }

/* ---------- Kopf ---------- */

.kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 24px;
}
.marke { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.marke img { height: 38px; width: auto; display: block; }
.marke h1 { color: var(--ink-weich); padding-left: 12px; border-left: 1px solid var(--linie-stark); }
nav { display: flex; flex-wrap: wrap; gap: 18px; }
nav a {
  font-family: var(--versal);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--ink-weich);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
nav a:hover, nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gelb); }

/* ---------- Handlungsaufforderung ---------- */

.cta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--gelb);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  margin-bottom: 12px;
}
.cta.ruhig { background: var(--flaeche); border: 1px solid var(--linie); }
.cta strong { font-family: var(--versal); text-transform: uppercase; letter-spacing: .04em; font-size: .95rem; }
.cta span { font-size: .85rem; color: var(--ink-weich); }
.cta:not(.ruhig) span { color: var(--ink); opacity: .75; }

/* ---------- Wochenplan ---------- */

.woche { margin-top: 26px; }
/* align-items: start, sonst ziehen Karten mit Bildvorschau die leeren
   Termine derselben Zeile auf ihre Hoehe. */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; align-items: start; }
.slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-left: 4px solid var(--linie-stark);
  border-radius: var(--radius);
  padding: 12px;
  text-decoration: none;
  min-height: 124px;
}
a.slot:hover { border-color: var(--ink); }
/* Drag-and-drop im Wochenplan (ADR 0012) */
.slot[draggable="true"] { cursor: grab; }
.slot.wird-gezogen { opacity: .5; }
.slot.drop-ziel { border-color: var(--ink); border-style: dashed; background: var(--gelb-weich); }
.drag-hinweis { font-size: .82rem; margin: 6px 0 14px; }
@media (hover: none) { .drag-hinweis { display: none; } }
.slot img, .slot .platzhalter { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-klein); background: var(--bg); }
.slot-tag { font-size: .7rem; color: var(--ink-weich); text-transform: uppercase; letter-spacing: .06em; }
.slot-status { font-family: var(--versal); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.slot-titel { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot-hinweis { font-size: .76rem; color: var(--ink-weich); }

.s-warten { border-left-color: var(--gelb); }
.s-warten .slot-status { color: var(--gelb-dunkel); }
.s-geplant { border-left-color: var(--salbei); }
.s-live { border-left-color: var(--gruen); }
.s-arbeit { border-left-color: var(--lavendel); }
.s-fehler { border-left-color: var(--koralle); }
.s-fehler .slot-status { color: var(--koralle-dunkel); }
.s-abgelehnt { border-left-color: var(--linie-stark); }
.slot.s-leer { background: transparent; border: 1px dashed var(--linie-stark); }
.slot.s-ausgefallen { background: var(--koralle-weich); border-color: var(--koralle); border-left-color: var(--koralle); }
.slot.s-ausgefallen .slot-status { color: var(--koralle-dunkel); }

/* ---------- Detailseite ---------- */

.detail-status {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-left: 4px solid var(--linie-stark);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: .9rem;
}
.detail-status span:first-child { font-family: var(--versal); text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; }
.detail-status span:last-child { color: var(--ink-weich); }

.feed {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 470px;
  margin: 0 auto;
}
.feed-kopf { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: .88rem; border-bottom: 1px solid var(--linie); }
.feed-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gelb) url("/assets/logo/ecofit_logo.png") center / 62% no-repeat;
  flex-shrink: 0;
}
.feed-bilder { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.feed-bilder img, .feed-bilder .platzhalter { width: 100%; flex-shrink: 0; scroll-snap-align: center; aspect-ratio: 1; object-fit: cover; }
.feed-bilder .platzhalter { background: var(--bg); }
.feed-bilder img { scroll-margin-top: 80px; }
.fakt { margin: 0 0 6px; color: var(--ink-weich); font-size: .9rem; }
.fakt + details, .hinweis + details { margin-top: 12px; }
.woche h2 .badge { margin-left: 8px; vertical-align: middle; text-transform: none; letter-spacing: 0; font-weight: 500; }
.box .pruefliste { margin: 10px 0 14px; }
form.box h3 { margin: 0 0 6px; }
form.box details { margin: 0 0 12px; }
form.box details summary { cursor: pointer; font-family: var(--versal); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
/* Carousel-Punkte wie bei Instagram, aber als Anker auf die Kacheln. */
.feed-punkte { display: flex; justify-content: center; gap: 6px; padding: 10px 8px 4px; }
.feed-punkte a { width: 7px; height: 7px; border-radius: 50%; background: var(--linie-stark); display: block; }
.feed-punkte a:hover, .feed-punkte a:focus-visible { background: var(--ink); }
.feed-caption { padding: 12px 14px 16px; font-size: .88rem; line-height: 1.5; }
.feed-tags { color: var(--ink-weich); margin-top: 8px; font-size: .85rem; }

/* ---------- Boxen und Formulare ---------- */

/* Boxen laufen auf die Breite ihres Containers. Nur die Freigabestrecke
   steht in .spalte, damit Aktionen und Feed-Vorschau gleich breit sind. */
.spalte { max-width: 470px; margin: 0 auto; }

.box {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0 0;
}
.box summary { cursor: pointer; font-family: var(--versal); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.box ul { margin: 0; padding-left: 20px; }
.box li { margin: 4px 0; }

.onboarding p { margin: 12px 0 0; color: var(--ink-weich); max-width: 62ch; }

/* Ablauf in vier Schritten. Die kurze gelbe Linie über jedem Schritt ist
   die Akzentlinie aus dem Bild-Designsystem (ADR 0002), keine Icons. */
.schritte {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.schritte li { display: flex; flex-direction: column; gap: 6px; }
.schritte li::before { content: ""; display: block; width: 48px; height: 4px; background: var(--gelb); margin-bottom: 12px; }
.schritt-nr { font-family: var(--versal); font-size: .72rem; letter-spacing: .12em; color: var(--ink-weich); }
.schritte strong { font-family: var(--versal); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.schritte li > span:last-child { font-size: .85rem; line-height: 1.5; color: var(--ink-weich); }
.schritte em { font-style: normal; font-weight: 500; color: var(--ink); }
.onboarding .schritte-fuss {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--linie);
  font-size: .85rem;
  max-width: none;
}

@media (max-width: 820px) { .schritte { grid-template-columns: repeat(2, 1fr); gap: 22px; } }
@media (max-width: 520px) { .schritte { grid-template-columns: 1fr; gap: 20px; } }

/* Auch Felder ohne type-Attribut: input[type="text"] greift dort nicht,
   der Attributselektor prüft das Attribut, nicht den effektiven Typ. */
textarea, select, input:not([type]), input[type="email"], input[type="password"], input[type="number"], input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--linie-stark);
  background: var(--flaeche);
  color: var(--ink);
}
textarea { margin: 6px 0 14px; }
select { margin: 6px 0 14px; height: 44px; }
input[type="email"], input[type="password"], input[type="text"] { margin: 6px 0 14px; }

/* Formularseiten laufen schmaler als der Wochenplan: bei 900 px reissen
   Beschriftung und Eingabefeld zu weit auseinander. */
.formular { max-width: 620px; margin: 0 auto; }
/* Beschriftetes Eingabefeld: label, optionaler Hinweis und Feld stehen
   immer untereinander. label ist von Haus aus inline, ohne diesen Block
   rutschen Beschriftung und Feld nebeneinander. */
.feld { display: block; margin-bottom: 18px; }
.feld > label { display: block; margin-bottom: 6px; }
.feld > input { display: block; width: 100%; margin: 0 0 8px; }
.feld > input:last-child { margin-bottom: 0; }
.feldhinweis { margin: 0 0 8px; font-size: .8rem; color: var(--ink-weich); }

/* Kachel-Texte: ein Formular je Kachel, sichtbar voneinander getrennt. */
.slide-text { margin-top: 20px; }
.slide-text + .slide-text { padding-top: 20px; border-top: 1px solid var(--linie); }
.slide-text h3 { margin: 0 0 14px; }
label { font-family: var(--versal); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-weich); }

button {
  font-family: var(--versal);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 13px 18px;
  cursor: pointer;
  width: 100%;
  background: var(--flaeche);
  color: var(--ink);
}
button:hover { filter: brightness(.96); }
button:active { filter: brightness(.9); }
.zeile { display: flex; gap: 10px; flex-wrap: wrap; }
.zeile form { flex: 1; min-width: 180px; }
.ok { background: var(--gruen); color: #fff; }
.neutral { background: var(--flaeche); border-color: var(--linie-stark); }
.warn { background: var(--koralle); color: #fff; }

.leer { color: var(--ink-weich); }
.fehler { color: var(--koralle-dunkel); background: var(--koralle-weich); border-radius: var(--radius); padding: 12px; }
.hinweis { color: var(--koralle-dunkel); font-weight: 500; }

/* ---------- Banner ---------- */

.banner {
  background: var(--gelb-weich);
  border: 1px solid var(--gelb);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 14px;
  font-size: .9rem;
}
.banner.ruhig { background: var(--flaeche); border-color: var(--linie); color: var(--ink-weich); }
.banner.erfolg { background: var(--gruen-weich); border-color: var(--salbei); }
.banner.warnung { background: var(--koralle-weich); border-color: var(--koralle); }

/* ---------- Mix-Einstellungen ---------- */

.mix-zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.mix-zeile:last-of-type { border-bottom: 0; }
.mix-eingabe { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mix-eingabe input { width: 76px; text-align: right; }

/* ---------- Chips, Karten, Badges ---------- */

.chips { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--versal);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  padding: 7px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.chip.aktiv { background: var(--ink); color: var(--flaeche); border-color: var(--ink); }

.karte {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 12px;
  margin: 10px 0;
  text-decoration: none;
}
.karte:hover { border-color: var(--ink); }
.karte.s-warten, .karte.s-geplant, .karte.s-live, .karte.s-arbeit, .karte.s-fehler, .karte.s-abgelehnt { border-left-width: 4px; }
.karte img, .karte .platzhalter { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-klein); background: var(--bg); flex-shrink: 0; }
.karte div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.karte strong { font-family: var(--versal); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.karte small { color: var(--ink-weich); }

.badges { margin: 6px 0; }
.badge {
  display: inline-block;
  font-family: var(--versal);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: var(--bg);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  padding: 3px 7px;
  margin-right: 5px;
}
.b-draft { background: #ece9f4; border-color: var(--lavendel); }
.b-pending_review { background: var(--gelb-weich); border-color: var(--gelb); }
.b-approved, .b-scheduled { background: var(--gruen-weich); border-color: var(--salbei); }
.b-published { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.b-failed { background: var(--koralle); border-color: var(--koralle); color: #fff; }
.b-rejected { background: var(--linie); border-color: var(--linie-stark); color: var(--ink-weich); }
.b-test { background: var(--ink); border-color: var(--ink); color: var(--gelb); }

/* ---------- Technik, Galerie, Log ---------- */

.technik { margin-top: 24px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px; }
.technik summary { cursor: pointer; font-family: var(--versal); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-weich); }

.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.galerie figure { margin: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px; }
.galerie figure.gewaehlt { border-color: var(--gruen); border-width: 2px; }
.galerie figure.untauglich { opacity: .5; }
.galerie img { width: 100%; border-radius: var(--radius-klein); }
.galerie .platzhalter.sheet { width: 100%; height: 220px; background: var(--bg); border-radius: var(--radius-klein); }
.galerie figcaption { font-size: .75rem; margin-top: 8px; color: var(--ink-weich); }

.log {
  background: var(--ink);
  color: #e8e6e0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 14px;
  border-radius: var(--radius);
  font-size: .74rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow-y: auto;
}

@media (max-width: 560px) {
  .kopf { flex-direction: column; align-items: flex-start; gap: 12px; }
  .marke img { height: 34px; }
}

/* Meta-Verbindungstest: ein Eintrag je Prüfschritt, Status vorn. */
.pruefliste { list-style: none; padding-left: 0 !important; }
.pruefliste li { margin: 10px 0; }
.pruefliste li strong { font-family: var(--versal); font-size: .74rem; letter-spacing: .06em; margin-right: 8px; }
.pruefliste li.schritt-ok strong { color: var(--gruen); }
.pruefliste li.schritt-hinweis strong { color: var(--gelb-dunkel); }
.pruefliste li.schritt-fehler strong { color: var(--koralle); }
