:root {
  --color-primary:       #7A4FA0;
  --color-primary-dark:  #5C3878;
  --color-primary-light: #F2EBF8;
  --color-grey:          #6B6B6B;
  --color-grey-light:    #F7F7F7;
  --color-border:        #E0D8E8;
  --color-text:          #1A1A1A;
  --color-success:       #2A7A4A;
  --color-success-bg:    #EBF5EF;
  --color-warning:       #B85C00;
  --color-warning-bg:    #FFF3E8;
  --font:                system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --radius:              14px;
  --radius-sm:           8px;
  --max-width:           640px;
  --shadow:              0 2px 12px rgba(122, 79, 160, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: #fff;
  min-height: 100vh;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--color-border);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.4s ease;
  width: 25%;
}

/* ============================================================
   STEPS
   ============================================================ */
.step {
  display: none;
  min-height: 100vh;
}

.step.active {
  display: block;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--color-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.hero-content {
  max-width: var(--max-width);
}

.hero-label {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: #fff;
  color: var(--color-primary);
  border: none;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.step:not(#step-start) .btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-secondary {
  display: inline-block;
  padding: 0.9rem 1.5rem;
  background: transparent;
  color: var(--color-grey);
  border: 1.5px solid var(--color-border);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================================
   MAIN LAYOUT (zweispaltig)
   ============================================================ */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  align-items: start;
}

.config-panel h2,
.result-panel h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--color-primary-dark);
}

.result-panel {
  min-width: 0;
}

.result-sticky {
  position: sticky;
  top: 2rem;
}

.result-subtitle {
  color: var(--color-grey);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.btn-bestellen {
  width: 100%;
  text-align: center;
  margin-bottom: 0.75rem;
}

.btn-back {
  width: 100%;
  text-align: center;
}

@media (max-width: 720px) {
  .main-layout {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 4rem;
  }
  .result-sticky {
    position: static;
  }
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.container h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--color-primary-dark);
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--color-grey-light);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}

.card-label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.card-hint {
  font-size: 0.85rem;
  color: var(--color-grey);
  margin-bottom: 1rem;
}

/* ============================================================
   NUMBER INPUT (Personen)
   ============================================================ */
.number-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.number-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.1s;
}

.number-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.number-value {
  min-width: 60px;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.number-hint {
  font-size: 0.85rem;
  color: var(--color-grey);
}

/* ============================================================
   HUNGER BUTTONS
   ============================================================ */
.hunger-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.hunger-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.5rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hunger-btn:hover {
  border-color: var(--color-primary);
}

.hunger-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.hunger-emoji {
  font-size: 1.8rem;
}

.hunger-hint {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--color-grey);
  text-align: center;
}

/* ============================================================
   BROT-TYP AUSWAHL
   ============================================================ */
.brot-typ-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.brot-typ-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.5rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.brot-typ-btn:hover { border-color: var(--color-primary); }

.brot-typ-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.brot-typ-emoji { font-size: 1.6rem; }

/* Teig-Auswahl */
.teig-auswahl {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.teig-auswahl.hidden { display: none; }

.teig-auswahl-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-grey);
  margin-bottom: 0.6rem;
}

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

.teig-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.teig-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.teig-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.dot-papavero   { background: #4A2C1A; }
.dot-parisettes { background: #D4A843; }
.dot-laugen     { background: #8B4513; }


/* ============================================================
   GRUPPEN-BALKEN
   ============================================================ */
.gruppen-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-border);
  margin-bottom: 0.6rem;
  gap: 2px;
}

.gruppen-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
  min-width: 0;
}

