/* ==========================================================================
   Angebotsvergleich-Funnel Gebäudereinigung München
   Design System + Alle Komponenten
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --color-primary: #1B7A5A;
  --color-primary-dark: #145C44;
  --color-primary-light: #E8F5EE;
  --color-accent: #E8A838;
  --color-text: #2D3436;
  --color-text-secondary: #636E72;
  --color-bg: #FAFBFC;
  --color-card: #FFFFFF;
  --color-border: #DFE6E9;
  --color-error: #E74C3C;
  --color-success: #27AE60;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 4px 20px rgba(27, 122, 90, 0.15);
  --shadow-funnel: 0 4px 24px rgba(0, 0, 0, 0.10);

  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-input: 8px;

  --transition-base: 0.3s ease;
  --transition-fast: 0.15s ease;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --header-height: 48px;
  --trust-line-height: 52px;
  --footer-height: 54px;
}

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

html, body {
  height: auto;
  overflow: auto;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Page Layout (100vh) ---------- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Header ---------- */
.header {
  height: var(--header-height);
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.header__logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header__brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.header__brand-accent {
  color: var(--color-accent);
}

.header__tagline {
  font-size: 10px;
  color: var(--color-text-secondary);
  display: none;
}

.header__phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

.header__phone:hover {
  color: var(--color-primary-dark);
}

.header__phone-hours {
  display: none;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* ---------- Funnel (Main Area) ---------- */
.funnel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  gap: 32px;
}

.funnel__header {
  text-align: center;
  flex-shrink: 0;
  max-width: 680px;
}

.funnel__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.funnel__subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.funnel__container {
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-funnel);
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
}

/* ---------- Progress Bar ---------- */
.progress {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.progress__bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 3px;
  width: 14%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress__label {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

/* ---------- Funnel Content ---------- */
.funnel__content {
  position: relative;
}

/* Step Wrapper */
.step {
  animation: stepFadeIn 0.4s ease forwards;
}

.step__question {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 4px;
}

.step__subtext {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 16px;
}

/* ---------- Option Cards (Multi/Single Select) ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
  width: 100%;
}

.cards-grid--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  user-select: none;
  text-align: center;
  min-height: 90px;
  min-width: 0;
  overflow: hidden;
  touch-action: manipulation;
}

.option-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.option-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.option-card.selected {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.option-card.selected::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6L5.5 8.5L9.5 3.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.option-card__icon {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
}

.option-card__icon svg {
  width: 100%;
  height: 100%;
}

.option-card__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  hyphens: auto;
  max-width: 100%;
}

.option-card__sublabel {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.2;
}

/* ---------- Slider (Step 3) ---------- */
.slider-container {
  padding: 8px 0;
}

.slider__value {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.slider__value span {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.slider__input {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border);
  border-radius: 4px;
  outline: none;
  margin: 12px 0;
  touch-action: none;
}

.slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  border: 3px solid var(--color-card);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 122, 90, 0.3);
  transition: transform var(--transition-fast);
}

.slider__input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider__input::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  border: 3px solid var(--color-card);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 122, 90, 0.3);
}

.slider__labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-secondary);
}

.slider__quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
}

.quick-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.quick-btn.selected {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* ---------- Radio List (Step 5) ---------- */
.radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
  touch-action: manipulation;
}

.radio-item:hover {
  border-color: var(--color-primary);
}

.radio-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.radio-item.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  border-left-width: 4px;
}

.radio-item__circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  transition: all var(--transition-fast);
  position: relative;
}

.radio-item.selected .radio-item__circle {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.radio-item.selected .radio-item__circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.radio-item__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

/* ---------- Toggle Buttons (Step 6) ---------- */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
  width: 100%;
  text-align: left;
  touch-action: manipulation;
}

.toggle-btn:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-card-hover);
}

.toggle-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.toggle-btn.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.toggle-btn__icon {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.toggle-btn__icon svg {
  width: 100%;
  height: 100%;
}

.toggle-btn__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

/* ---------- Contact Form (Step 7) ---------- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27, 122, 90, 0.1);
}

.form-group input.error,
.form-group select.error {
  border-color: var(--color-error);
}

.form-group .field-error {
  font-size: 11px;
  color: var(--color-error);
  min-height: 0;
}

.form-group .field-error:not(:empty) {
  min-height: 14px;
}

.consent-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}

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

.consent-group label {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

.consent-group a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Security hint */
.security-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

.security-hint svg {
  flex-shrink: 0;
}

/* ---------- Navigation Buttons ---------- */
.funnel__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-btn);
  transition: all var(--transition-base);
  touch-action: manipulation;
}

.btn--back {
  color: var(--color-text-secondary);
  padding-left: 12px;
}

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

.btn--next {
  background: var(--color-primary);
  color: white;
  margin-left: auto;
}

.btn--next:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 122, 90, 0.3);
}

.btn--next:active {
  transform: translateY(0);
}

.btn--submit {
  background: var(--color-primary);
  color: white;
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 16px;
}

.btn--submit:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(27, 122, 90, 0.3);
}

.btn--submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--submit .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn--submit.loading .btn-text {
  display: none;
}

.btn--submit.loading .btn-spinner {
  display: block;
}

