/* Quick Connect widget styles - the Clients Now floating Callback + WhatsApp widget
   (markup: components/quick-connect.php, behaviour: assets/js/quick-connect.js).
   The agency's standard design, recoloured to Synerge green; linked after style.css so the
   site-fit rules below win at equal specificity. */
  /* Accent colour, scoped to the widget so it never leaks into the site. */
  .cn-cb-fab-stack, .cn-cb-overlay { --blue: #143F38; }
  /* The spinner sets display:inline-block, which would beat [hidden]. Let [hidden] win. */
  .cn-cb-spinner[hidden] { display: none; }

  /* ---------- site fit ---------- */
  /* reCAPTCHA's badge sits bottom-right, under these buttons. Hidden, with the disclosure
     Google requires printed inside the widget instead (.cn-cb-rc). */
  .grecaptcha-badge { visibility: hidden; }
  .cn-cb-fab-stack { transition: bottom 0.22s ease; }
  .cn-cb-rc { font-size: 10.5px; opacity: 0.8; margin-top: 8px; }

  /* Country code: a native select styled like the inputs (Synerge exports, so not +91 only). */
  .cn-cb-cc { appearance: none; -webkit-appearance: none; text-align: center; text-align-last: center; }

  /* The site's back-to-top (.to-top, style.css) shares the bottom-right corner. It sits on top
     of the stack, centred on the same line: the stack is 28 + 58 + 18 + 58 = 162px tall, so it
     starts 18px above that; its 52px disc is centred on the 58px buttons (28 + 29 - 26 = 31). */
  .to-top { right: 31px; bottom: 180px; }
  @media (max-width: 720px) {
    .to-top { right: 31px; bottom: 180px; }
  }
  @media (max-width: 480px) {
    /* The stack becomes a solid bottom bar (62px + the home-indicator inset) and the arrow sits
       in its row at the right end. The bar opens a 66px slot for it only while it shows
       (html.totop-on, set by main.js), sliding open instead of snapping. */
    .to-top { right: 12px; bottom: calc(9px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; z-index: 9998; }
    html .cn-cb-fab-stack { z-index: 9997; transition: bottom 0.22s ease, padding-right 0.26s cubic-bezier(0.22, 1, 0.36, 1); }
    html.totop-on .cn-cb-fab-stack { padding-right: 66px; }
  }
  @media (max-width: 480px) and (prefers-reduced-motion: reduce) {
    html .cn-cb-fab-stack { transition: none; }
  }

  /* ---------- Floating Action Buttons (stack) ---------- */
  .cn-cb-fab-stack {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
  }

  .cn-cb-fab {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue) 0%, #143F38 100%);
    border: 2px solid rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(20, 63, 56, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }

  .cn-cb-fab--wa {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
  }

  .cn-cb-fab--wa:hover {
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5), 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  .cn-cb-fab--wa .cn-cb-fab-pulse {
    background: #25D366;
  }

  .cn-cb-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(20, 63, 56, 0.5), 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  .cn-cb-fab:active {
    transform: scale(0.96);
  }

  .cn-cb-fab svg {
    width: 26px;
    height: 26px;
    position: relative;
    z-index: 2;
  }

  /* Tooltip label on hover */
  .cn-cb-fab[data-label]::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: #143F38;
    color: #FFF;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--f-head, 'Sora', system-ui, sans-serif);
    padding: 7px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  }

  .cn-cb-fab[data-label]::after {
    content: '';
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    border: 6px solid transparent;
    border-left-color: #143F38;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .cn-cb-fab[data-label]:hover::before,
  .cn-cb-fab[data-label]:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  .cn-cb-fab-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--blue);
    opacity: 0.45;
    animation: cnCbPulse 2.4s ease-out infinite;
    z-index: 0;
  }

  .cn-cb-fab--wa .cn-cb-fab-pulse {
    animation-delay: 1.2s;
  }

  @keyframes cnCbPulse {
    0% {
      transform: scale(1);
      opacity: 0.45;
    }

    100% {
      transform: scale(1.35);
      opacity: 0;
    }
  }

  /* ---------- Overlay ---------- */
  .cn-cb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 28, 24, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    animation: cnCbFadeIn 0.25s ease forwards;
  }

  .cn-cb-overlay[hidden] {
    display: none;
  }

  @keyframes cnCbFadeIn {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }


  /* ---------- Modal Container ---------- */
  .cn-cb-modal {
    background: #143F38;
    border-radius: 16px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    max-width: 460px;
    margin: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    font-family: var(--f-body, 'Inter', system-ui, sans-serif);
    color: #F5EFE4;
    animation: cnCbSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background-image:
      radial-gradient(circle at 20% 0%, rgba(20, 63, 56, 0.25) 0%, transparent 45%),
      radial-gradient(circle at 80% 100%, rgba(20, 63, 56, 0.14) 0%, transparent 45%);
    flex-shrink: 0;
  }

  @keyframes cnCbSlideUp {
    from {
      opacity: 0;
      transform: translateY(20px) scale(0.96);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  /* Custom scrollbar inside modal */
  .cn-cb-modal {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  }

  .cn-cb-modal::-webkit-scrollbar {
    width: 6px;
  }

  .cn-cb-modal::-webkit-scrollbar-track {
    background: transparent;
  }

  .cn-cb-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
  }

  .cn-cb-modal::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
  }

  /* ---------- Close button ---------- */
  .cn-cb-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #A9C4BA;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
  }

  .cn-cb-close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #FFF;
  }

  /* ---------- Tabs ---------- */
  .cn-cb-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 58px 22px 0;
  }

  .cn-cb-tab {
    background: transparent;
    border: none;
    color: #A9C4BA;
    padding: 12px 6px;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: color 0.2s, background 0.2s;
    text-align: center;
    line-height: 1.2;
  }

  .cn-cb-tab svg {
    transition: transform 0.2s;
  }

  .cn-cb-tab:hover {
    color: #FFF;
    background: rgba(255, 255, 255, 0.04);
  }

  .cn-cb-tab.is-active {
    color: #143F38;
    background: rgba(20, 63, 56, 0.25);
  }

  .cn-cb-tab.is-active svg {
    transform: translateY(-2px);
  }

  /* ---------- Header ---------- */
  .cn-cb-header {
    padding: 24px 28px 16px;
    text-align: center;
  }

  .cn-cb-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
  }

  .cn-cb-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), #143F38);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(20, 63, 56, 0.35);
  }

  .cn-cb-brand-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #FFF;
  }

  /* A p element, not the template's h2 tag: the widget is on every page, and the client's rule is one
     H1 and at most three H2 per page (six popup titles would have made the home page nine).
     These are popup labels, not content headings; the dialogs are still named for assistive
     tech through aria-labelledby. text-wrap is the one thing the site's h2 rule was adding,
     kept here so the title wraps exactly as before - verified by identical screenshots. */
  .cn-cb-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.3px;
    color: #FFF;
    text-wrap: balance;
  }

  /* ---------- Body ---------- */
  .cn-cb-body {
    padding: 8px 28px 24px;
    position: relative;
  }

  /* Panes */
  .cn-cb-pane {
    display: none;
  }

  .cn-cb-pane.is-active {
    display: block;
    animation: cnCbPaneIn 0.3s ease forwards;
  }

  @keyframes cnCbPaneIn {
    from {
      opacity: 0;
      transform: translateY(6px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* ---------- Form fields ---------- */
  .cn-cb-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #A9C4BA;
    margin: 10px 0 6px;
  }

  .cn-cb-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #FFF;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
  }

  .cn-cb-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
  }

  .cn-cb-input:focus {
    border-color: #143F38;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(20, 63, 56, 0.25);
  }

  .cn-cb-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
  }

  .cn-cb-textarea {
    resize: vertical;
    min-height: 88px;
    font-family: inherit;
  }

  /* color-scheme makes native date/time pickers dark-mode aware */
  .cn-cb-input[type="date"],
  .cn-cb-input[type="time"] {
    color-scheme: dark;
  }

  /* Phone */
  .cn-cb-phone-wrap {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
  }

  .cn-cb-cc {
    padding: 13px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #FFF;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
  }

  .cn-cb-cc:focus {
    border-color: #143F38;
  }

  .cn-cb-cc option {
    background: #143F38;
    color: #FFF;
  }

  /* Two-column row */
  .cn-cb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* ---------- Submit ---------- */
  .cn-cb-submit {
    width: 100%;
    margin-top: 22px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--blue) 0%, #143F38 100%);
    color: #FFF;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 6px 18px rgba(20, 63, 56, 0.3);
    letter-spacing: 0.2px;
  }

  .cn-cb-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(20, 63, 56, 0.45);
  }

  .cn-cb-submit:active:not(:disabled) {
    transform: translateY(0);
  }

  .cn-cb-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }

  .cn-cb-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFF;
    border-radius: 50%;
    animation: cnCbSpin 0.7s linear infinite;
    display: inline-block;
  }

  @keyframes cnCbSpin {
    to {
      transform: rotate(360deg);
    }
  }

  /* ---------- Fine print ---------- */
  .cn-cb-fineprint {
    font-size: 11.5px;
    color: #A9C4BA;
    text-align: center;
    margin: 14px 0 0;
    line-height: 1.5;
  }

  .cn-cb-fineprint a {
    color: #143F38;
    text-decoration: none;
  }

  .cn-cb-fineprint a:hover {
    text-decoration: underline;
  }

  /* ---------- Success state ---------- */
  .cn-cb-success {
    text-align: center;
    padding: 32px 16px;
    animation: cnCbPaneIn 0.4s ease;
  }

  .cn-cb-success-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cnCbPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .cn-cb-success-icon svg {
    stroke: #B88A55;
  }

  @keyframes cnCbPop {
    0% {
      transform: scale(0);
    }

    100% {
      transform: scale(1);
    }
  }

  .cn-cb-success h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #FFF;
  }

  .cn-cb-success-msg {
    margin: 0;
    color: #A9C4BA;
    font-size: 14.5px;
    line-height: 1.55;
  }

  /* ---------- Error banner ---------- */
  .cn-cb-error-banner {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    color: #fecaca;
    font-size: 13.5px;
    text-align: center;
  }

  /* ---------- Footer ---------- */
  .cn-cb-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    font-size: 12px;
    color: #A9C4BA;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
  }

  .cn-cb-footer strong {
    color: #FFF;
    font-weight: 600;
  }

  /* ---------- Mobile ---------- */
  @media (max-width: 480px) {
    /* A real bar, edge to edge with its own ground, rather than two pills floating over
       whatever scrolls beneath them. */
    .cn-cb-fab-stack {
      bottom: 0;
      right: 0;
      left: 0;
      gap: 10px;
      flex-direction: row;
      align-items: stretch;
      justify-content: stretch;
      padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
      background: #FFF;
      border-top: 1px solid rgba(20, 63, 56, 0.12);
      box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
    }


    /* Room under the page for the bar, so the footer's last lines can still be read. */
    body {
      padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    }

    .cn-cb-fab {
      flex: 1 1 50%;
      width: auto;
      height: 46px;
      border-radius: 999px;
      border: 1.5px solid rgba(255, 255, 255, 0.25);
      gap: 8px;
      padding: 0 12px;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .cn-cb-fab:active {
      transform: scale(0.97);
    }

    .cn-cb-fab:hover {
      transform: none;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
    }

    .cn-cb-fab svg {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }

    .cn-cb-fab[data-label]::before {
      position: static;
      transform: none;
      background: transparent;
      box-shadow: none;
      padding: 0;
      opacity: 1;
      color: #FFF;
      font-size: 12.5px;
      font-weight: 700;
      letter-spacing: 0.2px;
    }

    /* Shorter mobile labels */
    #cnCbFab[data-label]::before {
      content: 'Call Us';
    }

    #cnCbWaFab[data-label]::before {
      content: 'WhatsApp';
    }

    .cn-cb-fab[data-label]::after {
      display: none;
    }

    .cn-cb-fab-pulse {
      display: none;
    }

    .cn-cb-modal {
      max-width: 100%;
    }

    .cn-cb-tab span {
      font-size: 11px;
    }

    .cn-cb-title {
      font-size: 18px;
    }

    .cn-cb-header {
      padding: 20px 20px 12px;
    }

    .cn-cb-body {
      padding: 6px 20px 20px;
    }

    .cn-cb-phone-wrap {
      grid-template-columns: 100px 1fr;
    }
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {

    .cn-cb-fab-pulse,
    .cn-cb-modal,
    .cn-cb-overlay,
    .cn-cb-pane,
    .cn-cb-success-icon,
    .cn-cb-spinner {
      animation: none !important;
    }
  }

