/* BBVivax Gerüst-Rechner - Wizard Interface */

/* ======================
   MAIN WRAPPER
   ====================== */
#bbv-wrap {
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid #E6E9EE;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(16, 24, 40, 0.08);
  padding: 30px;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#bbv-wrap h3 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  color: #1a1a1a;
}

#bbv-wrap .muted {
  color: #60656f;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ======================
   STEP NAVIGATION
   ====================== */
.bbv-steps-nav {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  padding-bottom: 24px;
  border-bottom: 2px solid #f0f0f0;
}

.bbv-step-pill {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  background: #F9FAFB;
  font-size: 14px;
  font-weight: 600;
  color: #9CA3AF;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbv-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E5E7EB;
  color: #9CA3AF;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.3s ease;
}

.bbv-step-pill.active {
  border-color: #EC0808;
  background: #FEF2F2;
  color: #1a1a1a;
}

.bbv-step-pill.active .bbv-step-num {
  background: #EC0808;
  color: #fff;
}

.bbv-step-pill.done {
  border-color: #10B981;
  background: #ECFDF5;
  color: #065F46;
}

.bbv-step-pill.done .bbv-step-num {
  background: #10B981;
  color: #fff;
}

.bbv-step-pill.done .bbv-step-num::before {
  content: "✓";
}

/* ======================
   LAYOUT
   ====================== */
.bbv-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

.bbv-left {
  min-height: 400px;
}

.bbv-right {
  position: sticky;
  top: 20px;
  align-self: start;
}

/* ======================
   STEPS CONTENT
   ====================== */
.bbv-step {
  display: none;
}

.bbv-step.bbv-step-active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

/* ======================
   FORM ELEMENTS
   ====================== */
.bbv-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

#bbv-wrap label {
  font-size: 14px;
  color: #1a1a1a;
  font-weight: 600;
  display: block;
  margin: 0 0 6px;
}

#bbv-wrap input[type="number"],
#bbv-wrap input[type="text"],
#bbv-wrap input[type="email"],
#bbv-wrap input[type="tel"],
#bbv-wrap select,
#bbv-wrap textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #E6E9EE;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

/* Стилизация select для визуального указания выпадающего списка */
#bbv-wrap select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23475569' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 45px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
}

#bbv-wrap select:hover {
  border-color: #D1D5DB;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23EC0808' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}

#bbv-wrap select:focus {
  border-color: #EC0808;
  box-shadow: 0 0 0 3px rgba(236, 8, 8, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23EC0808' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}

#bbv-wrap input:focus,
#bbv-wrap select:focus,
#bbv-wrap textarea:focus {
  outline: none;
  border-color: #EC0808;
}

#bbv-wrap textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

/* ======================
   TOGGLE CARDS
   ====================== */
.bbv-toggle-group {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.bbv-toggle-card {
  flex: 1;
  cursor: pointer;
  border: 2px solid #E6E9EE;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F9FAFB;
  transition: all 0.2s ease;
}

.bbv-toggle-card:hover {
  border-color: #D1D5DB;
  transform: translateY(-2px);
}

.bbv-toggle-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.bbv-toggle-card span {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.bbv-toggle-card.bbv-active {
  border-color: #EC0808;
  background: #FEF2F2;
  box-shadow: 0 0 0 1px #EC0808;
}

.bbv-toggle-card.bbv-active span {
  color: #1a1a1a;
}

/* ======================
   SIDE CARDS (Seiten)
   ====================== */
#bbv-sides-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.bbv-side-card {
  cursor: pointer;
  border: 2px solid #E6E9EE;
  border-radius: 10px;
  padding: 0;
  text-align: center;
  background: #F9FAFB;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  overflow: hidden;
}

.bbv-side-card:hover {
  border-color: #D1D5DB;
  transform: translateY(-2px);
}

.bbv-side-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.bbv-side-card.bbv-active {
  border-color: #EC0808;
  background: #FEF2F2;
  box-shadow: 0 0 0 1px #EC0808;
}

/* ======================
   RADIO PILLS
   ====================== */
.bbv-radio-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.bbv-radio-pill {
  border: 2px solid #E5E7EB;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  transition: all 0.2s ease;
  font-weight: 500;
}

.bbv-radio-pill:hover {
  border-color: #D1D5DB;
}

.bbv-radio-pill input[type="radio"] {
  margin: 0;
  width: auto;
}

.bbv-radio-pill.bbv-active {
  border-color: #EC0808;
  background: #FEF2F2;
  color: #1a1a1a;
  font-weight: 600;
}

/* ======================
   BUTTONS
   ====================== */
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

#bbv-wrap .btn {
  background: #EC0808;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#bbv-wrap .btn:hover {
  background: #D10707;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236, 8, 8, 0.3);
}

#bbv-wrap .btn:active {
  transform: translateY(0);
}

#bbv-wrap .btn.secondary {
  background: #6B7280;
}

#bbv-wrap .btn.secondary:hover {
  background: #4B5563;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

#bbv-wrap .btn:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
  transform: none;
}

