/**
 * Timed Popup Quote CSS + Mobile Action Menu
 */

:root {
    --tp-popup-primary: #1d4ed8;
    --tp-popup-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --tp-popup-bg: #ffffff;
    --tp-popup-text: #1e293b;
    --tp-popup-muted: #64748b;
    --tp-popup-radius: 24px;
    --tp-popup-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Popup Overlay
   ========================================================================== */
.tpop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 70, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.tpop-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.tpop-popup {
  width: 100%;
  max-width: 700px;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px 1fr;
  border: 1.5px solid rgba(96, 165, 250, 0.35);
  box-shadow: 0 24px 64px rgba(59, 130, 246, 0.22);
  transform: translateY(18px) scale(.97);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .25s;
  opacity: 0;
  background: #fff;
}

.tpop-overlay.is-active .tpop-popup {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Left sidebar ── */
.tpop-sidebar {
  background: linear-gradient(236deg, #e9d4ff -8.27%, #fff 53.01%);
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.tpop-sidebar-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #bfdbfe, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.32);
}

.tpop-sidebar-icon i {
  color: #fff;
  font-size: 26px;
}

.tpop-sidebar-title {
  color: #3a2060;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.tpop-sidebar-sub {
  color: #9b78c4;
  font-size: 11px;
  margin-top: -8px;
  margin-bottom: 0;
}

.tpop-sidebar-divider {
  height: 1px;
  width: 80%;
  background: linear-gradient(90deg, transparent, #c4a8e8, transparent);
}

.tpop-sidebar-stat-num {
  color: #3a2060;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.tpop-sidebar-stat-lbl {
  color: #9b78c4;
  font-size: 11px;
  margin-top: 2px;
  margin-bottom: 0;
}

.tpop-sidebar-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.tpop-sidebar-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  color: #3a2060;
}

.tpop-sidebar-badge i {
  font-size: 14px;
}

/* ── Right form panel ── */
.tpop-form-panel {
  background: #fff;
  padding: 1.75rem 1.5rem;
}

.tpop-form-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(90deg, #eff6ff, #e9d4ff);
  border-radius: 20px;
  padding: 3px 13px;
  margin-bottom: 9px;
}

.tpop-form-pill i {
  font-size: 12px;
  color: #065af3;
}

.tpop-form-pill span {
  font-size: 11px;
  font-weight: 600;
  color: #065af3;
  letter-spacing: .04em;
}

.tpop-form-heading {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #065af3, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tpop-form-sub {
  font-size: 12px;
  color: #6b94c7;
  margin-bottom: 18px;
}

.tpop-field {
  margin-bottom: 13px;
}

.tpop-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #4b7abf;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}

.tpop-field label i {
  font-size: 13px;
}

.tpop-field input,
.tpop-field select {
  width: 100%;
  height: 41px;
  font-size: 13px;
  font-family: inherit;
  padding: 0 13px;
  border-radius: 9px;
  border: 1.5px solid #c7dcf7;
  background: #f0f7ff;
  color: #1e3a5f;
  outline: none;
  transition: border-color .18s, background .18s;
  appearance: none;
  -webkit-appearance: none;
}

.tpop-field input:focus,
.tpop-field select:focus {
  border-color: #3b82f6;
  background: #fff;
}

.tpop-field input::placeholder {
  color: #a0b8d8;
}

.tpop-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tpop-submit-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(90deg, #53b2fe, #065af3);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 7px 22px rgba(6, 90, 243, 0.36);
  transition: opacity .15s, transform .15s, box-shadow .15s;
  margin-top: 4px;
}

.tpop-submit-btn:hover {
  opacity: .93;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(6, 90, 243, 0.42);
}

.tpop-submit-btn:active {
  transform: scale(.98);
}

.tpop-submit-btn i {
  font-size: 17px;
}

.tpop-form-trust {
  text-align: center;
  font-size: 11px;
  color: #a0b4cc;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tpop-form-trust i {
  font-size: 13px;
}

/* ── Close button ── */
.tpop-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
  transition: background .15s;
}

.tpop-close-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

.tpop-close-btn i {
  font-size: 17px;
}

/* ── Success state ── */
.tpop-success-msg {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2rem;
  text-align: center;
  background: #fff;
  min-height: 220px;
  grid-column: 1 / -1;
}

.tpop-success-msg i {
  font-size: 48px;
  color: #3b82f6;
}

.tpop-success-msg h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 0;
}

.tpop-success-msg p {
  font-size: 13px;
  color: #6b94c7;
}

/* Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ═══════════════════════════════
   MOBILE  ≤ 767px
═══════════════════════════════ */
@media (max-width: 767px) {
  .tpop-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .tpop-popup {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    grid-template-columns: 1fr;
    /* stack vertically */
    border-bottom: none;
    transform: translateY(100%);
    box-shadow: 0 -10px 40px rgba(59, 130, 246, 0.2);
    max-height: 95vh;
    overflow-y: auto;
  }

  .tpop-overlay.is-active .tpop-popup {
    transform: translateY(0);
  }

  /* Sidebar becomes a horizontal top strip on mobile */
  .tpop-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1.1rem 1.25rem;
    gap: 10px 18px;
    border-bottom: 1.5px solid rgba(196, 168, 232, 0.35);
  }

  .tpop-sidebar-icon {
    width: 42px;
    height: 42px;
  }

  .tpop-sidebar-icon i {
    font-size: 20px;
  }

  .tpop-sidebar-title {
    font-size: 13px;
  }

  .tpop-sidebar-divider {
    display: none;
  }

  .tpop-sidebar-sub {
    display: none;
  }

  .tpop-sidebar-badges {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: center;
  }

  .tpop-sidebar-stat-num,
  .tpop-sidebar-stat-lbl {
    display: none;
  }

  /* Form panel */
  .tpop-form-panel {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .tpop-form-heading {
    font-size: 18px;
  }

  .tpop-row2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tpop-row2 .tpop-field:first-child {
    margin-bottom: 13px;
  }

  .tpop-submit-btn {
    height: 46px;
    font-size: 14px;
  }
}


/* ==========================================================================
   Mobile Action Menu (Floating)
   ========================================================================== */
.tp-mobile-action-menu {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 9999;
    font-family: inherit;
    transition: bottom 0.3s ease;
}

/* Move above sticky bottom bar when it's visible */
.tp-mobile-action-menu.has-sticky-bar {
    bottom: 100px;
}

@media (max-width: 767px) {
    .tp-mobile-action-menu {
        display: block;
    }
}

/* Toggle Button */
.tp-action-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 10002;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tp-action-toggle:active {
    transform: scale(0.9);
}

.tp-action-toggle .material-symbols-outlined {
    font-size: 28px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-action-toggle .tp-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.tp-mobile-action-menu.is-open .tp-action-toggle {
    background: #6d28d9;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.tp-mobile-action-menu.is-open .tp-icon-help {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.tp-mobile-action-menu.is-open .tp-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Action Items (Menu Cards) */
.tp-action-items {
    position: absolute;
    bottom: 72px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 280px;
    z-index: 10003;
}

.tp-mobile-action-menu.is-open .tp-action-items {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tp-action-item {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: none;
    text-align: left;
    width: 100%;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tp-action-item:hover,
.tp-action-item:active {
    background: #f8fafc;
    color: #1e293b;
}

.tp-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.tp-action-icon .material-symbols-outlined {
    font-size: 22px;
}

.tp-action-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tp-action-text strong {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1px;
    line-height: 1.3;
}

.tp-action-text span {
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.2;
}

.tp-action-chevron {
    color: #3b82f6;
    font-size: 20px;
    opacity: 0.5;
    flex-shrink: 0;
}

/* Action Overlay (Background Dimmer) */
.tp-action-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.tp-mobile-action-menu.is-open .tp-action-overlay {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Global Mobile Overflow Fix
   ========================================================================== */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }
}
