@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --color-primary: #002D2D;
  --color-bg: #FFFFFF;
  --color-text-secondary: #4B5563;
  --color-lines: #E5E7EB;
  --color-section: #F7F8FA;
  --color-brand: #002D2D;
  --color-brand-hover: #002222;
  --color-progress: #00E8A2;
  --shadow-soft: 0 8px 24px rgba(0,0,0,.06);
  --radius-xl: 20px;
}

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

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.3rem;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.4rem;
  }
  h2 {
    font-size: 1.2rem;
  }
}

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-lines);
  padding: 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-progress {
  display: none;
}

@media (max-width: 767px) {
  .mobile-progress {
    display: block;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-lines);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 54px;
    z-index: 99;
  }
  .mobile-progress .progress-wrapper {
    display: flex !important;
  }
}

.header-container {
  max-width: 1024px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 767px) {
  .header-container {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
  }
  .header-tagline {
    display: none;
  }
  .header-container .progress-wrapper {
    display: none !important;
  }
}

.logo-link {
  display: block;
  line-height: 0;
}

.logo {
  width: 157px;
  height: 13px;
}

@media (min-width: 768px) {
  .logo {
    width: 196px;
    height: 16px;
  }
}

.header-tagline {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.main-content {
  flex: 1;
  width: 100%;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

@media (min-width: 768px) {
  .main-content {
    padding: 2rem 1.5rem;
    justify-content: center;
  }
}

.progress-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-lines);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-progress);
  transition: width 0.3s ease;
  width: 16.66%;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: progressPulse 3s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes progressPulse {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

@media (max-width: 480px) {
  .progress-label {
    font-size: 0.6875rem;
  }
  .progress-bar {
    height: 5px;
  }
}

.form-container {
  width: 100%;
  max-width: 1024px;
}

.step-card {
  background: var(--color-section);
  border: 1px solid var(--color-lines);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  .step-card {
    padding: 3rem;
  }
}

.step-title {
  margin-bottom: 1rem;
}

.step-description {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

@media (min-width: 768px) {
  .step-description {
    margin-bottom: 2rem;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .form-group {
    margin-bottom: 1.25rem;
  }
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.required {
  color: var(--color-brand);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--color-lines);
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(0, 45, 45, 0.1);
}

.form-group input[aria-invalid="true"],
.form-group select[aria-invalid="true"],
.form-group textarea[aria-invalid="true"] {
  border-color: #DC2626;
}

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

.phone-input-group {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .phone-input-group {
    grid-template-columns: 20% 1fr;
    gap: 1rem;
  }
}

@media (max-width: 767px) {
  .phone-input-group {
    gap: 1rem;
  }
}

.phone-country {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
}

.phone-number {
  width: 100%;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-weight: 500;
}

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

#sameAddressGroup {
  margin-bottom: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 768px) {
  #sameAddressGroup {
    margin-bottom: 1rem;
    margin-top: 1rem;
  }
}

/* Telefon form-group margin fix - zu großer Abstand oben */
.form-group:has(#telefon) {
  margin-top: 0.75rem;
}

@media (min-width: 768px) {
  .form-group:has(#telefon) {
    margin-top: 1rem;
  }
}

/* Form-row nach form-row Spacing - zu wenig Abstand zwischen Wohnfläche/Grundstück und Zimmer/Baujahr */
.form-row + .form-row {
  margin-top: 0.25rem;
}

@media (min-width: 768px) {
  .form-row + .form-row {
    margin-top: 0.5rem;
  }
}

/* Zustand nach form-row - zu großer Abstand */
.form-row + .form-group {
  margin-top: 0;
}

.error-message {
  display: block;
  color: #DC2626;
  font-size: 0.875rem;
  margin-top: 0.375rem;
  min-height: 1.25rem;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.375rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
  .form-row .form-group-wide {
    grid-column: 1 / 2;
  }
  .form-row .form-group-narrow {
    grid-column: 2 / 3;
  }
}

.form-row .form-group {
  margin-bottom: 0;
}

.radio-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .radio-group {
    gap: 1rem;
  }
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-lines);
  border-radius: 12px;
  background: var(--color-bg);
  transition: all 0.2s;
  font-weight: 500;
}

.radio-label:hover {
  border-color: var(--color-brand);
  background: rgba(0, 45, 45, 0.02);
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--color-brand);
  vertical-align: middle;
}

.radio-label span {
  line-height: 1.2;
}

.radio-label input[type="radio"]:checked + span {
  color: var(--color-brand);
}

.radio-label:has(input:checked) {
  border-color: var(--color-brand);
  background: rgba(0, 45, 45, 0.06);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-value {
  font-size: 1rem;
  color: var(--color-primary);
  font-weight: 500;
}

.form-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .form-navigation {
    margin-top: 2rem;
    gap: 3rem;
  }
}

@media (max-width: 767px) {
  .form-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-lines);
    padding: 0.875rem 1.5rem;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,.04);
    margin-top: 0;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .bekannt-aus {
    display: none !important;
  }
  .form-container {
    padding-bottom: 5rem;
  }
}

.form-navigation #btnBack {
  justify-self: start;
}

.form-navigation #btnNext {
  justify-self: end;
}

.form-navigation .bekannt-aus {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  justify-self: center;
}

.bekannt-label {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  white-space: nowrap;
}

.bekannt-logos {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bekannt-logo {
  max-width: 100px;
  height: auto;
  max-height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.bekannt-logo:hover {
  opacity: 1;
}

.btn-primary,
.btn-outline,
.btn-ghost,
.btn-link {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--radius-xl);
  min-height: 52px;
  padding: 0.875rem 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-brand);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-brand-hover);
}

.btn-primary:active:not(:disabled) {
  filter: brightness(0.95);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--color-brand);
  border: 1px solid var(--color-brand);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(0, 45, 45, 0.06);
}

.btn-outline:active:not(:disabled) {
  background: rgba(0, 45, 45, 0.12);
}

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

.btn-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: #F7F8FA;
  color: var(--color-brand);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: #EDEEF1;
}

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

.btn-ghost:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #FAFBFC;
}

.btn-link {
  background: transparent;
  color: var(--color-brand);
  border: none;
  text-decoration: underline;
  padding: 0.5rem 1rem;
  min-height: auto;
}

.btn-link:hover:not(:disabled) {
  text-decoration: none;
}

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

@media (max-width: 767px) {
  .btn-primary,
  .btn-outline,
  .btn-ghost {
    min-height: 44px;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }
}

.thank-you-container {
  width: 100%;
  max-width: 720px;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--color-section);
  border: 1px solid var(--color-lines);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  .thank-you-container {
    padding: 3rem 2rem;
  }
}

.thank-you-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .thank-you-hero {
    margin-bottom: 1.5rem;
  }
}

.thank-you-icon {
  width: 48px;
  height: 48px;
  fill: var(--color-brand);
}

.thank-you-title {
  font-size: 1.6rem;
}

@media (max-width: 768px) {
  .thank-you-title {
    font-size: 1.4rem;
  }
}

.thank-you-text {
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.thank-you-summary {
  background: var(--color-bg);
  border: 1px solid var(--color-lines);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.thank-you-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-lines);
}

.thank-you-summary-item:last-child {
  border-bottom: none;
}

.thank-you-summary-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.thank-you-summary-value {
  font-weight: 600;
  color: var(--color-primary);
}

.thank-you-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .thank-you-actions {
    flex-direction: row;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 2rem;
  }
}