#bbv-wrap .chip {
  border: 1px solid #E6E9EE;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  background: #F5F7FA;
  color: #475062;
  font-weight: 500;
}

/* ======================
   HOUSE IMAGE
   ====================== */
.bbv-house-wrap {
  margin: 20px 0;
  text-align: center;
  padding: 20px;
  background: #F9FAFB;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
}

.bbv-house-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: inline-block;
}

/* ======================
   RESULTS OUTPUT
   ====================== */
#bbv-out {
  display: block;
  margin-top: 20px;
  border: 2px solid #E6E9EE;
  border-radius: 12px;
  padding: 20px;
  background: #fff;
}

#bbv-out table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

#bbv-out th,
#bbv-out td {
  padding: 12px;
  border-bottom: 1px solid #eef1f5;
  text-align: left;
  font-size: 14px;
}

#bbv-out th {
  font-weight: 700;
  color: #1a1a1a;
}

#bbv-out tfoot th {
  font-size: 16px;
  color: #EC0808;
}

/* ======================
   NOTES & MESSAGES
   ====================== */
.bbv-note {
  font-size: 13px;
  color: #60656f;
  margin-top: 6px;
  line-height: 1.5;
}

#bbv-notes {
  font-size: 12px;
  color: #6B7280;
  line-height: 1.6;
  margin-top: 8px;
}

/* ======================
   FORM SECTION
   ====================== */
.bbv-form-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #E5E7EB;
}

.bbv-form-section h4 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

/* ======================
   SUMMARY BOX
   ====================== */
.bbv-summary-box {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.bbv-summary-box h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.bbv-summary-box .bbv-price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #E5E7EB;
}

.bbv-summary-box .bbv-price-label {
  font-size: 14px;
  color: #6B7280;
}

.bbv-summary-box .bbv-price-value {
  font-size: 28px;
  font-weight: 800;
  color: #EC0808;
}

/* ======================
   ERROR STATES
   ====================== */
.bbv-error {
  border-color: #EF4444 !important;
  background: #FEF2F2 !important;
}

.bbv-error-message {
  color: #EF4444;
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

input.bbv-error + .bbv-error-message,
select.bbv-error + .bbv-error-message {
  display: block;
}

/* ======================
   SUCCESS MESSAGE
   ====================== */
.bbv-success-message {
  background: #ECFDF5;
  border: 2px solid #10B981;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.bbv-success-message h3 {
  color: #065F46;
  margin: 0 0 8px;
}

.bbv-success-message p {
  color: #047857;
  margin: 0;
}

/* ======================
   LOADING STATE
   ====================== */
.bbv-loading {
  text-align: center;
  padding: 40px;
}

.bbv-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #EC0808;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ======================
   RESPONSIVE
   ====================== */
@media (max-width: 900px) {
  .bbv-main {
    grid-template-columns: 1fr;
  }

  .bbv-right {
    position: static;
    order: -1;
  }

  .bbv-house-wrap {
    margin: 10px 0;
  }
}

@media (max-width: 720px) {
  #bbv-wrap {
    padding: 20px;
  }

  /* Убираем рамку контейнера итогов на мобилках */
  #bbv-out {
    border: none;
    padding: 0;
    background: transparent;
  }

  .bbv-grid-2 {
    grid-template-columns: 1fr;
  }

  .bbv-steps-nav {
    flex-direction: column;
    gap: 8px;
  }

  .bbv-step-pill {
    padding: 10px 14px;
    font-size: 13px;
  }

  .bbv-toggle-group {
    flex-direction: column;
  }

  #bbv-sides-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .bbv-radio-row {
    flex-direction: column;
    align-items: stretch;
  }

  .bbv-radio-pill {
    justify-content: center;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  #bbv-wrap .btn {
    width: 100%;
    justify-content: center;
  }

  #bbv-wrap h3 {
    font-size: 22px;
  }

  .bbv-summary-box .bbv-price-value {
    font-size: 24px;
  }

  /* Таблица итогов: мобильное отображение карточками */
  #bbv-out table,
  #bbv-out tbody,
  #bbv-out tfoot,
  #bbv-out tr {
    display: block;
    width: 100%;
  }

  /* Скрываем шапку на мобилке */
  #bbv-out thead {
    display: none;
  }

  /* Строки-«карточки» */
  #bbv-out tbody tr {
    border: 1px solid #eef1f5;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
  }

  /* Ячейки позиции/цены в столбик с подписями */
  #bbv-out tbody td {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: none;
    font-size: 14px;
  }

  #bbv-out tbody td:first-child::before {
    content: 'Position';
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
  }

  #bbv-out tbody td:last-child::before {
    content: 'Preis';
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
  }

  #bbv-out tbody td:last-child {
    font-weight: 700;
    color: #EC0808;
  }

  /* Итоговый блок (tfoot) */
  #bbv-out tfoot tr {
    border: 1px solid #eef1f5;
    border-radius: 12px;
    margin-top: 8px;
    overflow: hidden;
    background: #f5f7fa;
    display: block;
    width: 100%;
  }

  #bbv-out tfoot th {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: #EC0808;
  }

  #bbv-out tfoot th:last-child {
    font-size: 20px;
    font-weight: 800;
    text-align: right;
    padding-top: 0;
  }

  #bbv-out tfoot td {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: none;
    font-size: 13px;
    color: #6B7280;
    background: #fff;
  }
}

