/* Contact popup — mirrors React ContactPopup.tsx */

/* Above navbar (1030), chatbot (1050), and default offcanvas (1045) */
.offcanvas-backdrop.show {
  z-index: 1060 !important;
  background-color: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1 !important;
}

.offcanvas-contact {
  /* Bootstrap defaults to 400px — too narrow on desktop */
  --bs-offcanvas-width: 100%;
  --bs-offcanvas-zindex: 1070;
  z-index: 1070 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: none;
  background: linear-gradient(to bottom right, #f8fafc, #fff, #ecfeff);
  box-shadow: -12px 0 48px rgba(15, 23, 42, 0.18);
}

body.contact-popup-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .offcanvas-contact.offcanvas-end {
    --bs-offcanvas-width: 28rem;
    left: auto !important;
    right: 0 !important;
    width: 28rem !important;
    max-width: 28rem !important;
    border-left: 1px solid rgba(229, 231, 235, 0.85);
  }
}

@media (min-width: 1200px) {
  .offcanvas-contact.offcanvas-end {
    --bs-offcanvas-width: 32rem;
    width: 32rem !important;
    max-width: 32rem !important;
  }
}

/* Keep chatbot behind dimmed backdrop while contact panel is open */
body.contact-popup-open .chatbot-widget {
  z-index: 1020;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.contact-popup-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 30;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-popup-close:hover {
  color: #0891b2;
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.contact-popup-close-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.contact-popup-inner {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding:
    max(3.5rem, calc(env(safe-area-inset-top, 0px) + 2.75rem))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
}

@media (min-width: 768px) {
  .contact-popup-inner {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
    padding: 3.25rem 1.75rem 2rem;
  }
}

@media (min-width: 1200px) {
  .contact-popup-inner {
    padding: 3.5rem 2rem 2.25rem;
  }
}

.contact-popup-bg-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.contact-bg-icon {
  position: absolute;
  display: inline-flex;
  opacity: 0.2;
}

.contact-bg-svg {
  width: 3rem;
  height: 3rem;
}

.contact-bg-svg-lg {
  width: 5rem;
  height: 5rem;
}

.contact-bg-svg-sm {
  width: 2.2rem;
  height: 2.2rem;
}

.contact-bg-icon--brain {
  top: 5rem;
  left: 2.5rem;
  color: #22d3ee;
  animation: contact-float-a 6s ease-in-out infinite;
}

.contact-bg-icon--rocket {
  top: 8rem;
  right: 4rem;
  color: #60a5fa;
  animation: contact-float-b 8s ease-in-out infinite 0.5s;
}

.contact-bg-icon--cpu {
  bottom: 8rem;
  left: 5rem;
  color: #c084fc;
  animation: contact-float-c 7s ease-in-out infinite 1s;
}

.contact-bg-icon--code {
  bottom: 12rem;
  right: 2.5rem;
  color: #67e8f9;
  animation: contact-float-d 5s ease-in-out infinite 1.5s;
}

.contact-bg-icon--globe {
  top: 50%;
  left: 25%;
  transform: translate(-50%, -50%);
  color: #93c5fd;
  opacity: 0.1;
  animation: contact-spin 10s linear infinite;
}

.contact-bg-icon--sparkles {
  top: 33%;
  right: 33%;
  color: #d8b4fe;
  opacity: 0.15;
  animation: contact-pulse 4s ease-in-out infinite;
}

@keyframes contact-float-a {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes contact-float-b {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(15px) rotate(-5deg); }
}

@keyframes contact-float-c {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-25px) rotate(10deg); }
}

@keyframes contact-float-d {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, 20px); }
}

@keyframes contact-spin {
  from { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.2); }
  to { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

@keyframes contact-pulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.1); }
}

.contact-popup-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contact-popup-header {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
  padding-right: 2.75rem;
}

