/* Modal styles */
:root {
  --modal-backdrop: rgba(15, 23, 42, 0.75);
  --modal-radius: 20px;
  --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --modal-gradient: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  --modal-border: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
}

/* Footer legal links */
.footer-legal {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 1rem;
}

.legal-link {
  color: var(--text-primary);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

/* Modal base */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.modal-dialog {
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  background: var(--modal-gradient);
  border: 1px solid transparent;
  background-clip: padding-box;
  border-radius: var(--modal-radius);
  box-shadow: var(--modal-shadow);
  padding: 0;
  z-index: 1;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal.open .modal-dialog {
  transform: scale(1) translateY(0);
}

/* Modal header */
.modal-dialog h3 {
  margin: 0;
  padding: 32px 40px 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(10px);
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.05);
  box-shadow: 0 8px 15px -3px rgba(239, 68, 68, 0.2);
}

.modal-close:active {
  transform: scale(0.95);
}

.modal-body {
  padding: 24px 40px 40px;
  max-height: calc(85vh - 120px);
  overflow-y: auto;
  line-height: 1.7;
  color: #374151;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), #1e40af);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #1e40af, var(--primary-color));
}

.modal-body p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

/* Prevent background scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Enhanced animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
  }
}

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

.contact-form-modal .form-row {
    display: flex;
    gap: 1rem;
}

.contact-form-modal .form-group {
    flex: 1;
}

.contact-form-modal input,
.contact-form-modal textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--modal-radius);
    font-size: 1rem;
    transition: var(--modal-transition);
    font-family: inherit;
}

.contact-form-modal input:focus,
.contact-form-modal textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(81, 162, 214, 0.1);
}

.contact-form-modal .checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.contact-form-modal .checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.contact-form-modal .checkbox-group label {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.contact-form-modal .submit-button {
    background: var(--gradient-primary);
    color: var(--text-light);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--modal-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--modal-transition);
    font-size: 1rem;
    align-self: flex-start;
}

.contact-form-modal .submit-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--modal-shadow);
}

@media (max-width: 768px) {
    .contact-form-modal .form-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Success Notification Styles */
.success-notification {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--modal-radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
    animation: slideInFromTop 0.5s ease-out;
}

.success-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.success-message h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.success-message p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

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

/* Hide form when success notification is shown */
.form-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .success-notification {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .success-icon {
        align-self: center;
    }
}

/* Modal Typography */
.modal-body h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem 0;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body h5 {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    margin: 1.2rem 0 0.6rem 0;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .modal-dialog {
    width: 95%;
    max-height: 90vh;
    border-radius: 16px;
  }
  
  .modal-dialog h3 {
    padding: 24px 24px 0;
    font-size: 1.75rem;
  }
  
  .modal-body {
    padding: 20px 24px 32px;
    max-height: calc(90vh - 100px);
  }
  
  .modal-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .modal-dialog {
    width: 98%;
    margin: 1vh;
    border-radius: 12px;
  }
  
  .modal-dialog h3 {
    padding: 20px 20px 0;
    font-size: 1.5rem;
  }
  
  .modal-body {
    padding: 16px 20px 24px;
    font-size: 1rem;
  }
  
  .modal-body p {
    margin-bottom: 1.25rem;
  }
}