/* -----------------------------------------------------------
   Compact glass bar — Lottie and text perfectly aligned
   + subtle gradient edge glow + comfy Send button padding
   ----------------------------------------------------------- */

.search-bar {
    /* theme */
    --glass-bg: rgba(255, 255, 255, .70);
    --glass-border: rgba(11, 18, 32, .10);
    --text: #0b1220;
    --muted: rgba(11, 18, 32, .55);

    /* sizing (tweak these) */
    --lottie-size: 44px;
    /* icon size AND input height */
    --pad-v: 14px;
    /* card vertical padding */
    --pad-h: 16px;
    /* card horizontal padding */
    --radius: 22px;
    /* corner radius */

    /* edge glow controls */
    --glow-1: #424DFE;
    --glow-2: #7271FB;
    --glow-3: #E6D9FF;
    --glow-opacity: .28;
    /* overall subtlety */
    --glow-blur: 16px;
    /* softness */
    --glow-spread: 10px;
    /* how far outside the card */
    --glow-thickness-outer: 10px;
    /* outer ring thickness */
    --glow-thickness-inner: 14px;
    /* inner cutout (bigger = thinner ring) */

    width: 90%;
    max-width: 900px;
    padding: var(--pad-v) var(--pad-h);
    margin: 0 auto;
    border-radius: var(--radius);
    position: relative;

    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18),
        0 0 0 1px rgba(11, 18, 32, .06) inset;
    /* gentle inner edge */
    z-index: 1;
}

/* glossy inner stroke */
.search-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .15));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* static edge glow that matches the bar's rounded rectangle */
.search-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    /* sit exactly on the bar */
    border-radius: 22px;
    /* <-- match your .search-bar border-radius */
    padding: 10px;
    /* ring thickness (adjust 6–14px) */
    background: linear-gradient(135deg, #424DFE, #7271FB);
    filter: blur(16px);
    /* softness of the glow */
    opacity: .28;
    /* overall subtlety */
    pointer-events: none;
    z-index: -1;

    /* carve out the inside so only a thin ring glows */
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

@keyframes glow-spin {
    to {
        transform: rotate(1turn);
    }
}

@media (prefers-reduced-motion: reduce) {
    .search-bar::after {
        animation: none;
    }
}

/* Fallback if backdrop-filter unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .search-bar {
        background: rgba(20, 20, 20, .7);
    }
}

/* Lottie: vertically centered to the whole card */
.sb-lottie {
    position: absolute;
    left: var(--pad-h);
    top: 50%;
    transform: translateY(-50%);
    width: var(--lottie-size);
    height: var(--lottie-size);
    pointer-events: none;
    opacity: .95;
    z-index: 2;
}

/* Input: one line, exactly as tall as the Lottie, text centered */
.sb-input {
    width: 100%;
    height: var(--lottie-size);
    line-height: var(--lottie-size);
    /* perfect vertical centering */
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    font-size: 18px;
    color: var(--text);
    caret-color: var(--text);
    padding: 0;
    padding-left: calc(var(--pad-h) + var(--lottie-size) + 12px);
    /* room for Lottie */
    box-sizing: border-box;
}

/* placeholder */
.sb-input::placeholder {
    color: var(--muted);
}

/* Bottom row — only Send button, with extra space from edges */
.sb-bottom {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 12px 12px 10px 0;
    /* add air around the button */
}

/* Round send button */
.sb-icon-btn {
    height: 42px;
    width: 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    border: 0;
    box-sizing: border-box;
    /* include padding in h/w */
    transition: transform .12s ease, filter .2s ease;
}

.sb-icon-btn.sb-send {
    padding: 8px;
    /* bigger hit area inside the circle */
    background: linear-gradient(135deg, #424DFE, #7271FB);
    box-shadow: 0 10px 24px rgba(66, 77, 254, .35);
}

.sb-icon-btn.sb-send i {
    font-size: 20px;
    line-height: 1;
}

.sb-icon-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

/* Remove the Search chip if present */
.sb-chip {
    display: none !important;
}

/* autofill fix */
.search-bar .sb-input:-webkit-autofill,
.search-bar .sb-input:-webkit-autofill:hover,
.search-bar .sb-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    transition: background-color 9999s ease-out;
    box-shadow: 0 0 0 1000px transparent inset;
}

/* light intro overrides */
.intro .search-bar {
    --glass-bg: rgba(255, 255, 255, .70);
    --glass-border: rgba(11, 18, 32, .10);
    --text: #0b1220;
    --muted: rgba(11, 18, 32, .55);

    /* Want a bigger animation in the hero? Bump it here: */
    --lottie-size: 96px;
    /* try 72–120px */
    --pad-v: 10px;
    --pad-h: 14px;
}

/* responsive */
@media (max-width:768px) {
    .search-bar {
        --lottie-size: 38px;
        --pad-v: 12px;
        --pad-h: 14px;
    }

    .sb-input {
        font-size: 16px;
    }

    .sb-bottom {
        margin-top: 6px;
    }
}

/* CTA button: "Generate leads" */
.sb-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);

    font-weight: 400 !important;
    /* or 'normal' */
    font-size: 15px;
    line-height: 1;
    color: #fff;

    background: linear-gradient(135deg, #424DFE, #7271FB);
    box-shadow: 0 10px 24px rgba(66, 77, 254, 0.35);

    cursor: pointer;
    transition: transform .12s ease, filter .2s ease, box-shadow .2s ease;
}

.sb-cta i {
    font-size: 18px;
    line-height: 1;
}

.sb-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 12px 28px rgba(66, 77, 254, 0.45);
}

/* keep it bottom-right with a little breathing room */
.sb-bottom {
    display: flex;
    justify-content: flex-end;
    padding: 12px 12px 10px 0;
    /* top right bottom left */
    margin-top: 8px;
}

/* Make input text grey + normal weight */
.search-bar .sb-input {
    color: var(--muted) !important;
    -webkit-text-fill-color: var(--muted);
    font-weight: 400;
    caret-color: var(--muted);
}

/* Ensure absolute children align inside the field */
.sb-field {
    position: relative;
}

/* Ghost generated line (aligned to Lottie’s middle) */
.sb-ghost {
    position: absolute;
    left: calc(var(--pad-h, 16px) + var(--lottie-size, 44px) + 12px);
    top: 50%;
    transform: translateY(-50%);
    height: var(--lottie-size, 44px);
    line-height: var(--lottie-size, 44px);
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
    font-weight: 400;
    z-index: 1;
}

/* Blinking caret */
.sb-ghost::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 0.9em;
    margin-left: 4px;
    background: currentColor;
    animation: sb-caret-blink 1s steps(1, end) infinite;
    vertical-align: -2px;
    border-radius: 1px;
}

@keyframes sb-caret-blink {
    50% {
        opacity: 0;
    }
}

/* Mobile alignment keeps ghost positioned correctly */
@media (max-width:768px) {
    .sb-ghost {
        left: calc(var(--pad-h, 16px) + var(--lottie-size, 44px) + 12px);
    }
}