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

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

body.external-mode {
  min-height: auto;
}

.container {
  min-width: 620px;
  background: #fafafa;
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(16, 24, 40, 0.03),
    0 10px 28px rgba(0, 0, 0, 0.08),
    0 3px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.header {
  padding: 36px 40px 24px;
  text-align: center;
}

.icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #7a9b8e 0%, #6a8a7d 100%);
  border-radius: 16px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(122, 155, 142, 0.3);
  position: relative;
}

.icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  background: inherit;
  border-radius: 20px;
  opacity: 0.15;
  z-index: -1;
}

.icon i {
  width: 30px;
  height: 30px;
  color: white;
  stroke-width: 2.5;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.steps-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  position: relative;
  padding: 0 20px;
}

.steps-nav::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 60px;
  right: 60px;
  height: 2px;
  background: #e9ecef;
  z-index: 0;
}

.step-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  flex: 1;
  cursor: default;
  transition: all 0.3s ease;
  padding-top: 0;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #adb5bd;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.step-tab.active .step-number {
  background: #7a9b8e;
  border-color: #7a9b8e;
  color: white;
  box-shadow: 0 4px 12px rgba(122, 155, 142, 0.3);
  transform: scale(1.1);
}

.step-tab.completed .step-number {
  background: #7a9b8e;
  border-color: #7a9b8e;
  color: white;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: #adb5bd;
  text-align: center;
  transition: all 0.3s ease;
  line-height: 1.3;
  max-width: 100px;
}

.step-tab.active .step-label {
  color: #7a9b8e;
}

.step-tab.completed .step-label {
  color: #6c757d;
}

.content {
  padding: 0 40px 48px;
}

.step {
  display: none;
}

.step.active {
  display: block;
  animation: fadeSlideIn 0.5s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: 24px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.label-row label {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #212529;
  font-size: 14px;
}

input,
select {
  width: 100%;
  padding: 15px 18px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  color: #212529;
}

input:hover,
select:hover {
  border-color: #ced4da;
}

input:focus,
select:focus {
  outline: none;
  border-color: #7a9b8e;
  box-shadow: 0 0 0 4px rgba(122, 155, 142, 0.12);
  transform: translateY(-2px);
}

input.error,
select.error {
  border-color: #dc3545;
  background-color: #fff5f5;
}

input.error:focus,
select.error:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.12);
}

input::placeholder {
  color: #adb5bd;
}

input[readonly] {
  background: #f8f9fa;
  cursor: not-allowed;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%236c757d'%3E%3Cpath d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 45px;
}

.form-row {
  display: grid;
  gap: 20px;
}

.form-row.two-cols {
  grid-template-columns: 1fr 1fr;
}

/* Address Autocomplete */
.address-input-wrapper {
  position: relative;
}

.address-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e9ecef;
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.address-suggestions.active {
  display: block;
}

.address-suggestions.active.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.address-suggestions-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e9ecef;
  border-top-color: #7a9b8e;
  border-radius: 50%;
  animation: address-spinner 0.8s linear infinite;
}

@keyframes address-spinner {
  to {
    transform: rotate(360deg);
  }
}

.suggestion-item {
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f5;
  transition: background 0.2s;
}

.suggestion-item:hover {
  background: #f8f9fa;
}

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

.suggestion-street {
  font-weight: 600;
  color: #212529;
  margin-bottom: 4px;
}

.suggestion-location {
  font-size: 13px;
  color: #6c757d;
}

/* Selected Address */
.selected-address {
  margin: 20px 0px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 2px solid #7a9b8e;
  border-radius: 16px;
}

.selected-address-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.address-fields {
  flex: 1;
}

.change-address-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7a9b8e;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: text-decoration 0.3s ease;
}

.change-address-link:hover {
  text-decoration: underline;
}

/* Analysis Type Selection */
.analysis-type-selection {
  margin-bottom: 32px;
}

.analysis-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.analysis-card {
  padding: 28px 24px;
  background: white;
  border: 3px solid #e9ecef;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.analysis-card:hover {
  border-color: #7a9b8e;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(122, 155, 142, 0.2);
}