.contact-popup-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #111827, #1e40af, #0e7490);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.contact-popup-lead {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #4b5563;
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 768px) {
  .contact-popup-content {
    flex: 0 1 auto;
    min-height: auto;
    overflow: visible;
  }

  .contact-popup-header,
  .contact-popup-header.text-center {
    text-align: left;
    margin-bottom: 1.25rem;
    padding-right: 3rem;
  }

  .contact-popup-title {
    font-size: 1.875rem;
    line-height: 1.2;
  }

  .contact-popup-lead {
    font-size: 0.9375rem;
    line-height: 1.65;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .contact-popup-card {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
    padding: 1.75rem;
  }

  .contact-popup-card-title {
    font-size: 1.25rem;
  }

  .contact-popup-card-sub {
    font-size: 0.8125rem;
  }

  .contact-textarea {
    min-height: 6.5rem;
  }
}

@media (min-width: 1200px) {
  .contact-popup-title {
    font-size: 2rem;
  }

  .contact-popup-lead {
    font-size: 1rem;
  }

  .contact-popup-card {
    padding: 2rem;
  }
}

.contact-popup-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.25rem;
  border: 1px solid rgba(229, 231, 235, 0.5);
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.12);
  padding: 1.25rem;
}

@media (min-width: 768px) {
  .contact-popup-card {
    border-radius: 1.5rem;
  }
}

.contact-popup-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.contact-popup-send-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: linear-gradient(to bottom right, #22d3ee, #3b82f6);
  animation: contact-send-pulse 2s ease-in-out infinite;
}

@keyframes contact-send-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.contact-popup-send-svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #fff;
}

.contact-popup-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.contact-popup-card-sub {
  font-size: 0.6875rem;
  color: #6b7280;
  margin: 0;
}


.contact-popup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}

.contact-required {
  color: #ef4444;
}

.contact-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #111827;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 767.98px) {
  .contact-popup-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .contact-popup-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .contact-popup-bg-icons {
    display: none;
  }

  .contact-popup-card-head {
    margin-bottom: 0.875rem;
  }

  .contact-popup-send-icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  .contact-popup-send-svg {
    width: 1.125rem;
    height: 1.125rem;
  }

  .contact-label {
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
  }

  .contact-popup-form {
    gap: 0.75rem;
  }

  .contact-input {
    padding: 0.625rem 0.875rem;
  }

  .contact-textarea {
    min-height: 6.5rem;
  }

  .contact-submit-btn {
    padding: 0.8125rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 575.98px) {
  .contact-popup-close {
    width: 2.5rem;
    height: 2.5rem;
  }

  .contact-popup-close-icon {
    width: 1.125rem;
    height: 1.125rem;
  }

  .contact-popup-form {
    gap: 0.875rem;
  }

  .contact-input,
  .contact-textarea {
    font-size: 16px;
  }
}

.contact-input:hover {
  border-color: #d1d5db;
}

.contact-input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25);
}

.contact-textarea {
  resize: vertical;
  min-height: 7rem;
}

.contact-submit-btn {
  position: relative;
  width: 100%;
  margin-top: 0.25rem;
  padding: 1rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #2563eb);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-submit-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 36px rgba(6, 182, 212, 0.35);
}

.contact-submit-btn:active {
  transform: scale(0.98);
}

.contact-submit-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: contact-shimmer 2s linear infinite;
  pointer-events: none;
}

@keyframes contact-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.contact-submit-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.contact-submit-check {
  width: 1.25rem;
  height: 1.25rem;
}

/* Contact Success Message Panel */
.contact-success-panel {
  padding: 1.5rem 1rem;
  text-align: center;
  animation: contact-success-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contact-success-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.contact-success-icon-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

.contact-success-icon {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.25));
  border: 1.5px solid rgba(34, 197, 94, 0.35);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -6px rgba(16, 185, 129, 0.35);
}

.contact-success-svg {
  width: 2.25rem;
  height: 2.25rem;
}

.contact-success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.contact-success-text {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 1.75rem;
}

.contact-success-close-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.contact-success-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  color: #ffffff;
}

.contact-success-close-btn:active {
  transform: translateY(0);
}

/* Contact Form Field Validation Styles */
.contact-input.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.contact-input.is-valid {
  border-color: #10b981;
}

.contact-error-msg {
  color: #ef4444;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  animation: fadeInError 0.2s ease-in-out;
}

.contact-form-alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #991b1b;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeInError 0.2s ease-in-out;
}

@keyframes fadeInError {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

