/**
 * Стили квиза "Смета за 1 минуту"
 * Современный дизайн в стиле сайта
 */

#quiz-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.quiz-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.quiz-modal {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  max-width: 600px;
  width: 100%;
  max-height: 95vh;
  overflow: visible;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.quiz-header {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.quiz-title {
  color: white;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quiz-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quiz-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.quiz-progress {
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  margin-right: 0;
}

.quiz-progress-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.quiz-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.quiz-step-indicator {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-content {
  padding: 32px 24px;
  min-height: 500px;
  max-height: 70vh;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quiz-step-title {
  color: white;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  text-align: center;
}

.quiz-step-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  margin: 0 0 32px 0;
  text-align: center;
  line-height: 1.5;
}

.quiz-options {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.quiz-option {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.quiz-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.quiz-option.selected {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-color: #3b82f6;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.quiz-option-image {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.quiz-option-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quiz-option-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.quiz-option-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.quiz-option-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0;
  line-height: 1.4;
}

.quiz-input-container {
  margin-bottom: 24px;
}

.quiz-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.quiz-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.quiz-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.quiz-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin: 8px 0 0 0;
  text-align: center;
}

.custom-size-input {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-size-input .quiz-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.custom-size-input .quiz-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-size-input .quiz-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Стили для поздравления */
.congratulations-container {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 24px;
}

.congratulations-banner {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  margin-bottom: 24px;
  color: white;
}

.congratulations-banner .congratulations-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.congratulations-banner .congratulations-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: white;
}

.congratulations-banner .congratulations-subtitle {
  font-size: 14px;
  margin: 0;
  opacity: 0.9;
  color: white;
}

.congratulations-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

.congratulations-title {
  color: white;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.congratulations-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.congratulations-benefits {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.benefit-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.benefit-icon {
  font-size: 24px;
}

.benefit-item span:last-child {
  color: white;
  font-size: 16px;
  font-weight: 500;
}


@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Стили для мобильных кнопок */
.mobile-cta {
  max-width: 600px;
  margin: 0 auto;
}

.mobile-cta .flex {
  display: flex;
  gap: 8px;
}

.mobile-cta a {
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* На больших экранах ограничиваем ширину кнопок */
@media (min-width: 640px) {
  .mobile-cta {
    max-width: 400px;
  }
  
  .mobile-cta a {
    font-size: 14px;
    padding: 12px 16px;
  }
}

/* Улучшения для больших экранов */
@media (min-width: 1024px) {
  .quiz-modal {
    max-height: 90vh;
  }
  
  .quiz-content {
    max-height: 60vh;
  }
  
  .quiz-overlay {
    padding: 40px;
  }
}

.quiz-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-label {
  color: white;
  font-size: 16px;
  font-weight: 600;
}

.quiz-textarea {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
}

.quiz-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.quiz-radio-group {
  display: flex;
  gap: 20px;
}

.quiz-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.quiz-radio input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #3b82f6;
}

.quiz-radio-text {
  color: white;
  font-size: 16px;
}

.quiz-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.quiz-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #3b82f6;
  margin-top: 2px;
  flex-shrink: 0;
}

.quiz-checkbox-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.5;
}

.quiz-checkbox-text a {
  color: #3b82f6;
  text-decoration: none;
}

.quiz-checkbox-text a:hover {
  text-decoration: underline;
}

.quiz-navigation {
  padding: 24px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  min-height: 80px;
  position: relative;
}

.quiz-btn {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  flex: 1;
  max-width: 200px;
  box-sizing: border-box;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.quiz-btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.quiz-btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.quiz-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.quiz-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

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

.quiz-success,
.quiz-error {
  text-align: center;
  padding: 40px 20px;
}

.quiz-success-icon,
.quiz-error-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.quiz-success-title,
.quiz-error-title {
  color: white;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.quiz-success-text,
.quiz-error-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 32px 0;
}

.quiz-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.quiz-benefit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.quiz-benefit-icon {
  font-size: 24px;
}

.quiz-benefit span:last-child {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* Мобильные стили */
@media (max-width: 768px) {
  .quiz-modal {
    margin: 10px;
    max-height: 95vh;
  }
  
  /* Исправляем размеры мобильных кнопок */
  #ctaSticky .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  #ctaSticky a {
    width: 100%;
    min-width: 0;
    flex: 1;
  }
  
  .quiz-header {
    padding: 16px 20px;
  }
  
  .quiz-title {
    font-size: 20px;
  }
  
  .quiz-content {
    padding: 24px 20px;
  }
  
  .quiz-step-title {
    font-size: 24px;
  }
  
  .quiz-option {
    padding: 16px;
  }
  
  .quiz-option-image {
    width: 60px;
    height: 45px;
  }
  
  .quiz-option-title {
    font-size: 16px;
  }
  
  .quiz-option-description {
    font-size: 13px;
  }
  
  .quiz-navigation {
    padding: 20px;
    flex-direction: row;
    gap: 16px;
    justify-content: space-between;
  }
  
  .quiz-btn {
    min-width: 120px;
    flex: 1;
  }
  
  .quiz-benefits {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .quiz-radio-group {
    flex-direction: column;
    gap: 12px;
  }
}

/* Анимации */
@keyframes quizFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.quiz-modal {
  animation: quizFadeIn 0.3s ease-out;
}

/* Скроллбар */
.quiz-content::-webkit-scrollbar {
  width: 6px;
}

.quiz-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.quiz-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.quiz-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Адаптивность */
@media (max-width: 768px) {
  .quiz-modal {
    margin: 20px;
    max-width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
  }
  
  .quiz-content {
    padding: 24px 20px;
    min-height: 400px;
  }
  
  .quiz-step-title {
    font-size: 24px;
  }
  
  .quiz-step-subtitle {
    font-size: 16px;
  }
  
  .quiz-option {
    padding: 16px;
  }
  
  .quiz-option-title {
    font-size: 16px;
  }
  
  .quiz-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .quiz-button {
    width: 100%;
  }
  
  .quiz-progress-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .quiz-step-indicator {
    font-size: 11px;
    padding: 3px 6px;
    text-align: center;
  }
}
