/* ---------- Reset against host page (Webflow) globals ---------- */
  #smsPill, #smsPill *, #smsPill *::before, #smsPill *::after,
  #smsTrialOverlay, #smsTrialOverlay *, #smsTrialOverlay *::before, #smsTrialOverlay *::after {
    text-transform: none !important;
    letter-spacing: normal !important;
  }
  /* The CTA explicitly opts back into uppercase to match Webflow .btn-primary */
  #smsPill .sms-pill-cta,
  #smsPill .sms-pill-cta * {
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
  }

  :root {
    /* Match Webflow .btn-primary palette on solvedconsulting.com */
    --sms-gold:       #b6992c;          /* dark-goldenrod (btn-primary bg)        */
    --sms-gold-700:   #b6992c;          /* alias used elsewhere — same value      */
    --sms-gold-800:   #9a8124;          /* darker for shadows/text accents        */
    --sms-gold-light: #d4af37;          /* decorative gradient stop only          */
    --sms-gold-soft:  rgba(182, 153, 44, 0.12);
    --sms-ink:        #131313;          /* btn-primary text color                  */
    --sms-ink-hover:  #353535;          /* btn-primary hover bg (neutral--700)     */
    --sms-slate-900: #0f172a;
    --sms-slate-700: #334155;
    --sms-slate-600: #475569;
    --sms-slate-500: #64748b;
    --sms-slate-400: #94a3b8;
    --sms-slate-300: #cbd5e1;
    --sms-slate-200: #e2e8f0;
    --sms-slate-100: #f1f5f9;
    --sms-slate-50:  #f8fafc;
    --sms-white: #ffffff;
    --sms-danger: #b91c1c;
    --sms-danger-soft: #fee2e2;
    --sms-success: #047857;
    --sms-success-soft: #d1fae5;
    --sms-radius: 10px;
    --sms-radius-lg: 20px;
    --sms-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.30), 0 12px 24px -10px rgba(15, 23, 42, 0.18);
    --sms-ease: cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* ============================================================
     PILL · Morphing trigger → phone input
     ----------------------------------------------------------------
     The pill keeps the size of the collapsed CTA in document flow,
     so its expansion never reflows the surrounding layout. The form
     and the meta line are absolute-positioned children that pop out
     over neighbouring content when expanded.
     ============================================================ */
  .sms-pill {
    /* No font-family set — inherit the host page's font (Manrope
       on solvedconsulting.com) so the CTA matches every .btn-primary. */
    position: relative;
    display: inline-block;
    max-width: 100%;
  }

  /* The shell is just a positioning context — it never grows.
     The CTA owns its own dimensions (it's a real .btn-primary).        */
  .sms-pill-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: transparent;
    padding: 0;
  }

  /* CTA is the .btn-primary — keep it in flow always so the surrounding
     Webflow grid never reflows when we morph. When expanded, it's just
     hidden via visibility (space preserved).                            */
  .sms-pill-cta {
    cursor: pointer;
    transition: opacity 0.2s var(--sms-ease), visibility 0s linear 0.2s;
  }
  .sms-pill[data-sms-state="expanded"] .sms-pill-cta {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* Expanded form — pops out absolutely so it doesn't affect layout.
     Anchored to the embed wrapper's top-left so its width is bounded
     by the column it lives in (no viewport-overflow on mobile).        */
  .sms-pill-form {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 0;
    min-height: 60px;
    padding: 0;
    background: var(--sms-ink);
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    box-sizing: border-box;
    transition: width 0.4s var(--sms-ease),
                padding 0.4s var(--sms-ease),
                opacity 0.25s var(--sms-ease);
  }
  /* When expanded, the form takes 100% of the embed wrapper (which
     itself takes 100% of the column row). max-width caps it on
     desktop so it doesn't get unreasonably long.                       */
  .sms-pill[data-sms-state="expanded"] .sms-pill-form {
    width: 100%;
    max-width: 440px;
    padding: 8px;
    opacity: 1;
    pointer-events: auto;
  }

  .sms-pill-input {
    flex: 1;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: var(--sms-white);
    color: var(--sms-slate-900);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;                /* matches the 20px shell minus 8px padding */
    padding: 0 1rem;
    height: 48px;
    outline: none;
    transition: box-shadow 0.18s var(--sms-ease);
  }
  .sms-pill-input::placeholder { color: var(--sms-slate-400); font-weight: 400; }
  .sms-pill-input:focus { box-shadow: 0 0 0 3px var(--sms-gold-soft); }
  .sms-pill-input.is-invalid { box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.30); }

  .sms-pill-submit {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;                /* same radius family as the input         */
    background: var(--sms-gold);
    color: var(--sms-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s var(--sms-ease), color 0.2s var(--sms-ease), transform 0.2s var(--sms-ease);
  }
  .sms-pill-submit:hover {
    background: var(--sms-gold-light);
    transform: translateX(2px);
  }
  .sms-pill-submit:focus-visible {
    outline: 3px solid var(--sms-white);
    outline-offset: 2px;
  }
  .sms-pill-submit[disabled] { opacity: 0.7; cursor: not-allowed; transform: none; }
  .sms-pill-submit.is-loading .sms-pill-submit-icon { display: none; }
  .sms-pill-submit.is-loading .sms-pill-spinner { display: inline-block; }

  .sms-pill-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2.5px solid rgba(19, 19, 19, 0.25);
    border-top-color: var(--sms-ink);
    border-radius: 50%;
    animation: sms-pill-spin 0.7s linear infinite;
  }
  @keyframes sms-pill-spin { to { transform: rotate(360deg); } }

  /* Meta line under the pill — in flow when expanded so it pushes the
     second-row sibling buttons further down (no overlap).               */
  .sms-pill-meta {
    display: none;
    margin: 6px 0 0;
    padding: 0 0.5rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--sms-slate-600);
    max-width: min(440px, calc(100vw - 40px));
  }
  .sms-pill[data-sms-state="expanded"] .sms-pill-meta {
    display: block;
    animation: sms-meta-in 0.3s var(--sms-ease) 0.1s both;
  }
  @keyframes sms-meta-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .sms-pill-error {
    display: none;
    color: var(--sms-danger);
    font-weight: 500;
  }
  .sms-pill-error:not(:empty) { display: inline; }
  .sms-pill-error:not(:empty) ~ .sms-pill-consent,
  .sms-pill-meta:has(.sms-pill-error:not(:empty)) .sms-pill-consent { display: none; }

  /* ============================================================
     CONFIRMATION POPUP (success only)
     ============================================================ */
  .sms-trial-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.28s var(--sms-ease);
    /* No font-family override — inherits page font for consistency */
  }
  .sms-trial-overlay[hidden] { display: none; }
  .sms-trial-overlay.is-open { opacity: 1; }

  .sms-trial-modal {
    color: var(--sms-slate-900);
    background: var(--sms-white);
    border-radius: var(--sms-radius-lg);
    box-shadow: var(--sms-shadow);
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 2.25rem 2.25rem 2rem;
    position: relative;
    transform: translateY(16px) scale(0.985);
    transition: transform 0.28s var(--sms-ease);
  }
  .sms-trial-overlay.is-open .sms-trial-modal { transform: translateY(0) scale(1); }
  .sms-trial-modal::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sms-gold) 0%, var(--sms-gold-light) 100%);
    border-radius: var(--sms-radius-lg) var(--sms-radius-lg) 0 0;
  }

  .sms-trial-close {
    position: absolute; top: 0.625rem; right: 0.625rem;
    width: 2.5rem; height: 2.5rem;
    border: none; background: transparent;
    color: var(--sms-slate-600);
    cursor: pointer; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s var(--sms-ease), color 0.15s var(--sms-ease);
    z-index: 1;
  }
  .sms-trial-close:hover { background: var(--sms-slate-100); color: var(--sms-slate-900); }
  .sms-trial-close:focus-visible { outline: 3px solid var(--sms-gold-700); outline-offset: 2px; }

  .sms-trial-success {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
    animation: sms-trial-fade-in 0.4s var(--sms-ease) both;
  }
  @keyframes sms-trial-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .sms-trial-success-icon {
    width: 80px; height: 80px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--sms-success-soft);
    color: var(--sms-success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sms-trial-success-ring {
    transform-origin: 50% 50%;
    stroke-dasharray: 176;
    stroke-dashoffset: 176;
    animation: sms-trial-ring 0.6s var(--sms-ease) 0.05s forwards;
  }
  .sms-trial-success-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: sms-trial-check 0.4s var(--sms-ease) 0.5s forwards;
  }
  @keyframes sms-trial-ring  { to { stroke-dashoffset: 0; } }
  @keyframes sms-trial-check { to { stroke-dashoffset: 0; } }

  .sms-trial-success h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--sms-slate-900);
    line-height: 1.3;
  }
  .sms-trial-success > p {
    color: var(--sms-slate-600);
    font-size: 0.95rem;
    margin: 0 0 1.5rem;
    line-height: 1.55;
    font-weight: 400;
  }

  .sms-trial-checklist {
    list-style: none;
    padding: 1rem 1.25rem;
    margin: 0 auto 1.25rem;
    max-width: 360px;
    background: var(--sms-slate-50);
    border-radius: var(--sms-radius);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
  }
  .sms-trial-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--sms-slate-700);
    line-height: 1.45;
    font-weight: 400;
  }
  .sms-trial-checklist li svg { color: var(--sms-success); flex-shrink: 0; margin-top: 0.15rem; }
  .sms-trial-checklist strong { color: var(--sms-slate-900); font-weight: 600; }

  .sms-trial-success-hint {
    font-size: 0.85rem;
    color: var(--sms-slate-600);
    margin: 0 0 1.25rem;
    line-height: 1.5;
  }
  .sms-trial-success-hint a {
    color: var(--sms-gold-700);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.15s var(--sms-ease);
  }
  .sms-trial-success-hint a:hover { color: var(--sms-gold-800); }
  .sms-trial-success-hint a:focus-visible {
    outline: 2px solid var(--sms-gold-700);
    outline-offset: 2px;
    border-radius: 3px;
  }

  .sms-trial-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
  }
  .sms-trial-actions-center { justify-content: center; }
  .sms-trial-btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: 999px;
    padding: 0.875rem 1.625rem;
    cursor: pointer;
    transition: background-color 0.18s var(--sms-ease),
                transform 0.18s var(--sms-ease),
                box-shadow 0.18s var(--sms-ease);
  }
  .sms-trial-btn-primary {
    background: var(--sms-gold-700);
    color: var(--sms-white);
    box-shadow: 0 6px 14px -6px rgba(138, 112, 17, 0.55);
  }
  .sms-trial-btn-primary:hover {
    background: var(--sms-gold-800);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -8px rgba(110, 90, 14, 0.55);
  }
  .sms-trial-btn-primary:focus-visible {
    outline: 3px solid var(--sms-gold);
    outline-offset: 2px;
  }

  body.sms-trial-locked { overflow: hidden; }

  /* ============================================================
     Parent-row wrap behaviour (Webflow .flex-horizontal)
     ----------------------------------------------------------------
     Allow the host button row to wrap so that, when our pill expands,
     the sibling CTAs ("Schedule a free consultation", etc.) drop to a
     second row instead of being overlapped by the expanded form.
     This uses :has() (supported in all modern browsers since 2023).
     ============================================================ */
  .flex-horizontal:has(.sms-pill) { flex-wrap: wrap; }

  /* The Webflow embed wrapper becomes a positioning context for the
     absolute form, so the form's width can be a % of the column
     instead of the viewport — fixes overflow on mobile.                */
  .w-embed:has(.sms-pill) { position: relative; }

  /* When the pill is expanded, its embed wrapper takes a full row,
     pushing the sibling buttons to a second row.                       */
  .w-embed:has(> .sms-pill[data-sms-state="expanded"]),
  .w-embed:has(.sms-pill[data-sms-state="expanded"]) {
    flex-basis: 100%;
    width: 100%;
  }

  /* Mobile — the absolute form already uses calc(100vw - 40px)
     so it gracefully fits narrow viewports.                           */
