:root {
  --fc-font-size: 1rem;
}

/* 🎨 Farbwahl */

.fc-color-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.fc-color-box {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  transition: border 0.2s ease;
}

.fc-color-box::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #111;
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: var(--fc-font-size);
  border-radius: 0.25rem;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.fc-color-box:hover::after {
  opacity: 1;
}

.fc-color-box.fc-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

/* 📋 Eingabefelder & Selects */

.fc-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fc-input,
select.fc-select,
textarea.fc-input {
  width: 100%;
  height: 48px;
  padding: 0.75rem 1rem;
  font-size: var(--fc-font-size);
  line-height: 1.5;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #fff;
  box-sizing: border-box;
}

.fc-input:focus,
select.fc-select:focus,
textarea.fc-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.fc-input::placeholder,
.fc-select::placeholder,
textarea.fc-input::placeholder {
  font-size: var(--fc-font-size);
}

textarea.fc-input {
  min-height: 176px;
  resize: vertical;
  height: auto;
}

select.fc-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='gray' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}


/* ⚠️ Validierung & Fehleranzeigen */

.fc-error-message {
  color: red;
  font-size: var(--fc-font-size);
  margin-top: 0.25rem;
  opacity: 0;
  display: none;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}

.fc-error-message.fc-visible {
  opacity: 1;
  display: block;
}

.fc-shake {
  animation: fc-shake 0.3s ease;
}

.fc-info-inline {
  font-size: var(--fc-font-size);
  font-style: italic;
  color: #666;
  margin-left: 0.4ch;
}


/* 🧮 Sichtbarkeitssteuerung */

.fc-hidden {
  visibility: hidden;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.fc-visible {
  visibility: visible;
  opacity: 1;
  height: auto;
}


/* 🔘 Checkboxen */

.fc-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


/* 📬 Kontaktformular */

.fc-contact-field,
.cost-calculator-block {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.fc-contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.fc-contact-col {
  flex: 1 1 300px;
}

.fc-contact-grid > fieldset {
  flex: 1 1 1rem;
  min-width: 280px;
}

fieldset {
  border: none;
}

.fc-span-2 {
  flex: 1 1 100%;
}

/* Address-Block */

.fc-address-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.fc-address-group .fc-span-2 {
  grid-column: span 2;
}

@media (min-width: 600px) {
  .fc-address-group {
    grid-template-columns: 1fr 3fr;
  }

  .fc-address-group .fc-postal {
    grid-column: 1 / 2;
  }

  .fc-address-group .fc-city {
    grid-column: 2 / 3;
  }
}

/* 🔐 hCaptcha */

.h-captcha {
  min-height: 80px;
  background-color: transparent !important;
  box-shadow: none !important;
}

.fc-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.4s;
  border-radius: 9999px;
}

.fc-slider::before {
  position: absolute;
  content: "";
  height: 1.25rem;
  width: 1.25rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: white;
  transition: 0.4s;
  border-radius: 9999px;
}

.fc-field.fc-span-2 > label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.fc-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  transition: background-color 0.3s;
  border-radius: 9999px;
}

.fc-slider::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  bottom: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.3s;
}

/* 📦 Zusammenfassung */

.fc-summary-box {
  background-color: #f9fafb;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  padding: 1.5rem;
  font-family: sans-serif;
  font-size: var(--fc-font-size);
  line-height: 1.6;
}

.fc-summary-box h3 {
  font-size: var(--fc-font-size);
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1e293b;
}

.fc-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fc-summary-list li {
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
  position: relative;
}

.fc-summary-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: bold;
}

.fc-summary-debug {
  outline: 1px dashed #94a3b8;
}

@media (min-width: 1024px) {
  .fc-sticky-summary {
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    max-height: 90vh;
    overflow-y: auto;
  }

  .fc-summary-col {
    width: 20rem;
  }
}


/* 📐 Layout */

.fc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.fc-container {
  width: 100%;
}

.fc-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.fc-left {
  flex: 1 1 50%;
  min-width: 300px;
}

.fc-right {
  flex: 1 1 45%;
  min-width: 250px;
}

@media (min-width: 1280px) {
  .fc-container {
    max-width: 1280px;
  }
}

#fc-wrapper,
.entry-content {
  overflow: visible !important;
}


/* ✅ Buttons & Interaktion */

.fc-button {
  background: #1f2937;
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: var(--fc-font-size);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.fc-button:hover {
  background: #111827;
}

.fc-toast {
  opacity: 1;
  transition: opacity 0.5s ease-out;
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 90vw;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fc-toast-success {
  background-color: #38a169;
}

.fc-toast-error {
  background-color: #e53e3e;
}

.fc-toast button {
  margin-left: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: var(--fc-font-size);
  cursor: pointer;
}

.fc-length-input {
  max-width: 100px;
  height: 48px;
  box-sizing: border-box;
}

.fc-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  border-radius: 9999px;
  transition: 0.3s;
}

.fc-slider::before {
  content: "";
  position: absolute;
  height: 1.25rem;
  width: 1.25rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.3s;
}

/* 🎯 Kommentarfeld exakt gleich hoch */
textarea.fc-input {
  height: 144px;
  resize: vertical;
}

.fc-slider {
  position: relative;
  display: inline-block;
  width: 3.25rem;
  height: 1.5rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  transition: background-color 0.3s;
}

.fc-slider::before {
  content: "";
  position: absolute;
  height: 1.25rem;
  width: 1.25rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.3s;
}
/* ✅ Zeile mit Label + Switch */
.fc-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 0.75rem;
  max-width: 450px;
}