.seg-fleisch     { background: #7A4FA0; }
.seg-fisch       { background: #2A7A9A; }
.seg-vegetarisch { background: #2A7A4A; }
.seg-vegan       { background: #7A9A2A; }

.gruppen-legende {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.legende-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--color-grey);
}

.legende-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-fleisch     { background: #7A4FA0; }
.dot-fisch       { background: #2A7A9A; }
.dot-vegetarisch { background: #2A7A4A; }
.dot-vegan       { background: #7A9A2A; }

.gruppe-auto {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-grey);
  background: var(--color-grey-light);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.gruppe-value-auto {
  color: var(--color-grey);
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}

/* ============================================================
   GRUPPEN
   ============================================================ */
.gruppen-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gruppe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gruppe-label {
  font-size: 0.95rem;
}

.gruppe-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gruppe-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

.gruppe-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.gruppe-value {
  min-width: 32px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}


/* ============================================================
   RESULT
   ============================================================ */
.result-header {
  margin-bottom: 1.5rem;
}

.result-subtitle {
  color: var(--color-grey);
  margin-top: 0.4rem;
}


/* Brot-Liste */
.brote-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 1.2rem 0;
}

.brot-card {
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}


.brot-emoji {
  font-size: 2rem;
  flex-shrink: 0;
}

.brot-info {
  flex: 1;
}

.brot-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.brot-sorte {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-grey);
  margin-bottom: 0.4rem;
  min-height: 1.2em;
}

.teig-dot-inline {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.brot-fuellungen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.fuellung-tag {
  display: inline-block;
  position: relative;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: default;
}

.fuellung-tag::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1A1A1A;
  color: #fff;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.fuellung-tag:hover::after { opacity: 1; }

.tag-fleisch     { background: rgba(122, 79,  160, 0.12); color: #5C3878; }
.tag-fisch       { background: rgba( 42, 122, 154, 0.12); color: #1A5E78; }
.tag-vegetarisch { background: rgba( 42, 122,  74, 0.12); color: #1A5E38; }
.tag-vegan       { background: rgba(122, 154,  42, 0.12); color: #4A6A10; }

.brot-preis {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  font-size: 0.95rem;
}

/* Preis-Box */
.preis-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  margin: 0.5rem 0 1rem;
}

.preis-label {
  font-size: 1rem;
  opacity: 0.85;
}

.preis-total {
  font-size: 1.6rem;
  font-weight: 700;
}

.result-hint {
  text-align: center;
  color: var(--color-grey);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* ============================================================
   BESTELL-BUTTON (result panel)
   ============================================================ */
.btn-bestellen {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
}

.btn-back {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.75rem;
}

/* ============================================================
   BESTELLUNG
   ============================================================ */
.order-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.order-container h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.4rem;
}

.order-intro {
  color: var(--color-grey);
  margin-bottom: 1.5rem;
}

.btn-back-inline {
  background: none;
  border: none;
  color: var(--color-grey);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.btn-back-inline:hover { color: var(--color-primary); }

/* Filialauswahl */
.filial-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.filial-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filial-item:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.filial-item input[type="radio"] {
  accent-color: var(--color-primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.filial-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.filial-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.filial-adresse {
  font-size: 0.82rem;
  color: var(--color-grey);
}

/* Datum */
.datum-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.datum-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.datum-hint {
  font-size: 0.85rem;
  min-height: 1.2em;
}

.datum-ok    { color: var(--color-success); }
.datum-error { color: var(--color-warning); }

/* Kontaktformular */
.form-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-grey);
}

.form-input {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

/* Bestellübersicht */
.summary-meta {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.summary-row span:first-child { color: var(--color-grey); }
.summary-row span:last-child  { font-weight: 500; }

.summary-brote {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.summary-brot-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.summary-brot-fuellungen {
  color: var(--color-grey);
  font-size: 0.8rem;
  flex: 1;
  text-align: center;
}

.summary-brot-preis {
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-primary);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1.5px solid var(--color-border);
  font-weight: 700;
  font-size: 1rem;
}

/* Absenden */
.order-actions {
  margin-top: 0.5rem;
  text-align: center;
}

.btn-submit {
  width: 100%;
  margin-bottom: 0.75rem;
}

/* ============================================================
   ERFOLGSSEITE
   ============================================================ */
.success-screen {
  text-align: center;
  padding: 4rem 1rem;
}

.success-emoji {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1rem;
}

.success-screen h2 {
  color: var(--color-primary-dark);
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.success-screen p {
  color: var(--color-grey);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.success-details {
  background: var(--color-grey-light);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  max-width: 400px;
  margin: 0 auto 2rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .hunger-buttons {
    grid-template-columns: 1fr;
  }
  .step-nav {
    flex-direction: column-reverse;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
    text-align: center;
  }
}
