/* ═══════════════════════════════════════════════════════════
   Appther — Contact Popup  (ap-* namespace)
   ═══════════════════════════════════════════════════════════ */

/* ─── Overlay ──────────────────────────────────────────── */
.ap-overlay {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 22, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.32s ease;
}
.ap-overlay.ap-open {
  opacity: 1; pointer-events: all;
}

/* ─── Modal shell ──────────────────────────────────────── */
.ap-modal {
  position: relative;
  display: grid;
  grid-template-columns: 420px 1fr;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  border-radius: 26px;
  overflow: hidden;
  box-shadow:
    0 60px 140px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.07);
  transform: translateY(28px) scale(0.96);
  transition: transform 0.38s cubic-bezier(0.34, 1.44, 0.64, 1);
}
.ap-overlay.ap-open .ap-modal {
  transform: translateY(0) scale(1);
}

/* ─── Close button ─────────────────────────────────────── */
.ap-close {
  position: absolute; top: 16px; right: 16px; z-index: 20;
  width: 38px; height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.22s, border-color 0.22s, transform 0.22s;
  padding: 0;
}
.ap-close:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  transform: rotate(90deg);
}
.ap-close svg {
  width: 16px; height: 16px;
  stroke: rgba(255, 255, 255, 0.9); stroke-width: 2.5;
  fill: none; stroke-linecap: round;
}

/* ─── LEFT PANEL ───────────────────────────────────────── */
.ap-left {
  background: linear-gradient(148deg, #07102a 0%, #160f58 44%, #1e1488 100%);
  padding: 44px 36px 36px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.ap-left::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 85% 15%, rgba(124, 111, 255, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 15% 85%, rgba(56, 189, 248, 0.10) 0%, transparent 55%);
}
.ap-left::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 160px;
  background: linear-gradient(to top, rgba(7, 16, 42, 0.6), transparent);
  pointer-events: none;
}
.ap-left-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }

/* Eyebrow */
.ap-eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.63rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.55);
  margin-bottom: 18px;
}
.ap-eyebrow-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #7c6fff;
  box-shadow: 0 0 0 3px rgba(124, 111, 255, 0.22);
  animation: apDotPulse 2.4s ease-in-out infinite;
}
@keyframes apDotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(124, 111, 255, 0.22); }
  50%       { box-shadow: 0 0 0 7px rgba(124, 111, 255, 0.08); }
}

/* Heading */
.ap-heading {
  font-size: clamp(1.18rem, 2.2vw, 1.55rem);
  font-weight: 800; color: #fff;
  line-height: 1.28; margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.ap-subtext {
  font-size: 0.82rem; color: rgba(255, 255, 255, 0.5);
  line-height: 1.7; margin-bottom: 26px;
}

/* Testimonial block — CSS grid stack keeps height stable across slides */
.ap-testi-wrap { flex: 1; min-height: 0; }

/* All items rendered in the same grid cell: tallest item sets height,
   others fade over it without causing layout reflow. */
.ap-testi-stack {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}
.ap-testi-item {
  grid-column: 1; grid-row: 1;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 22px 22px 20px;
  opacity: 0;
  transition: opacity 0.38s ease;
  pointer-events: none;
}
.ap-testi-item.ap-testi-item--active {
  opacity: 1;
  pointer-events: auto;
}
.ap-testi-stars {
  display: flex; gap: 3px; margin-bottom: 12px;
  font-size: 0.82rem; color: #fbbf24;
}
.ap-testi-text {
  font-size: 0.81rem; color: rgba(255, 255, 255, 0.82);
  line-height: 1.72; margin-bottom: 18px;
  font-style: italic;
}
.ap-testi-author {
  display: flex; align-items: center; gap: 11px;
}
.ap-testi-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800; color: #fff;
  letter-spacing: 0.02em;
}
.ap-testi-name {
  display: block; font-size: 0.8rem; font-weight: 700; color: #fff;
  line-height: 1.3;
}
.ap-testi-role {
  display: block; font-size: 0.7rem; color: rgba(255, 255, 255, 0.48);
}

/* Dots */
.ap-dots {
  display: flex; gap: 7px; align-items: center; margin-bottom: 22px;
}
.ap-dot {
  width: 7px; height: 7px; border-radius: 100px;
  background: rgba(255, 255, 255, 0.22);
  border: none; cursor: pointer; padding: 0;
  transition: background 0.25s, width 0.28s;
}
.ap-dot.ap-dot--active {
  width: 22px; background: #7c6fff;
}