.analysis-card.selected {
  border-color: #7a9b8e;
  background: linear-gradient(135deg, #f0f7f4 0%, #ffffff 100%);
  box-shadow: 0 4px 16px rgba(122, 155, 142, 0.3);
}

.card-icon {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon i {
  width: 40px;
  height: 40px;
  color: #7a9b8e;
}

.analysis-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.analysis-card p {
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
}

.analysis-content {
  margin-top: 32px;
}

.counter {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.counter-btn {
  width: 50px;
  height: 50px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  background: white;
  font-size: 24px;
  font-weight: 700;
  color: #7a9b8e;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.counter-btn:hover {
  background: #7a9b8e;
  color: white;
  border-color: #7a9b8e;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(122, 155, 142, 0.3);
}

.counter-btn:active {
  transform: scale(0.96);
}

.counter-value {
  flex: 1;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  padding: 14px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  color: #212529;
}

.wohnungen-list {
  margin-top: 32px;
}

.wohnung-item {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 2px solid #e9ecef;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.wohnung-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #7a9b8e 0%, #6a8a7d 100%);
  transform: scaleY(0);
  transition: transform 0.4s ease;
}

.wohnung-item:hover {
  border-color: #7a9b8e;
  box-shadow: 0 8px 28px rgba(122, 155, 142, 0.2);
  transform: translateY(-4px);
}

.wohnung-item:hover::before {
  transform: scaleY(1);
}

.wohnung-item h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #7a9b8e;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wohnung-item h3 i {
  width: 20px;
  height: 20px;
  color: #7a9b8e;
  flex-shrink: 0;
}

.special-rental-question {
  margin-top: 20px;
  padding: 16px;
  background: #fff8e1;
  border: 2px solid #ffe082;
  border-radius: 12px;
}

.special-rental-question label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 0;
}

.special-rental-question input[type='radio'] {
  width: auto;
  margin: 0;
  accent-color: #7a9b8e;
}

.label-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.leerstand-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.leerstand-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.leerstand-slider {
  position: absolute;
  inset: 0;
  background: #e9ecef;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px #dee2e6;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.leerstand-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.leerstand-switch input:checked + .leerstand-slider {
  background: linear-gradient(135deg, #7a9b8e 0%, #6a8a7d 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 8px 22px rgba(122, 155, 142, 0.28);
}

.leerstand-switch input:checked + .leerstand-slider::before {
  transform: translateX(20px);
}

.leerstand-switch-right {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.leerstand-switch-label {
  font-size: 14px;
  color: #6c757d;
  font-weight: 600;
}

.input-with-unit {
  position: relative;
}

.input-with-unit input {
  padding-right: 60px;
}

.unit {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
}

.hint-text {
  font-size: 13px;
  color: #6c757d;
  margin-top: 8px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-text i {
  width: 16px;
  height: 16px;
  color: #6c757d;
  flex-shrink: 0;
}

.buttons {
  display: flex;
  gap: 14px;
  margin-top: 48px;
}

.btn {
  padding: 17px 36px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.btn > .btn-icon,
.btn > .btn-spinner {
  position: relative;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #7a9b8e 0%, #6a8a7d 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(122, 155, 142, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(122, 155, 142, 0.4);
  transform: translateY(-3px);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: #495057;
  border: 2px solid #e9ecef;
  padding: 15px 34px;
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.btn-icon.spinning {
  animation: spin 0.7s linear infinite;
}

.btn-primary:hover .btn-icon {
  transform: translateX(4px);
}

.btn-secondary:hover .btn-icon {
  transform: translateX(-4px);
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.8;
  cursor: not-allowed;
}

.success-message {
  text-align: center;
  padding: 60px 30px;
}

.success-icon-large {
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, #7a9b8e 0%, #6a8a7d 100%);
  border-radius: 50%;
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(122, 155, 142, 0.4);
  animation: successPulse 2.5s ease-in-out infinite;
  position: relative;
}

.success-icon-large::after {
  content: '';
  position: absolute;
  inset: -12px;
  background: inherit;
  border-radius: 50%;
  opacity: 0.2;
  z-index: -1;
}

@keyframes successPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.success-icon-large i {
  width: 60px;
  height: 60px;
  color: white;
}

.success-message h2 {
  font-size: 34px;
  margin-bottom: 18px;
  color: #212529;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.success-message p {
  font-size: 17px;
  color: #6c757d;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-headline {
  margin-top: 48px;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.loading {
  display: none;
  text-align: center;
  padding: 36px 20px;
}

.loading.active {
  display: block;
}

.spinner {
  width: 54px;
  height: 54px;
  border: 5px solid #e9ecef;
  border-top: 5px solid #7a9b8e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading p {
  color: #6c757d;
  font-size: 16px;
  font-weight: 600;
}

.error-message {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
  border-left: 5px solid #dc3545;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  color: #721c24;
  font-size: 14px;
  line-height: 1.6;
}

.error-box {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
  border: 2px solid #dc3545;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #721c24;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

.error-box i {
  width: 20px;
  height: 20px;
  color: #dc3545;
  flex-shrink: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  body {
    padding: 0;
  }
  .container {
    min-width: 0;
    background-color: transparent;
    margin: 0;
    border: none;
    box-shadow: none;
    width: 100%;
    border-radius: 0;
  }
  .header {
    padding: 32px 24px 24px;
  }
  .content {
    padding: 0 24px 36px;
  }
  h1 {
    font-size: 24px;
  }
  .steps-nav {
    padding: 0 10px;
  }
  .steps-nav::before {
    left: 40px;
    right: 40px;
    top: 16px;
  }
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-width: 2px;
  }
  .step-tab.active .step-number {
    transform: scale(1.05);
  }
  .step-label {
    font-size: 10px;
    max-width: 70px;
  }
  .form-row.two-cols {
    grid-template-columns: 1fr;
  }
  .buttons {
    flex-direction: column-reverse;
    gap: 12px;
  }
  .btn {
    width: 100%;
  }
  .wohnung-item {
    padding: 20px;
  }
  .analysis-cards {
    grid-template-columns: 1fr;
  }
}
