/* ==========================================================================
   MINDAXIS CRM - WHATSAPP ENQUIRY MODAL & NOTIFICATIONS
   Fluid-Tech Industrial Design System
   ========================================================================== */

/* Modal Backdrop */
.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.crm-modal-backdrop.crm-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Dialog */
.crm-modal-dialog {
  background: #ffffff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
}

.crm-modal-backdrop.crm-active .crm-modal-dialog {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.crm-modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 3px solid #25D366;
  position: relative;
}

.crm-modal-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crm-modal-icon-badge {
  width: 46px;
  height: 46px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  flex-shrink: 0;
}

.crm-modal-title-wrap h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.crm-modal-title-wrap p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.35;
}

.crm-modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  flex-shrink: 0;
}

.crm-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Modal Body */
.crm-modal-body {
  padding: 22px 24px;
}

.crm-form-group {
  margin-bottom: 16px;
}

.crm-form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin-bottom: 6px;
}

.crm-form-group label span.crm-req {
  color: #ef4444;
}

.crm-input,
.crm-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}

.crm-input:focus,
.crm-select:focus {
  border-color: #25D366;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.crm-input.crm-invalid,
.crm-select.crm-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.crm-field-error {
  font-size: 0.78rem;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

.crm-field-error.crm-visible {
  display: block;
}

/* Modal Feedback Banner */
.crm-feedback-banner {
  display: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 16px;
}

.crm-feedback-banner.crm-banner-success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.crm-feedback-banner.crm-banner-error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.crm-banner-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.crm-banner-btn {
  background: #991b1b;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.crm-banner-btn-secondary {
  background: #ffffff;
  color: #166534;
  border: 1px solid #22c55e;
}

/* Modal Footer / Buttons */
.crm-modal-footer {
  margin-top: 20px;
}

.crm-submit-btn {
  width: 100%;
  padding: 12px 18px;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  letter-spacing: 0.02em;
}

.crm-submit-btn:hover:not(:disabled) {
  background: #20bd5a;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

.crm-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.crm-submit-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.crm-disclaimer {
  margin-top: 10px;
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
  line-height: 1.35;
}

/* Spinner */
.crm-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: crmSpin 0.7s linear infinite;
  display: inline-block;
}

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

/* Global Toast for Feedback */
.crm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.crm-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: crmToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid #25D366;
}

.crm-toast.crm-toast-error {
  border-left-color: #ef4444;
}

.crm-toast.crm-toast-info {
  border-left-color: #3b82f6;
}

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

/* Mobile responsive */
@media (max-width: 480px) {
  .crm-modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .crm-modal-dialog {
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  .crm-modal-header {
    padding: 16px 18px;
  }

  .crm-modal-body {
    padding: 18px 18px 24px;
  }
}
