/* ==========================================================================
   AlphaReaction Contact Page — futuristic ambient backgrounds
   Matches About Us (.about-us--who) particle + network canvas style
   ========================================================================== */

.ar-contact-section {
  position: relative;
  z-index: 2;
  isolation: isolate;
  overflow: hidden;
  background: var(--theme-surface, #050510);
}

/* Hero / page title */
.page-title.ar-contact-section {
  background: var(--theme-surface, #050510);
  min-height: clamp(280px, 38vw, 350px);
}

.page-title.ar-contact-section::before {
  display: none;
}

.page-title.ar-contact-section .container {
  position: relative;
  z-index: 1;
}

/* Form section */
.contact-pg-section.ar-contact-section {
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(56px, 7vw, 96px);
}

.contact-pg-section.ar-contact-section .container {
  position: relative;
  z-index: 1;
}

/* Contact info (cards + map) */
.cp-contact-info.ar-contact-section {
  background: var(--theme-surface, #050510);
}

.cp-contact-info.ar-contact-section .container {
  position: relative;
  z-index: 1;
}

/* Hide legacy aquarium underwater deco */
.cp-contact-info.ar-contact-section .cp-ci-deco,
.cp-contact-info.ar-contact-section .cp-ci-waves {
  display: none !important;
}

/* Ambient layer (shared structure) */
.ar-contact-section .ar-contact__ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ar-contact-section .ar-contact__ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.88;
  mix-blend-mode: screen;
}

.ar-contact-section .ar-contact__ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.32;
  animation: ar-contact-glow-drift 16s ease-in-out infinite alternate;
}

.ar-contact-section .ar-contact__ambient-glow--blue {
  width: 42%;
  height: 45%;
  top: 5%;
  left: -10%;
  background: radial-gradient(circle, rgba(0, 102, 255, 0.28) 0%, transparent 70%);
}

.ar-contact-section .ar-contact__ambient-glow--purple {
  width: 38%;
  height: 40%;
  top: 20%;
  right: -8%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.24) 0%, transparent 70%);
  animation-delay: -5s;
}

.ar-contact-section .ar-contact__ambient-glow--magenta {
  width: 30%;
  height: 35%;
  bottom: 10%;
  left: 30%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.18) 0%, transparent 70%);
  animation-delay: -9s;
}

.ar-contact-section .ar-contact__ambient-glow--cyan {
  width: 28%;
  height: 32%;
  bottom: 12%;
  right: 10%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.16) 0%, transparent 70%);
  animation-delay: -12s;
}

.ar-contact-section .ar-contact__wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60%;
  height: 140px;
  background: radial-gradient(ellipse 90% 100% at 10% 100%, rgba(0, 210, 255, 0.1) 0%, transparent 60%);
  opacity: 0.65;
}

@keyframes ar-contact-glow-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.05); }
}

/* Form panel — subtle glass on dark ambient */
.contact-pg-section.ar-contact-section .contact-form-area {
  position: relative;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 20px;
  background: rgba(8, 10, 28, 0.55);
  border: 1px solid rgba(0, 210, 255, 0.12);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.contact-pg-section.ar-contact-section .ch-top-title-s3 p {
  color: rgba(226, 232, 240, 0.82);
}

.contact-pg-section.ar-contact-section form input,
.contact-pg-section.ar-contact-section form select,
.contact-pg-section.ar-contact-section form textarea {
  background: rgba(5, 5, 16, 0.65) !important;
  border-color: rgba(0, 210, 255, 0.22) !important;
}

.contact-pg-section.ar-contact-section form input:focus,
.contact-pg-section.ar-contact-section form select:focus,
.contact-pg-section.ar-contact-section form textarea:focus {
  border-color: rgba(0, 210, 255, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.12) !important;
}

/* --------------------------------------------------------------------------
   Animated subject select
   -------------------------------------------------------------------------- */
.ar-contact-select {
  position: relative;
  width: 100%;
}

.ar-contact-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  background: transparent !important;
}

.ar-contact-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  color: #e2e8f0;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid rgba(0, 210, 255, 0.22);
  background: rgba(5, 5, 16, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease,
    transform 0.25s ease;
}

.ar-contact-select__trigger:hover {
  border-color: rgba(0, 210, 255, 0.42);
  background: rgba(8, 12, 32, 0.78);
}

.ar-contact-select__trigger:focus-visible {
  outline: none;
  border-color: rgba(0, 210, 255, 0.55);
  box-shadow:
    0 0 0 2px rgba(0, 210, 255, 0.12),
    0 0 24px rgba(0, 210, 255, 0.08);
}

.ar-contact-select.is-open .ar-contact-select__trigger {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow:
    0 0 0 2px rgba(168, 85, 247, 0.1),
    0 12px 32px rgba(0, 0, 0, 0.25);
}

.ar-contact-select.is-invalid .ar-contact-select__trigger {
  border-color: rgba(248, 113, 113, 0.65) !important;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.12) !important;
}

.ar-contact-select__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.ar-contact-select__label.is-placeholder {
  color: rgba(148, 163, 184, 0.78);
}

.ar-contact-select__label.has-value {
  color: #f1f5f9;
}

.ar-contact-select__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.14), rgba(168, 85, 247, 0.14));
  color: rgba(0, 210, 255, 0.92);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}