/* ---------- Error Message ---------- */
.funnel__error {
  text-align: center;
  font-size: 13px;
  color: var(--color-error);
  min-height: 0;
  overflow: hidden;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.funnel__error.visible {
  min-height: 20px;
  margin-top: 8px;
}

/* ---------- Confirmation Screen ---------- */
.confirmation {
  text-align: center;
  padding: 20px 0;
}

.confirmation__checkmark {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.confirmation__checkmark svg {
  width: 100%;
  height: 100%;
}

.confirmation__checkmark circle {
  stroke: var(--color-success);
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkCircle 0.6s ease forwards;
}

.confirmation__checkmark path {
  stroke: var(--color-success);
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkMark 0.4s ease 0.4s forwards;
}

.confirmation__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.confirmation__text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirmation__summary {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  padding: 16px;
  text-align: left;
}

.confirmation__summary-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.confirmation__summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--color-border);
}

.confirmation__summary-item:last-child {
  border-bottom: none;
}

.confirmation__summary-label {
  color: var(--color-text-secondary);
}

.confirmation__summary-value {
  color: var(--color-text);
  font-weight: 500;
  text-align: right;
}

/* ---------- Trust Line ---------- */
.trust-line {
  height: var(--trust-line-height);
  flex-shrink: 0;
  background: #EAECEF;
  border-top: 1px solid var(--color-border);
}

.trust-line__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  padding: 0 16px;
}

.trust-line__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.trust-line__divider {
  display: none;
}

/* ---------- Footer ---------- */
.footer {
  height: var(--footer-height);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 4px;
  padding: 0 16px;
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 0;
}

.footer__link {
  font-size: 12px;
  color: var(--color-text-secondary);
  padding: 0 10px;
  border-right: 1px solid var(--color-border);
  transition: color var(--transition-fast);
}

.footer__link:last-child {
  border-right: none;
}

.footer__link:hover {
  color: var(--color-primary);
}

.footer__copy {
  font-size: 11px;
  color: #B2BEC3;
}

/* ---------- Animations ---------- */
@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stepFadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

@keyframes stepFadeInReverse {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes checkCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes checkMark {
  to { stroke-dashoffset: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.step--reverse {
  animation: stepFadeInReverse 0.4s ease forwards;
}

/* ---------- Responsive: Tablet (600px+) ---------- */
@media (min-width: 600px) {
  :root {
    --header-height: 52px;
  }

  .header__tagline {
    display: block;
  }

  .header__phone-hours {
    display: inline;
  }

  .funnel__title {
    font-size: 24px;
  }

  .funnel__subtitle {
    font-size: 15px;
  }

  .funnel__container {
    padding: 24px 32px;
  }

  .step__question {
    font-size: 20px;
  }

  .option-card {
    min-height: 100px;
    padding: 16px 12px;
  }

  .option-card__icon {
    width: 40px;
    height: 40px;
  }

  .option-card__label {
    font-size: 14px;
  }
}

/* ---------- Responsive: Desktop (960px+) ---------- */
@media (min-width: 960px) {
  :root {
    --header-height: 56px;
  }

  .header__inner {
    padding: 0 32px;
  }

  .header__brand {
    font-size: 17px;
  }

  .header__tagline {
    font-size: 11px;
  }

  .funnel__title {
    font-size: 26px;
  }

  .funnel__subtitle {
    font-size: 15px;
  }

  .funnel__container {
    max-width: 720px;
    padding: 28px 40px;
  }

  .step__question {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .step__subtext {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .option-card {
    min-height: 110px;
    padding: 18px 12px;
    gap: 8px;
  }

  .option-card__icon {
    width: 44px;
    height: 44px;
  }

  .slider__value {
    font-size: 42px;
  }
}

/* ---------- Responsive: Mobile (max 599px) ---------- */
@media (max-width: 599px) {
  .funnel {
    padding: 16px 16px;
    gap: 16px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .funnel__container {
    box-shadow: none;
    border: 1px solid var(--color-border);
  }

  .form-row {
    flex-direction: column;
  }

  .trust-line {
    height: auto;
    padding: 8px 16px;
  }

  .trust-line__inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
  }

  .trust-line__item {
    font-size: 11px;
  }

  .footer {
    height: auto;
    padding: 8px 16px;
  }

  .footer__copy {
    text-align: center;
  }
}

/* ---------- Responsive: Mobile Small (max 380px) ---------- */
@media (max-width: 380px) {
  .option-card {
    min-height: 80px;
    padding: 10px 6px;
  }

  .option-card__icon {
    width: 28px;
    height: 28px;
  }

  .option-card__label {
    font-size: 11px;
  }

  .funnel {
    gap: 10px;
  }

  .funnel__title {
    font-size: 17px;
  }

  .funnel__subtitle {
    font-size: 12px;
  }

  .funnel__container {
    padding: 14px 14px;
  }

  .step__question {
    font-size: 16px;
  }

  .slider__value {
    font-size: 28px;
  }

  .trust-line__inner {
    flex-direction: column;
    gap: 4px;
  }

  .trust-line__item {
    font-size: 10px;
  }
}

/* ---------- 100vh-Layout: Tablet + Desktop (ab 768px breit) ---------- */
@media (min-width: 768px) {
  .page-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .funnel {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
  }
}

/* ---------- Hover nur auf Geräten mit Maus ---------- */
@media (hover: none) {
  .option-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--color-border);
  }

  .option-card.selected:hover {
    border-color: var(--color-primary);
  }

  .toggle-btn:hover {
    box-shadow: none;
    border-color: var(--color-border);
  }

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

  .btn--next:hover {
    transform: none;
    box-shadow: none;
  }
}