/* ✅ Linkes Label, z. B. "Lieferung" */
.fc-switch-label {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: var(--fc-font-size);
  font-weight: 500;
}

/* ✅ Switch-Toggle Container */
.fc-switch-toggle {
  position: relative;
  display: flex;
  align-items: center;
  width: 100px;
  height: 48px;
  flex-shrink: 0;
}

/* ✅ Unsichtbares Input-Element */
.fc-switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}

/* ✅ Sichtbare Schiene inkl. Ja/Nein-Text */
.fc-switch-slider-labeled {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  width: 100%;
  height: 100%;
  background-color: #e5e7eb;
  border-radius: 9999px;
  cursor: pointer;
  font-size: var(--fc-font-size);
  font-weight: 600;
  color: #25282A;
  line-height: 1;
  box-sizing: border-box;
  overflow: hidden;
  user-select: none;
  transition: background-color 0.3s;
}

/* ✅ Text innerhalb der Switches */
.fc-switch-text {
  z-index: 2;
  transition: opacity 0.3s;
}

.fc-switch-text.yes {
  opacity: 0;
}

.fc-switch-text.no {
  opacity: 1;
}

/* ✅ Der weiße Schiebeball */
.fc-switch-slider-labeled::after {
  content: "";
  position: absolute;
  top: 52%;
  transform: translate(0, -52%);
  left: 4px;
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 9999px;
  z-index: 1;
  transition: transform 0.3s ease;
}


/* ✅ Aktiv-Zustand: Ja sichtbar, grün, Bubble rechts */
.fc-switch-toggle input:checked + .fc-switch-slider-labeled {
  background-color: #82B541;
  color: white;
}

.fc-switch-toggle input:checked + .fc-switch-slider-labeled .yes {
  opacity: 1;
}

.fc-switch-toggle input:checked + .fc-switch-slider-labeled .no {
  opacity: 0;
}

.fc-switch-toggle input:checked + .fc-switch-slider-labeled::after {
  transform: translate(52px, -50%);
}

/* Submit-Button */
.fc-button {
  background-color: #82B541;
  color: white;
  font-weight: 600;
  height: 48px;
  padding: 0 2rem;
  font-size: var(--fc-font-size);
  border: none;
  border-radius: 9999px; /* pill shape */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fc-button:hover {
  background-color: #6ab23c;
}

.fc-button:active {
  transform: scale(0.97);
}

/* Wrapper mit integriertem Layout */
.fc-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 9rem;
    height: 3rem;
    border: 1px solid #ccc;
    border-radius: 0.75rem;
    background-color: #fff;
    overflow: hidden;
}

/* Zahlenfeld */
.fc-input-wrapper input {
    flex: 1;
    height: 100%;
    padding-right: 1.75rem; /* Platz für das Suffix */
    border: none;
    text-align: center;
    font-size: var(--fc-font-size);
    font-weight: 500;
    outline: none;
    background: transparent;
    appearance: textfield;
}

/* Einheitssuffix "m" */
.fc-input-wrapper::after {
    content: "m";
    position: absolute;
    right: 2.75rem; /* Abstand zur rechten Kante (Button) */
    font-size: var(--fc-font-size);
    color: #555;
    pointer-events: none;
}

/* Buttons wie gehabt */
.fc-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    font-size: var(--fc-font-size);
    touch-action: manipulation;
    font-weight: bold;
    color: #007cba;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2;
}

.fc-btn:hover {
    color: #005a87;
}

.fc-minus { left: 0; }
.fc-plus { right: 0; }

.fc-input-wrapper input::-webkit-outer-spin-button,
.fc-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fc-input-wrapper input[type=number] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.fc-input-wrapper input:focus {
    outline: none;
    box-shadow: none;
}

.fc-input-wrapper:focus-within {
    box-shadow: 0 0 0 2px #007cba;
    border-color: #007cba;
}

/* ===== 📱 Mobile Layout: Felder untereinander (safe scroll + exceptions) ===== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  .fc-grid-2 {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .fc-field,
  .fc-span-2,
  .fc-contact-field {
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
    margin-bottom: 1.5rem;
  }

  .fc-field > *,
  .fc-contact-field > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Farbfeld bleibt horizontal */
  .fc-color-field .fc-color-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

 .fc-color-box::after {
    top: 110%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  /* Switches horizontal, aber begrenzt */
  .fc-switch-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fc-switch-toggle {
      -webkit-tap-highlight-color: transparent;
  }

  .fc-switch-toggle,
  .fc-switch-label {
    flex-shrink: 0;
  }

  /* Kontaktfeld-Grid untereinander */
  .fc-address-group,
  .fc-contact-grid {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Falls eingeblendete Elemente plötzlich auftauchen */
  .fc-hidden {
    display: none !important;
  }

  .fc-input-wrapper {
        width: 100%;
    }
}
