/* Contact Expert Modal Styles */

:root {
  --primary: #123e73;
  --primary-dark: #0a2647;
  --accent: #3fa66b;
  --accent-light: #e6f5ec;
  --bg-light: #edf2f8;
  --white: #ffffff;
  --font-main: 'Roboto', sans-serif;
}

/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  animation: fadeIn 0.3s ease-out;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Overlay Background */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
}

/* Modal Content */
.modal-content {
  position: relative;
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 85%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  z-index: 10000;
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  gap: 1rem;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

/* Modal Close Button */
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--primary);
}

.modal-close:focus,
.modal-close:focus-visible {
  outline: none;
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
}

/* Form Styles in Modal */
.contact-form-modal {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-form-modal .form-group {
  display: flex;
  flex-direction: column;
}

.contact-form-modal .form-group label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.contact-form-modal .form-group input,
.contact-form-modal .form-group select,
.contact-form-modal .form-group textarea {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  background: var(--white);
}

.contact-form-modal .form-group input:focus,
.contact-form-modal .form-group select:focus,
.contact-form-modal .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 166, 107, 0.1);
}

.contact-form-modal .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Submit Button in Modal */
.btn-modal-submit {
  padding: 0.875rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.btn-modal-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(18, 62, 115, 0.2);
}

.btn-modal-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-modal-submit:focus,
.btn-modal-submit:focus-visible {
  outline: none;
}

/* Modal Footer */
.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.modal-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.modal-link:hover {
  color: var(--primary);
}

.modal-link:focus,
.modal-link:focus-visible {
  outline: none;
  text-decoration: underline;
}

/* Modal Message (success/error) */
.modal-message {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  animation: slideUp 0.3s ease-out;
}

.modal-message--success {
  background-color: rgba(63, 166, 107, 0.1);
  color: #1e7e34;
  border: 1px solid rgba(63, 166, 107, 0.3);
}

.modal-message--error {
  background-color: rgba(220, 38, 38, 0.1);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Responsive Design */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  .contact-form-modal .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal-content,
  .modal-message {
    animation: none;
  }
}
