/**
 * Contact Form Styles - Minimal, accessible, mobile-first
 * Works with existing Bootstrap/Portfolio styling
 */

/* Base form styling */
.contact-form {
  max-width: 100%;
  margin: 0;
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: #fff;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* Error states */
.contact-form input.error,
.contact-form textarea.error {
  border-color: #dc3545;
  background-color: #fff5f5;
}

.contact-form input.error:focus,
.contact-form textarea.error:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Field error messages */
.field-error {
  display: block;
  margin-top: 0.25rem;
  color: #dc3545;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Submit button */
.contact-form button[type="submit"] {
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin-top: 1rem;
}

.contact-form button[type="submit"]:hover:not(:disabled) {
  background-color: #0b5ed7;
  transform: translateY(-1px);
}

.contact-form button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

.contact-form button[type="submit"]:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
}

/* Loading state */
.contact-form button.loading {
  position: relative;
}

.contact-form .spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Status messages */
.cf-status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 1.5rem;
}

.cf-status--success {
  background-color: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.cf-status--error {
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

.cf-status a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.cf-status a:hover {
  text-decoration: none;
}

/* Honeypot field (hidden from users) */
.contact-form .hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  visibility: hidden;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .contact-form input,
  .contact-form textarea {
    padding: 0.625rem;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .contact-form button[type="submit"] {
    width: 100%;
    padding: 0.875rem;
  }
  
  .cf-status {
    font-size: 0.875rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .contact-form input,
  .contact-form textarea {
    border-width: 3px;
  }
  
  .contact-form input:focus,
  .contact-form textarea:focus {
    box-shadow: 0 0 0 3px #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .contact-form input,
  .contact-form textarea,
  .contact-form button[type="submit"] {
    transition: none;
  }
  
  .contact-form .spinner {
    animation: none;
  }
  
  .contact-form button[type="submit"]:hover:not(:disabled) {
    transform: none;
  }
}
