/* === ROOF CONFIGURATOR: Modal-App, full-screen mit Blur dahinter === */

#tf-configurator {
  position: fixed;
  inset: 0;
  z-index: 999990;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  transition: opacity 0.4s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}
#tf-configurator.tf-cfg-active {
  display: flex;
  opacity: 1;
}
body.tf-cfg-open {
  overflow: hidden;
}

.tf-cfg-modal {
  background: #0a0a0c;
  color: #fff;
  border-radius: 28px;
  width: 100%;
  max-width: 1320px;
  max-height: calc(100vh - 32px);
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: scale(0.97);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
#tf-configurator.tf-cfg-active .tf-cfg-modal {
  transform: scale(1);
}

/* Header / Progress */
.tf-cfg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  gap: 16px;
}
.tf-cfg-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.tf-cfg-brand img {
  height: 32px;
  width: auto;
}
.tf-cfg-progress {
  flex: 1;
  display: flex;
  gap: 6px;
  max-width: 360px;
  margin: 0 24px;
}
.tf-cfg-progress-step {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background 0.3s ease;
}
.tf-cfg-progress-step.active {
  background: var(--tf-red, #E63946);
}
.tf-cfg-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.tf-cfg-close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

/* Body / Steps — content centered */
.tf-cfg-body {
  flex: 1;
  overflow-y: auto;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tf-cfg-step {
  display: none;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  animation: tf-cfg-step-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.tf-cfg-step.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tf-cfg-step h2,
.tf-cfg-step p {
  text-align: center;
  width: 100%;
}
.tf-cfg-input,
.tf-cfg-form {
  width: 100%;
  max-width: 480px;
}
/* Map-Step: volle Breite */
.tf-cfg-step[data-step="2"] {
  max-width: 100%;
}
.tf-cfg-step[data-step="2"] .tf-cfg-map {
  max-width: 100%;
}
@keyframes tf-cfg-step-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tf-cfg-step h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
  color: #fff;
}
.tf-cfg-step p {
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
}

/* Inputs */
.tf-cfg-input,
.tf-cfg-input-wrap {
  position: relative;
}
.tf-cfg-input input,
.tf-cfg-form input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}
.tf-cfg-input input:focus,
.tf-cfg-form input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--tf-red, #E63946);
}
.tf-cfg-input input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Address autocomplete dropdown */
.tf-cfg-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: #1a1a20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 5;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.tf-cfg-suggestions::-webkit-scrollbar { width: 6px; }
.tf-cfg-suggestions::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.tf-cfg-suggestions.show { display: block; }
.tf-cfg-suggestion {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}
.tf-cfg-suggestion:last-child { border-bottom: none; }
.tf-cfg-suggestion:hover {
  background: rgba(230, 57, 70, 0.15);
  color: #fff;
}

/* Map */
.tf-cfg-map {
  width: 100%;
  height: 560px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1a1a20;
}
/* Analyze This Area Button */
.tf-cfg-analyze-btn {
  background: #E63946;
  color: #fff;
  border: 2px solid #E63946;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  box-shadow: 0 8px 18px rgba(0,0,0,0.3);
  transition: all 0.2s;
}
.tf-cfg-analyze-btn:hover {
  background: #C9202F;
  border-color: #C9202F;
  transform: translateY(-1px);
}

/* Building Polygons — selectable */
.tf-cfg-building-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 8px 16px;
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  letter-spacing: 0.3px;
  pointer-events: none;
  display: none;
}
.tf-cfg-building-hint.show { display: block; }
.tf-cfg-map-info {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}
.tf-cfg-map-info strong { color: var(--tf-red); }

/* Material grid */
.tf-cfg-materials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.tf-cfg-material {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: left;
  color: #fff;
  font-family: inherit;
  display: flex;
  flex-direction: column;
}
.tf-cfg-material:hover {
  border-color: rgba(230, 57, 70, 0.4);
  transform: translateY(-2px);
}
.tf-cfg-material.selected {
  border-color: var(--tf-red);
  background: rgba(230, 57, 70, 0.1);
}
.tf-cfg-material-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}
.tf-cfg-material-info {
  padding: 14px 16px;
}
.tf-cfg-material-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.tf-cfg-material-price {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* Form (Step 4) */
.tf-cfg-form {
  display: grid;
  gap: 14px;
  max-width: 480px;
}

/* Footer / Buttons */
.tf-cfg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
  flex-shrink: 0;
}
.tf-cfg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  border: 2px solid transparent;
  white-space: nowrap;
}
.tf-cfg-btn-primary {
  background: var(--tf-red);
  color: #fff;
  border-color: var(--tf-red);
}
.tf-cfg-btn-primary:hover {
  background: var(--tf-red-dark, #C9202F);
  border-color: var(--tf-red-dark, #C9202F);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(230, 57, 70, 0.4);
}
.tf-cfg-btn-primary:disabled {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.tf-cfg-btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}
.tf-cfg-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.32);
}

/* Step 5: Estimate */
.tf-cfg-estimate {
  text-align: center;
  padding: 24px 0;
}
.tf-cfg-estimate-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(230, 57, 70, 0.15);
  color: var(--tf-red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 18px;
}
.tf-cfg-estimate-range {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  margin: 12px 0;
  color: #fff;
}
.tf-cfg-estimate-range .tf-cfg-currency {
  color: var(--tf-red);
  font-weight: 600;
}
.tf-cfg-estimate-meta {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  margin-bottom: 24px;
}
.tf-cfg-estimate-summary {
  display: grid;
  gap: 8px;
  max-width: 380px;
  margin: 24px auto 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.tf-cfg-estimate-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.tf-cfg-estimate-row span:first-child {
  color: rgba(255, 255, 255, 0.5);
}
.tf-cfg-estimate-row span:last-child {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 720px) {
  #tf-configurator { padding: 0; }
  .tf-cfg-modal {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    max-width: 100%;
  }
  .tf-cfg-header { padding: 14px 18px; }
  .tf-cfg-progress { margin: 0 12px; }
  .tf-cfg-body { padding: 22px 20px; }
  .tf-cfg-footer { padding: 14px 18px; }
  .tf-cfg-step h2 { font-size: 22px; }
  .tf-cfg-map { height: 320px; }
  .tf-cfg-estimate-range { font-size: 40px; }
  .tf-cfg-btn { padding: 12px 18px; font-size: 13px; }
}
