/* Bluestream Entertainment - Form Styles
   Modern Form Styling with Brevo Integration
   Created 2025
*/

/* Form Container */
.form-container {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  max-width: 600px;
  margin: 0 auto;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group label .required {
  color: var(--error);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: all var(--transition-fast);
  background-color: var(--gray-50);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: white;
}

.form-control.invalid {
  border-color: var(--error);
  background-color: rgba(239, 68, 68, 0.05);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Checkbox and Radio Styles */
.checkbox-group, .radio-group {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
  margin-top: 0.3rem;
  margin-right: var(--spacing-sm);
}

.checkbox-group label,
.radio-group label {
  margin-bottom: 0;
  font-weight: 400;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

/* Form Buttons */
.form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

/* Form Messages */
.form-message {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-md);
  display: flex;
  align-items: center;
}

.form-message i {
  margin-right: var(--spacing-sm);
  font-size: 1.25rem;
}

.form-message.success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.form-message.error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

.form-message.info {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 5px;
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: -0.625rem;
  margin-left: -0.625rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Brevo Specific Styles */
.brevo-form {
  position: relative;
}

.brevo-form-success {
  display: none;
  color: var(--success);
  text-align: center;
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  background-color: rgba(16, 185, 129, 0.1);
}

.brevo-form-error {
  display: none;
  color: var(--error);
  text-align: center;
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  background-color: rgba(239, 68, 68, 0.1);
}

/* Newsletter Form */
.newsletter-form {
  display: flex;
  gap: var(--spacing-sm);
  max-width: 500px;
}

.newsletter-form .form-control {
  flex: 1;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
}

.newsletter-form .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Date Picker Styling */
input[type="date"].form-control {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

/* File Upload Styling */
.file-upload {
  position: relative;
}

.file-upload input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  background-color: var(--gray-50);
  color: var(--gray-600);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.file-upload-label:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.file-upload-label i {
  margin-right: var(--spacing-sm);
}

.file-name {
  margin-top: var(--spacing-sm);
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* GDPR Consent */
.gdpr-consent {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background-color: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.gdpr-consent a {
  text-decoration: underline;
}

/* Responsive Form Styles */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-buttons {
    flex-direction: column;
  }
  
  .form-buttons .btn {
    width: 100%;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-form .form-control {
    border-radius: var(--radius-md);
    border-right: 1px solid var(--gray-300);
  }
  
  .newsletter-form .btn {
    border-radius: var(--radius-md);
    width: 100%;
  }
}