/* ==================== CONTACT MODAL ==================== */

.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.contact-modal--open {
  display: flex;
}

/* Backdrop */
.contact-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Card */
.contact-modal__card {
  position: relative;
  background: white;
  border-radius: 1rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Header */
.contact-modal__header {
  position: sticky;
  top: 0;
  background: white;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
}

.contact-modal__title {
  font-family: var(--font-heading, 'Libre Baskerville', serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.contact-modal__subtitle {
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

.contact-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #9ca3af;
  transition: color 0.2s;
  margin-left: 1rem;
  flex-shrink: 0;
}

.contact-modal__close:hover {
  color: #111827;
}

.contact-modal__close svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

/* Body */
.contact-modal__body {
  padding: 2rem;
}

/* Form Content */
.contact-modal__form-content {
  display: block;
}

/* Form Error (global) */
.contact-modal__form-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Form Group */
.contact-modal__form-group {
  margin-bottom: 1.5rem;
}

.contact-modal__label {
  display: block;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.contact-modal__label-required {
  color: var(--color-primary, #F6642E);
}

/* Inputs */
.contact-modal__input,
.contact-modal__textarea {
  width: 100%;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  color: #111827;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-modal__input:focus,
.contact-modal__textarea:focus {
  outline: none;
  border-color: var(--color-primary, #F6642E);
  box-shadow: 0 0 0 3px rgba(246, 100, 46, 0.1);
}

.contact-modal__textarea {
  resize: vertical;
  min-height: 120px;
}

/* Input Error State */
.contact-modal__input--error,
.contact-modal__textarea--error {
  border-color: #ef4444;
}

.contact-modal__input--error:focus,
.contact-modal__textarea--error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.contact-modal__error {
  display: block;
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}

/* Submit Button */
.contact-modal__btn {
  width: 100%;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--color-primary, #F6642E);
  border: none;
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}

.contact-modal__btn:hover {
  background: #e5551a;
}

.contact-modal__btn:active {
  transform: scale(0.98);
}

.contact-modal__btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
}

.contact-modal__btn-text {
  transition: opacity 0.2s;
}

.contact-modal__btn-spinner {
  display: none;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.contact-modal__btn svg {
  width: 20px;
  height: 20px;
}

/* Success State */
.contact-modal__success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0;
}

.contact-modal__success-icon {
  width: 64px;
  height: 64px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.contact-modal__success-icon svg {
  width: 32px;
  height: 32px;
  stroke: white;
  stroke-width: 3;
}

.contact-modal__success-title {
  font-family: var(--font-heading, 'Libre Baskerville', serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem;
}

.contact-modal__success-message {
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .contact-modal__card {
    max-width: none;
    border-radius: 0;
    height: 100%;
    max-height: 100vh;
  }

  .contact-modal__header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .contact-modal__title {
    font-size: 1.5rem;
  }

  .contact-modal__body {
    padding: 1.5rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .contact-modal__card {
    animation: none;
  }

  .contact-modal__btn {
    transition: none;
  }
}

/* Dark Background Compatibility */
@media (prefers-color-scheme: dark) {
  /* Keep modal light themed for consistency with site */
  .contact-modal__card {
    background: white;
  }
}

/* Print */
@media print {
  .contact-modal {
    display: none !important;
  }
}
