/**
 * Universal Contact Form Styles
 * Professional glassmorphism contact form with smooth animations
 */

.universal-contact-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 31, 54, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.universal-contact-overlay.active {
  opacity: 1;
  visibility: visible;
}

.universal-contact-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  max-width: 680px;
  width: calc(100% - 2rem);
  max-height: 90vh;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border-radius: var(--radius-xl);
  box-shadow: 
    var(--shadow-2xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.universal-contact-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.universal-contact-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(139, 21, 56, 0.1);
  border-radius: 50%;
  color: var(--navy-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.universal-contact-close:hover {
  background: var(--navy-primary);
  color: white;
  transform: rotate(90deg);
}

.universal-contact-content {
  padding: 3rem 2.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

.universal-contact-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.contact-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--navy-primary), var(--blue-primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 
    var(--shadow-lg),
    0 0 30px rgba(139, 21, 56, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 
      var(--shadow-lg),
      0 0 30px rgba(139, 21, 56, 0.3);
  }
  50% {
    box-shadow: 
      var(--shadow-xl),
      0 0 40px rgba(139, 21, 56, 0.5);
  }
}

.universal-contact-header h2 {
  font-family: var(--font-base);
  font-size: 2.25rem;
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-weight: 400;
}

.universal-contact-header p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.universal-contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-base);
  font-size: 1rem;
  transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy-primary);
  box-shadow: 
    0 0 0 3px var(--navy-subtle),
    var(--shadow-sm);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-actions {
  margin-top: 1rem;
}

.form-actions .btn {
  width: 100%;
  justify-content: center;
  font-size: 1.0625rem;
  padding: 1.125rem 2rem;
}

.form-status {
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  display: none;
}

.form-status.error {
  display: block;
  background: var(--error-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.universal-contact-success {
  text-align: center;
  padding: 2rem 0;
}

.success-icon-large {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  background: var(--gradient-brand-bright);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-primary);
  box-shadow: 
    var(--shadow-xl),
    0 0 40px rgba(47, 123, 255, 0.3);
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.universal-contact-success h3 {
  font-size: 1.875rem;
  margin: 0 0 1rem;
  color: var(--primary);
  font-weight: 700;
}

.universal-contact-success p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 0 0 2rem;
  line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 768px) {
  .universal-contact-content {
    padding: 2rem 1.5rem;
  }

  .universal-contact-header h2 {
    font-size: 1.875rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .form-row {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
  }

  .contact-icon {
    width: 64px;
    height: 64px;
  }

  .success-icon-large {
    width: 80px;
    height: 80px;
  }

  .universal-contact-close {
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .universal-contact-overlay,
  .universal-contact-modal,
  .contact-icon,
  .success-icon-large {
    animation: none;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
  .universal-contact-overlay {
    background: rgba(15, 20, 25, 0.85);
  }

  .universal-contact-modal {
    background: rgba(26, 31, 46, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    background: rgba(15, 20, 25, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
  }

  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    background: rgba(15, 20, 25, 0.8);
    border-color: var(--navy-light);
  }
}
