/**
 * Contact Form Styles - Dark Theme
 *
 * @package TerryArthur
 * @since 1.0.0
 */

/* Container */
.ta-contact-form-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.ta-contact-form-container.visible {
  display: block;
  animation: fadeIn 0.3s ease-in-out forwards;
}

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

/* Hide default title (we have one in the section) */
.ta-contact-form-title {
  display: none;
}

/* Form */
.ta-contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Honeypot Field - Hidden */
.ta-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Full width fields */
.form-group:has(#ta-message),
.form-group-checkbox,
.form-group-submit,
.form-response {
  grid-column: 1 / -1;
}

/* Labels */
.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f9fafb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Remove ALL pseudo-elements from ALL labels */
.form-group label::after,
.form-group label::before {
  content: none !important;
  display: none !important;
}

.form-group label .required {
  color: #ef4444;
}

/* Form Controls */
.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  color: #f9fafb !important;
  background: #374151 !important;
  background-color: #374151 !important;
  border: 1px solid #4b5563 !important;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  font-family: 'Inter', sans-serif;
}

/* Hide browser default required indicator */
.form-control:required {
  box-shadow: none;
}

.form-control::after {
  content: none !important;
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-control:hover {
  border-color: #6b7280;
}

.form-control:focus {
  outline: none;
  border-color: #9ca3af !important;
  background: #4b5563 !important;
  background-color: #4b5563 !important;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

.form-control:disabled {
  background: #1f2937;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 120px;
  background: #374151 !important;
  background-color: #374151 !important;
  color: #f9fafb !important;
}

/* Checkbox */
.checkbox-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
  cursor: pointer;
}

.checkbox-label br {
  display: none !important;
}

.checkbox-label input[type="checkbox"] {
  width: 1.125rem !important;
  height: 1.125rem !important;
  margin: 0.1875rem 0 0 0 !important;
  background: #374151 !important;
  border: 1px solid #4b5563 !important;
  border-radius: 0.25rem !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  accent-color: #6b7280 !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
}

.checkbox-label input[type="checkbox"]:checked {
  background: #6b7280 !important;
  border-color: #6b7280 !important;
}

.checkbox-label > span {
  font-size: 0.875rem !important;
  color: #f9fafb !important;
  line-height: 1.375rem !important;
  margin: 0 !important;
}

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

.checkbox-label a:hover {
  color: #ffffff;
}

/* Error Messages */
.error-message {
  font-size: 0.8125rem;
  color: #ef4444;
  font-weight: 500;
  display: none;
}

.error-message:not(:empty) {
  display: block;
}

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

.form-control.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Submit Button - Match CTA Style */
.form-group-submit {
  padding-top: 0.5rem;
}

.ta-submit-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 1.5rem 4rem !important;
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  line-height: 1.25rem !important;
  font-family: 'Quicksand', sans-serif !important;
  color: #202124 !important;
  background-color: #6b7280 !important;
  border: 1px solid transparent !important;
  border-radius: 0.5rem !important;
  cursor: pointer !important;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  width: auto !important;
  max-width: none !important;
}

.ta-submit-button br {
  display: none !important;
}

.ta-submit-button .button-text {
  display: inline !important;
  line-height: 1.25rem !important;
}

.ta-submit-button:hover {
  background-color: #9ca3af !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.ta-submit-button:focus-visible {
  outline: 2px solid #6b7280 !important;
  outline-offset: 2px !important;
}

.ta-submit-button:disabled {
  background-color: #4b5563 !important;
  cursor: not-allowed !important;
  opacity: 0.5 !important;
}

.ta-submit-button .spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid #202124;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.ta-submit-button.loading .button-text {
  display: none;
}

.ta-submit-button.loading .spinner {
  display: block;
}

/* Form Response Messages */
.form-response {
  display: none;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  margin-top: 0.5rem;
}

.form-response:not(:empty) {
  display: block;
}

.form-response.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-response.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Loading State */
.ta-contact-form.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Responsive - Stack on mobile */
@media (max-width: 768px) {
  .ta-contact-form {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-control {
    padding: 0.75rem 0.875rem;
    font-size: 0.9375rem;
  }

  textarea.form-control {
    min-height: 100px;
  }

  .ta-submit-button {
    max-width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .ta-contact-form-container {
    max-width: 700px;
  }
}