/* Left footer */
.ap-left-footer {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 0.75rem; color: rgba(255, 255, 255, 0.42);
}
.ap-left-footer svg {
  width: 14px; height: 14px; stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.8; fill: none; flex-shrink: 0;
}
.ap-left-footer a {
  color: #9d8fff; text-decoration: none; font-weight: 600;
  transition: color 0.18s;
}
.ap-left-footer a:hover { color: #c4b8ff; }

/* ─── RIGHT PANEL ──────────────────────────────────────── */
.ap-right {
  background: #ffffff;
  padding: 44px 40px 40px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

/* Mobile-only header (hidden on desktop) */
.ap-mobile-header { display: none; }

.ap-form-title {
  font-size: 1.28rem; font-weight: 800;
  color: #0f172a; margin-bottom: 3px;
  font-family: 'Montserrat', sans-serif;
}
.ap-form-subtitle {
  font-size: 0.75rem; color: #64748b; margin-bottom: 22px;
}

/* ─── Form elements ─────────────────────────────────────── */
.ap-form { display: flex; flex-direction: column; gap: 11px; }

.ap-input,
.ap-sel,
.ap-textarea {
  width: 100%; font-size: 0.875rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 100px;
  padding: 13px 18px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: 'Montserrat', sans-serif;
  appearance: none; -webkit-appearance: none;
}
.ap-input:focus,
.ap-sel:focus {
  border-color: #7c6fff;
  box-shadow: 0 0 0 4px rgba(124, 111, 255, 0.1);
  background: #fff;
}
.ap-input::placeholder { color: #94a3b8; }
.ap-textarea {
  border-radius: 18px; resize: vertical; min-height: 86px;
  padding: 14px 18px; line-height: 1.6;
}
.ap-textarea:focus {
  border-color: #7c6fff;
  box-shadow: 0 0 0 4px rgba(124, 111, 255, 0.1);
  background: #fff;
}
.ap-textarea::placeholder { color: #94a3b8; }
.ap-sel { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.ap-sel:invalid, .ap-sel option[value=""] { color: #94a3b8; }

/* Phone row */
.ap-phone-row {
  display: flex; gap: 8px;
}
.ap-country-sel {
  flex: 0 0 auto; min-width: 110px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 100px;
  padding: 13px 12px 13px 14px;
  font-size: 0.875rem; color: #0f172a;
  font-family: 'Montserrat', sans-serif;
  outline: none; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none; -webkit-appearance: none;
}
.ap-country-sel:focus {
  border-color: #7c6fff;
  box-shadow: 0 0 0 4px rgba(124, 111, 255, 0.1);
}
.ap-input--tel { flex: 1; min-width: 0; }

/* Trust row */
.ap-trust-row {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 4px 0 2px;
}
.ap-trust-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; color: #64748b;
  font-weight: 500;
}
.ap-trust-item svg {
  width: 13px; height: 13px; flex-shrink: 0;
  stroke: #10b981; stroke-width: 2.5; fill: none;
}

/* Submit button */
.ap-submit {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 15px 24px;
  background: linear-gradient(90deg, #4f46e5 0%, #7c6fff 45%, #0080ff 100%);
  background-size: 200% 100%; background-position: left center;
  color: #fff; font-size: 0.92rem; font-weight: 700;
  border: none; border-radius: 10px;
  cursor: pointer; letter-spacing: 0.02em;
  font-family: 'Montserrat', sans-serif;
  transition: background-position 0.45s ease, box-shadow 0.25s, transform 0.18s;
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.3);
}
.ap-submit:hover {
  background-position: right center;
  box-shadow: 0 10px 32px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}
.ap-submit:active { transform: translateY(0); }
.ap-submit:disabled { opacity: 0.65; cursor: wait; transform: none; }

/* ─── Success state ─────────────────────────────────────── */
.ap-success {
  text-align: center; padding: 48px 20px 32px;
}
.ap-success-check {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
}
.ap-success-check svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 3; fill: none; }
.ap-success h3 {
  font-size: 1.22rem; font-weight: 800; color: #0f172a;
  margin-bottom: 8px; font-family: 'Montserrat', sans-serif;
}
.ap-success p { color: #475569; font-size: 0.85rem; line-height: 1.65; }
.ap-success-close {
  margin-top: 22px; padding: 10px 28px;
  background: #f1f5f9; color: #475569;
  border: none; border-radius: 100px; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; font-family: 'Montserrat', sans-serif;
  transition: background 0.2s;
}
.ap-success-close:hover { background: #e2e8f0; }

/* ─── Error banner ──────────────────────────────────────── */
.ap-error-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 12px; padding: 11px 14px;
  font-size: 0.78rem; color: #dc2626;
  margin-bottom: 4px; display: none;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 820px) {
  .ap-modal {
    grid-template-columns: 1fr;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 22px;
  }
  .ap-left { padding: 32px 28px 24px; }
  .ap-left::after { display: none; }
  .ap-testi-wrap { margin-bottom: 0; }
  .ap-right { padding: 28px 28px 36px; }
}

@media (max-width: 560px) {
  .ap-overlay { padding: 10px; align-items: flex-end; }
  .ap-modal {
    border-radius: 22px 22px 0 0;
    max-height: 93vh;
  }
  .ap-left { display: none; }
  .ap-mobile-header {
    display: block; margin-bottom: 18px;
  }
  .ap-mobile-eyebrow {
    display: block; font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: #7c6fff; margin-bottom: 6px;
  }
  .ap-mobile-heading {
    font-size: 1.15rem; font-weight: 800; color: #0f172a;
    margin: 0 0 4px; font-family: 'Montserrat', sans-serif;
  }
  .ap-right { padding: 24px 20px 32px; }
  .ap-form-title { font-size: 1.05rem; }
  .ap-close { top: 12px; right: 12px; }
}