/* ======================
   FILE UPLOAD
   ====================== */
.bbv-file-upload-area {
  position: relative;
  border: 2px dashed #E6E9EE;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #F9FAFB;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.bbv-file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
  display: block;
}

.bbv-file-upload-placeholder {
  pointer-events: none;
}

.bbv-file-upload-area:hover {
  border-color: #EC0808;
  background: #FEF2F2;
}

.bbv-file-upload-area.bbv-drag-over {
  border-color: #EC0808;
  background: #FEF2F2;
  transform: scale(1.02);
}

.bbv-file-upload-placeholder {
  pointer-events: none;
}

.bbv-file-upload-placeholder svg {
  color: #9CA3AF;
  margin-bottom: 8px;
}

.bbv-file-list {
  width: 100%;
  margin-top: 16px;
  box-sizing: border-box;
}

  .bbv-file-item {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
  }

.bbv-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #fff;
  border: 1px solid #E6E9EE;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  cursor: default;
}

.bbv-file-item:hover {
  border-color: #D1D5DB;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bbv-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.bbv-file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.bbv-file-details {
  flex: 1;
  min-width: 0;
}

.bbv-file-name {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 14px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bbv-file-size {
  font-size: 12px;
  color: #60656f;
  margin-top: 2px;
}

.bbv-file-remove {
  background: none;
  border: none;
  color: #EF4444;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}

.bbv-file-remove:hover {
  background: #FEE2E2;
  color: #DC2626;
}

.bbv-file-remove:active {
  transform: scale(0.95);
}

.bbv-success-message {
  text-align: center;
  padding: 40px 20px;
  background: #ECFDF5;
  border: 2px solid #10B981;
  border-radius: 8px;
}

.bbv-success-message h3 {
  color: #065F46;
  font-size: 24px;
  margin: 0 0 12px;
}

.bbv-success-message p {
  color: #047857;
  margin: 0;
}

@media (max-width: 480px) {
  #bbv-wrap {
    padding: 15px;
    border-radius: 8px;
  }
  
  .bbv-file-upload-area {
    padding: 16px;
    min-height: 120px;
  }
  
  .bbv-file-item {
    padding: 10px;
  }
  
  .bbv-file-name {
    font-size: 13px;
  }

  .bbv-toggle-card img {
    width: 50px;
    height: 50px;
  }

  .bbv-toggle-card span {
    font-size: 13px;
  }

  #bbv-sides-cards {
    gap: 6px;
  }
}

/* ======================
   ACCESSIBILITY
   ====================== */
*:focus-visible {
  outline: 2px solid #EC0808;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ======================
   FORM BLOCKS (Step 4)
   ====================== */
.bbv-form-block {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #E6E9EE;
}

.bbv-form-block:last-child {
  border-bottom: none;
}

.bbv-form-block h5 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Radio Group (Customer Type) */
.bbv-radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bbv-radio-label {
  flex: 1;
  min-width: 150px;
  padding: 14px 20px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  background: #F9FAFB;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: #374151;
}

.bbv-radio-label:hover {
  border-color: #EC0808;
  background: #fff;
}

.bbv-radio-label input[type="radio"] {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: #EC0808;
  cursor: pointer;
}

.bbv-radio-label input[type="radio"]:checked + span,
.bbv-radio-label:has(input[type="radio"]:checked) {
  border-color: #EC0808;
  background: #FEF2F2;
  color: #EC0808;
  font-weight: 600;
}

/* Checkbox Group (DSGVO) */
.bbv-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bbv-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.bbv-checkbox-label:hover {
  background: #F9FAFB;
}

.bbv-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: #EC0808;
  cursor: pointer;
  flex-shrink: 0;
}

.bbv-checkbox-label span {
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.bbv-checkbox-label a {
  color: #EC0808;
  text-decoration: underline;
}

.bbv-checkbox-label a:hover {
  text-decoration: none;
}

/* Tooltip Icon */
.bbv-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #E5E7EB;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.bbv-tooltip-icon:hover {
  background: #EC0808;
  color: #fff;
}

.bbv-tooltip-icon svg {
  width: 18px;
  height: 18px;
}

/* Tooltip Popup */
.bbv-tooltip-popup {
  position: fixed;
  background: #1F2937;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  pointer-events: none;
}

.bbv-tooltip-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 10px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #1F2937;
}

/* B2B Fields conditional display */
.bbv-b2b-field {
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* Mobile adjustments for form blocks */
@media (max-width: 720px) {
  .bbv-form-block {
    margin-bottom: 24px;
    padding-bottom: 20px;
  }
  
  .bbv-radio-group {
    flex-direction: column;
  }
  
  .bbv-radio-label {
    min-width: unset;
  }
}

