/* Scoped styles for embedded custom forms - only affects .custom-form container */

.custom-form {
  box-sizing: border-box;
}

.custom-form *,
.custom-form *::before,
.custom-form *::after {
  box-sizing: border-box;
}

/* Custom Form Styles */
.custom-form {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  margin: 0 auto; /* Center the form */
}

.custom-form .form-header {
  /* Background color will be set by custom styles */
  padding: 2rem;
}

.custom-form .form-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.custom-form .form-description {
  opacity: 0.9;
  font-size: 1rem;
  margin: 0;
}

.custom-form .form-content {
  padding: 2rem;
}

.custom-form .form-question {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e2e8f0;
}

.custom-form .form-question:last-of-type {
  border-bottom: none;
}

.custom-form .question-label {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.custom-form .required {
  color: #e53e3e;
  margin-left: 0.25rem;
}

.custom-form .question-description {
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Input Styles */
.custom-form .text-input,
.custom-form .textarea-input,
.custom-form .select-input,
.custom-form .date-input,
.custom-form .time-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.custom-form .text-input:focus,
.custom-form .textarea-input:focus,
.custom-form .select-input:focus,
.custom-form .date-input:focus,
.custom-form .time-input:focus {
  outline: none;
  border-color: #667eea;
}

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

/* Radio and Checkbox Groups */
.custom-form .radio-group,
.custom-form .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.custom-form .radio-option,
.custom-form .checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.custom-form .radio-option:hover,
.custom-form .checkbox-option:hover {
  border-color: #667eea;
  background: #f7fafc;
}

.custom-form .radio-option input,
.custom-form .checkbox-option input {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

/* Linear Scale */
.custom-form .linear-scale {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.custom-form .scale-label {
  font-size: 0.9rem;
  color: #718096;
  font-weight: 500;
}

.custom-form .scale-options {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.custom-form .scale-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.custom-form .scale-option input {
  cursor: pointer;
  width: 20px;
  height: 20px;
  margin-bottom: 0.25rem;
}

.custom-form .scale-number {
  font-size: 0.9rem;
  color: #718096;
  font-weight: 600;
}

/* Rating Styles */
.custom-form .rating-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.custom-form .rating-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.custom-form .rating-option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.custom-form .rating-icon {
  font-size: 2rem;
  transition: all 0.2s;
  opacity: 0.3;
  filter: grayscale(100%);
}

.custom-form .rating-option:hover .rating-icon {
  opacity: 0.7;
  filter: grayscale(0%);
  transform: scale(1.1);
}

.custom-form .rating-option input:checked ~ .rating-icon {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.2);
}

.custom-form .rating-value {
  font-size: 0.85rem;
  color: #718096;
  margin-top: 0.25rem;
}

/* Email Copy Section */
.custom-form .form-email-copy {
  margin: 1.5rem 0;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.custom-form .form-email-copy .checkbox-option {
  border: none;
  padding: 0;
}

.custom-form .form-email-copy .checkbox-option:hover {
  background: transparent;
  border: none;
}

/* Form Actions */
.custom-form .form-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 1rem;
}

.custom-form .submit-btn,
.custom-form .submit-another-btn {
  padding: 0.875rem 2.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.custom-form .submit-btn:hover,
.custom-form .submit-another-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.custom-form .submit-btn:active,
.custom-form .submit-another-btn:active {
  transform: translateY(0);
}

/* Success Message */
.custom-form .form-success {
  padding: 3rem 2rem;
  text-align: center;
}

.custom-form .form-success h2 {
  color: #2d3748;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.custom-form .form-success p {
  color: #718096;
  margin-bottom: 2rem;
}

/* Error Message */
.custom-form .error {
  background: #fed7d7;
  color: #c53030;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #e53e3e;
}

/* Unsupported Message */
.custom-form .unsupported {
  color: #718096;
  font-style: italic;
}

/* Loading State */
.custom-form .loading {
  text-align: center;
  padding: 2rem;
  color: #718096;
}

.custom-form .loading::after {
  content: '...';
  animation: custom-form-dots 1.5s steps(4, end) infinite;
}

@keyframes custom-form-dots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Responsive */
@media (max-width: 768px) {
  .custom-form .form-header {
    padding: 1.5rem;
  }

  .custom-form .form-title {
    font-size: 1.5rem;
  }

  .custom-form .form-content {
    padding: 1.5rem;
  }

  .custom-form .linear-scale {
    flex-direction: column;
    align-items: flex-start;
  }

  .custom-form .scale-options {
    width: 100%;
  }
}