/* The popups sit on the logo colour, so their text is white. Colour mapping turned the
   active tab indigo on indigo, which hid it. */
.cn-cb-overlay .cn-cb-tab { color: rgba(255, 255, 255, .82); }
.cn-cb-overlay .cn-cb-tab:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.cn-cb-overlay .cn-cb-tab.is-active, .cn-cb-overlay .cn-cb-tab.is-active svg { color: #143F38; }
.cn-cb-overlay .cn-cb-tab.is-active { background: #fff; }
.cn-cb-overlay .cn-cb-fineprint, .cn-cb-overlay label, .cn-cb-overlay .cn-cb-subtitle, .cn-cb-overlay .cn-cb-sub { color: rgba(255, 255, 255, .88); }
.cn-cb-overlay .cn-cb-submit:not(.cn-cb-wa-go) { color: #143F38; background: #fff; box-shadow: none; }
.cn-cb-overlay .cn-cb-submit:not(.cn-cb-wa-go):hover { color: #0B2420; background: #F5EFE4; }
.cn-cb-overlay .cn-cb-fineprint a { color: #fff; text-decoration: underline; }
.cn-cb-overlay .cn-cb-footer, .cn-cb-overlay .cn-cb-footer span { color: rgba(255, 255, 255, .82); }

/* ---------- Synerge fit ---------- */
/* Keep the hero slider arrows clear of the floating buttons until the container margin is wide enough. */
@media (min-width: 481px) and (max-width: 1439px) {
  .hero__arrows { margin-right: 74px; }
}
@media (max-width: 480px) {
  .cn-cb-brand-name { font-size: 18px; }
  .cn-cb-brand-icon { width: 38px; height: 38px; }
}
