/* ===========================================
   SONAR CONTACT — заявка / консультация
   =========================================== */

.sonar-contact {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Ширина — стандартный .container (как у tariffs, integrations и др.) */

/* Доп. свечение справа */
.sonar-contact-glow {
  position: absolute;
  right: -18%;
  top: 20%;
  width: min(58vw, 520px);
  height: min(42vw, 380px);
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(124, 58, 237, 0.2) 0%,
    rgba(88, 28, 135, 0.07) 45%,
    transparent 72%
  );
  filter: blur(56px);
  pointer-events: none;
  z-index: 0;
}

.sonar-contact.section-starvy-bg .section-starvy-bg-glow {
  width: min(820px, 90vw);
  height: min(460px, 42vh);
  top: 32%;
  opacity: 0.68;
}

/* Заголовок секции — .sonar-section-title в main.css */

.sonar-contact-spacer {
  height: clamp(36px, 5vw, 52px);
}

/* ---------- Grid ---------- */

.sonar-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(24px, 3.5vw, 48px);
  align-items: start;
}

@media (max-width: 991px) {
  .sonar-contact-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ---------- Left: инфо + виджеты (как contact-author-boxarea + widget-contactbox) ---------- */

.sonar-contact-left {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sonar-contact-info.sonar-card {
  padding: clamp(24px, 3vw, 32px);
}

.sonar-contact-info-title {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.1vw, 26px);
  line-height: 1.35;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.sonar-contact-info-text {
  margin: 0;
  font-size: clamp(15px, 1.6vw + 8px, 20px);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
}

.sonar-contact-widgets-spacer {
  height: 40px;
  flex-shrink: 0;
}

/* ---------- Channels (иконки в ряд с разделителями) ---------- */

.sonar-contact-channels.sonar-card {
  padding: clamp(18px, 2vw, 22px) clamp(12px, 1.5vw, 18px);
}

.sonar-contact-channels-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}

.sonar-contact-channel-item {
  position: relative;
  display: flex;
}

.sonar-contact-channel-item:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 44px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0.12) 70%,
    transparent 100%
  );
}

.sonar-contact-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 6px 4px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  transition: transform 0.35s cubic-bezier(0.22, 0.85, 0.3, 1);
}

.sonar-contact-channel:hover {
  transform: translateY(-2px);
}

.sonar-contact-channel:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.65);
  outline-offset: 4px;
}

.sonar-contact-channel-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(168, 85, 247, 0.42);
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.28), rgba(124, 58, 237, 0.12));
  box-shadow:
    0 8px 20px rgba(76, 29, 149, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px, auto;
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease;
}

.sonar-contact-channel-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 48%);
  opacity: 0.7;
}

.sonar-contact-channel:hover .sonar-contact-channel-icon {
  border-color: rgba(216, 180, 254, 0.6);
  box-shadow:
    0 12px 28px rgba(76, 29, 149, 0.5),
    0 0 20px rgba(192, 132, 252, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sonar-contact-channel-icon--gmail {
  background-image:
    var(--contact-icon-gmail-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.28), rgba(124, 58, 237, 0.12));
}
.sonar-contact-channel-icon--phone {
  background-image:
    var(--contact-icon-phone-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.28), rgba(124, 58, 237, 0.12));
}
.sonar-contact-channel-icon--telegram {
  background-image:
    var(--contact-icon-telegram-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.28), rgba(124, 58, 237, 0.12));
}
.sonar-contact-channel-icon--max {
  background-image:
    var(--max-icon-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.28), rgba(124, 58, 237, 0.12));
}

.sonar-contact-channel:hover .sonar-contact-channel-icon--gmail {
  background-image:
    var(--contact-icon-gmail-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.44), rgba(124, 58, 237, 0.2));
}
.sonar-contact-channel:hover .sonar-contact-channel-icon--phone {
  background-image:
    var(--contact-icon-phone-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.44), rgba(124, 58, 237, 0.2));
}
.sonar-contact-channel:hover .sonar-contact-channel-icon--telegram {
  background-image:
    var(--contact-icon-telegram-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.44), rgba(124, 58, 237, 0.2));
}
.sonar-contact-channel:hover .sonar-contact-channel-icon--max {
  background-image:
    var(--max-icon-url),
    linear-gradient(145deg, rgba(168, 85, 247, 0.44), rgba(124, 58, 237, 0.2));
}

.sonar-contact-channel-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(248, 250, 252, 0.92);
  text-align: center;
}

@media (max-width: 1199px) {
  .sonar-contact-channel-icon {
    width: 44px;
    height: 44px;
    background-size: 22px, auto;
  }
  .sonar-contact-channel-item:not(:first-child)::before {
    height: 40px;
  }
}

@media (max-width: 575px) {
  .sonar-contact-channel-label {
    font-size: 12px;
  }
  .sonar-contact-channel-icon {
    width: 42px;
    height: 42px;
  }
  .sonar-contact-channel-item:not(:first-child)::before {
    height: 36px;
  }
}