.ar-contact-select__icon svg {
  width: 16px;
  height: 16px;
}

.ar-contact-select.is-open .ar-contact-select__icon {
  transform: rotate(180deg);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(0, 210, 255, 0.18));
  color: rgba(168, 85, 247, 0.95);
}

.ar-contact-select__dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s;
}

.ar-contact-select.is-open .ar-contact-select__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ar-contact-select__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: min(280px, 52vh);
  overflow-y: auto;
  border-radius: 16px;
  background: rgba(6, 8, 24, 0.96);
  border: 1px solid rgba(0, 210, 255, 0.18);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 40px rgba(0, 210, 255, 0.06);
  backdrop-filter: blur(16px);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.35) transparent;
}

.ar-contact-select__list::-webkit-scrollbar {
  width: 6px;
}

.ar-contact-select__list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 210, 255, 0.35);
}

.ar-contact-select__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: rgba(226, 232, 240, 0.88);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.ar-contact-select__option:last-child {
  margin-bottom: 0;
}

.ar-contact-select.is-open--animated .ar-contact-select__option {
  animation: ar-contact-option-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--option-index, 0) * 45ms);
}

.ar-contact-select__option::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 210, 255, 0.35);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ar-contact-select__option:hover,
.ar-contact-select__option.is-focused {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.12), rgba(168, 85, 247, 0.08));
  color: #fff;
  transform: translateX(4px);
}

.ar-contact-select__option:hover::before,
.ar-contact-select__option.is-focused::before {
  background: rgba(0, 210, 255, 0.85);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.55);
  transform: scale(1.15);
}

.ar-contact-select__option.is-selected {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.16), rgba(168, 85, 247, 0.12));
  color: #fff;
  box-shadow: inset 3px 0 0 rgba(0, 210, 255, 0.85);
}

.ar-contact-select__option.is-selected::before {
  background: rgba(168, 85, 247, 0.95);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

@keyframes ar-contact-option-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ar-contact-select label.error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #fca5a5;
}

/* --------------------------------------------------------------------------
   Phone row — country code + number
   -------------------------------------------------------------------------- */
.ar-contact-phone-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.ar-contact-select--country {
  flex: 0 0 auto;
  width: clamp(118px, 28%, 148px);
  min-width: 118px;
}

.ar-contact-country-trigger {
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 12px;
}

.ar-contact-country-flag {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.ar-contact-country-dial {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f1f5f9;
}

.ar-contact-select--country .ar-contact-select__icon {
  width: 24px;
  height: 24px;
  margin-left: auto;
}

.ar-contact-select--country .ar-contact-select__dropdown {
  min-width: min(320px, calc(100vw - 48px));
  left: 0;
  right: auto;
}

.ar-contact-country-search-wrap {
  padding: 8px 8px 4px;
}

.ar-contact-country-search {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: #e2e8f0;
  border-radius: 10px;
  border: 1px solid rgba(0, 210, 255, 0.2);
  background: rgba(5, 5, 16, 0.85);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ar-contact-country-search::placeholder {
  color: rgba(148, 163, 184, 0.72);
}

.ar-contact-country-search:focus {
  outline: none;
  border-color: rgba(0, 210, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.1);
}

.ar-contact-country-list {
  max-height: min(260px, 45vh);
}

.ar-contact-country-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.ar-contact-country-option::before {
  display: none;
}

.ar-contact-country-option:hover,
.ar-contact-country-option.is-focused {
  transform: translateX(4px);
}

.ar-contact-country-option .ar-contact-country-flag {
  font-size: 1.15rem;
}

.ar-contact-country-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-contact-country-option .ar-contact-country-dial {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 210, 255, 0.88);
}

.ar-contact-country-option.is-hidden {
  display: none;
}

.ar-contact-phone-input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
}

.ar-contact-phone-row.is-invalid-row .ar-contact-country-trigger,
.ar-contact-phone-row.is-invalid-row .ar-contact-phone-input {
  border-color: rgba(248, 113, 113, 0.65) !important;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.12) !important;
}

/* Info cards — glass accent on dark section */
.cp-contact-info.ar-contact-section .cp-ci-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 210, 255, 0.18);
}

.cp-contact-info.ar-contact-section .cp-ci-map {
  border: 1px solid rgba(0, 210, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* Subscribe Now section — seamless transition from contact info block */
.cp-contact-info.ar-contact-section + .subscribe-now {
  padding-top: clamp(40px, 5vw, 64px);
}

@media (max-width: 767px) {
  .ar-contact-section .ar-contact__ambient-glow {
    filter: blur(60px);
    opacity: 0.26;
  }

  .contact-pg-section.ar-contact-section .contact-form-area {
    padding: 18px;
  }

  .ar-contact-phone-row {
    flex-direction: column;
    gap: 8px;
  }

  .ar-contact-select--country {
    width: 100%;
    min-width: 0;
  }

  .ar-contact-select--country .ar-contact-select__dropdown {
    left: 0;
    right: 0;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ar-contact-section .ar-contact__ambient-canvas,
  .ar-contact-section .ar-contact__ambient-glow {
    animation: none !important;
  }

  .ar-contact-select__trigger,
  .ar-contact-select__icon,
  .ar-contact-select__dropdown,
  .ar-contact-select__option {
    transition: none !important;
  }

  .ar-contact-select.is-open--animated .ar-contact-select__option {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
