/* Contact Form Validation Styles */

/* Error message styling */
.error-message {
  display: none;
  color: #e74c3c;
  font-size: 0.85em;
  margin-top: 5px;
  margin-bottom: 10px;
  font-weight: 500;
}

/* Input field error state */
input.error,
textarea.error {
  border-color: #e74c3c !important;
  background-color: rgba(231, 76, 60, 0.05);
}

input.error:focus,
textarea.error:focus {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}

/* Form message container */
.form-message {
  display: none;
  padding: 1em 1.5em;
  margin-bottom: 1.5em;
  border-radius: 4px;
  font-size: 0.95em;
  line-height: 1.6;
}

/* Success message */
.form-message.success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.form-message.success strong {
  color: #155724;
}

/* Error message */
.form-message.error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.form-message.error strong {
  color: #721c24;
}

/* Required field indicator */
input[required]::placeholder,
textarea[required]::placeholder {
  opacity: 0.8;
}

/* Disabled submit button */
input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading state for submit button */
input[type="submit"]:disabled:after {
  content: "...";
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}

/* Validation feedback icons (optional) */
.input-wrapper {
  position: relative;
}

.validation-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  display: none;
}

.validation-icon.valid {
  color: #28a745;
  display: block;
}

.validation-icon.invalid {
  color: #e74c3c;
  display: block;
}

/* Responsive adjustments */
@media screen and (max-width: 736px) {
  .form-message {
    padding: 0.8em 1em;
    font-size: 0.9em;
  }

  .error-message {
    font-size: 0.8em;
  }
}

/* Smooth transitions */
input,
textarea {
  transition: border-color 0.3s ease, background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.error-message,
.form-message {
  animation: slideDown 0.3s ease;
}

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

/* Focus improvements */
input:focus,
textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* Character counter (optional) */
.char-counter {
  text-align: right;
  font-size: 0.8em;
  color: #666;
  margin-top: 5px;
}

.char-counter.warning {
  color: #ff9800;
}

.char-counter.error {
  color: #e74c3c;
}

/* Turnstile widget */
.cf-turnstile {
  margin-bottom: 10px;
}

#turnstile-error {
  display: none;
  color: #e74c3c;
  font-size: 0.85em;
  margin-top: 5px;
  font-weight: 500;
}

/* Success Message Container */
.success-message-box {
  text-align: center;
  padding: 40px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #4caf50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.success-message-box h3 {
  color: #333;
  font-size: 1.8em;
  font-weight: 600;
}

.success-message-box p {
  color: #666;
  font-size: 1.1em;
  line-height: 1.6;
}

.success-message-box .actions {
  margin-top: 30px;
  justify-content: center;
}

#success-container {
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