/* ---------- Form card ---------- */

.sonar-contact-form-card.sonar-card {
  padding: clamp(22px, 3vw, 32px);
}

.sonar-contact-form-title {
  margin: 0 0 22px;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.sonar-contact-flash-host {
  margin: 0 0 18px;
}

.sonar-contact-flash-host[hidden] {
  display: none !important;
}

.sonar-contact-flash {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.sonar-contact-flash--success {
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sonar-contact-flash--error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.sonar-contact-form-sub {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(156, 163, 175, 0.95);
}

.sonar-contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

/* Honeypot: невидимое поле для ловли ботов */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sonar-contact-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 575px) {
  .sonar-contact-field-row {
    grid-template-columns: 1fr;
  }
}

.sonar-contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sonar-contact-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(209, 213, 219, 0.9);
}

.sonar-contact-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.4;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.sonar-contact-input::placeholder {
  color: rgba(156, 163, 175, 0.75);
}

.sonar-contact-input:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.sonar-contact-input:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
  background: rgba(0, 0, 0, 0.38);
}

.sonar-contact-textarea {
  min-height: 112px;
  resize: vertical;
}

/* ---------- Consents ---------- */

.sonar-contact-consents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.sonar-contact-consent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sonar-contact-consent .form-check-input {
  flex-shrink: 0;
  margin: 0;
}

.sonar-contact-consent .form-check-label {
  line-height: 1.45;
}

.sonar-contact .text-agree-policy {
  font-size: 13px;
  color: rgba(209, 213, 219, 0.88);
}

.sonar-contact .text-agree-policy a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.28s ease;
}

.sonar-contact .text-agree-policy a:hover {
  color: #a971e6;
  text-decoration: none;
}

.sonar-contact .text-agree-policy a:focus-visible {
  outline: 2px solid rgba(169, 85, 247, 0.849);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Submit ----------
   Градиенты нельзя плавно сшить между собой → фиолет в ::before, серый базово,
   переход по opacity + transition у border/box-shadow/color.
   ---------- */

.sonar-contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  /* Базовый слой — серый градиент (виден при disabled) */
  background: linear-gradient(135deg, #a1a1aa 0%, #71717a 100%);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: not-allowed;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.14),
    0 10px 32px -10px rgba(0, 0, 0, 0.42),
    0 0 28px -10px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sonar-contact-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.sonar-contact-submit > * {
  position: relative;
  z-index: 1;
}

.sonar-contact-submit-fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.28) 55%,
    rgba(255, 255, 255, 0.14) 100%
  );
}

.sonar-contact-submit-label {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.25;
}

.sonar-contact-submit.is-sent {
  --sonar-contact-submit-cooldown: 8s;
  height: auto;
  min-height: 52px;
  padding: 12px 18px;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  border-color: rgba(192, 132, 252, 0.45);
  color: #fff;
  cursor: default;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(124, 58, 237, 0.28),
    0 10px 32px -8px rgba(168, 85, 247, 0.45),
    0 0 36px -6px rgba(168, 85, 247, 0.28);
}

.sonar-contact-submit.is-sent::before {
  opacity: 1;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

.sonar-contact-submit.is-sent .sonar-contact-submit-fill {
  animation: sonar-contact-submit-timer var(--sonar-contact-submit-cooldown) linear forwards;
}

.sonar-contact-submit.is-sent .sonar-contact-submit-arrow {
  display: none;
}

@keyframes sonar-contact-submit-timer {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.sonar-contact-submit:not(:disabled) {
  border-color: rgba(192, 132, 252, 0.45);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(124, 58, 237, 0.25),
    0 10px 32px -8px rgba(168, 85, 247, 0.55),
    0 0 36px -6px rgba(168, 85, 247, 0.4);
}

.sonar-contact-submit:not(:disabled)::before {
  opacity: 1;
}

.sonar-contact-submit:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 1px rgba(124, 58, 237, 0.35),
    0 14px 40px -8px rgba(168, 85, 247, 0.65),
    0 0 44px -4px rgba(168, 85, 247, 0.5);
}

.sonar-contact-submit:disabled {
  transform: none;
  filter: none;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .sonar-contact-submit,
  .sonar-contact-submit::before {
    transition-duration: 0.01ms;
  }

  .sonar-contact-submit:not(:disabled):hover {
    transform: none;
    filter: none;
  }

  .sonar-contact-submit.is-sent .sonar-contact-submit-fill {
    animation: none;
    transform: scaleX(1);
  }
}

.sonar-contact-submit-arrow {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.sonar-contact-submit-arrow svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 430px) {
  .sonar-contact .text-agree-policy {
    font-size: 12px;
  }
}

/* Полотно: без отдельного фона секции */
.home-sonar-strip .sonar-contact.section-starvy-bg {
  background: transparent;
}

.home-sonar-strip .sonar-contact.section-starvy-bg::after {
  display: none;
}
