/* ============================================================
   Quote form — compact panel anchored under [data-quote-open]
   ============================================================ */

.quote-pop {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
}

.quote-pop[hidden] { display: none; }

/* Dim + light-dismiss layer */
.quote-pop__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 26, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .25s ease;
}

.quote-pop.is-open .quote-pop__backdrop { opacity: 1; }

/* ── Panel ─────────────────────────────────────────────────── */
.quote-pop__panel {
    position: absolute;
    top: var(--pop-top, 90px);
    left: var(--pop-left, 50%);
    width: 330px;
    max-width: calc(100vw - 2rem);
    /* Visible, or the caret hanging off the edge counts as overflow and the
       panel grows a scrollbar. Anchored placement only happens when the panel
       fits, so nothing needs to scroll here. */
    overflow: visible;
    padding: var(--space-5);
    border-radius: 16px;
    background: linear-gradient(180deg, #101A44 0%, #0A1235 100%);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 26px 60px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(14,95,232,.18);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .22s ease, transform .22s cubic-bezier(.2,.8,.3,1);
}

.quote-pop.is-open .quote-pop__panel {
    opacity: 1;
    transform: none;
}

/* Little arrow pointing back up at the button */
.quote-pop__caret {
    position: absolute;
    top: -6px;
    left: var(--pop-caret, 50%);
    width: 12px;
    height: 12px;
    margin-left: -6px;
    rotate: 45deg;
    background: #101A44;
    border-left: 1px solid rgba(255,255,255,.12);
    border-top: 1px solid rgba(255,255,255,.12);
    border-radius: 2px;
}

/* Flipped above the trigger — caret points down, and the gradient's dark end
   is what shows at the bottom edge */
.quote-pop.is-above .quote-pop__caret {
    top: auto;
    bottom: -6px;
    background: #0A1235;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.12);
    border-bottom: 1px solid rgba(255,255,255,.12);
}

/* Centred fallback — no room above or below, or a small screen */
.quote-pop.is-centered .quote-pop__panel {
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    width: min(360px, calc(100vw - 2rem));
    max-height: min(88vh, 640px);
    overflow-y: auto; /* the only placement that can outgrow the viewport */
}

.quote-pop.is-centered .quote-pop__caret { display: none; }

/* ── Close ─────────────────────────────────────────────────── */
.quote-pop__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.65);
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
}

.quote-pop__close:hover {
    color: #fff;
    background: rgba(255,255,255,.16);
}

/* ── Head ──────────────────────────────────────────────────── */
.quote-pop__head {
    margin-bottom: var(--space-4);
    padding-right: var(--space-8);
}

.quote-pop__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 var(--space-2);
}

.quote-pop__sub {
    font-size: .8rem;
    line-height: 1.5;
    color: rgba(255,255,255,.55);
    margin: 0;
}

/* ── Fields ────────────────────────────────────────────────── */
.quote-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* display:flex above would otherwise beat the UA rule for [hidden] */
.quote-form[hidden] { display: none; }

/* Success replaces the whole panel body, heading included */
.quote-pop.is-done .quote-pop__head { display: none; }

.quote-field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.quote-field__icon {
    position: absolute;
    left: 12px;
    display: inline-flex;
    color: rgba(255,255,255,.38);
    pointer-events: none;
    transition: color var(--transition);
}

.quote-field__control:focus-within .quote-field__icon { color: var(--color-accent); }

.quote-field input,
.quote-field select {
    width: 100%;
    padding: .8rem .9rem .8rem 2.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05);
    color: #fff;
    font-family: var(--font-body);
    font-size: .875rem;
    line-height: 1.4;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.quote-field input::placeholder { color: rgba(255,255,255,.4); }

.quote-field input:focus,
.quote-field select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(14,95,232,.12);
    box-shadow: 0 0 0 3px rgba(14,95,232,.2);
}

.quote-field select { padding-right: 2.4rem; cursor: pointer; color: rgba(255,255,255,.9); }
.quote-field select:invalid { color: rgba(255,255,255,.4); }
.quote-field select option { background: #0C1436; color: #fff; }

.quote-field__chevron {
    position: absolute;
    right: 12px;
    display: inline-flex;
    color: rgba(255,255,255,.45);
    pointer-events: none;
}

/* Invalid state */
.quote-field.has-error input,
.quote-field.has-error select {
    border-color: #F87171;
    background: rgba(248,113,113,.08);
}

.quote-field__error {
    margin: 6px 0 0;
    font-size: .74rem;
    color: #FCA5A5;
}
.quote-field__error:empty { display: none; }

/* Honeypot */
.quote-form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── Submit ────────────────────────────────────────────────── */
.quote-form__submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    margin-top: var(--space-1);
    padding: .85rem 1.2rem;
    border: 0;
    border-radius: 10px;
    background: var(--gradient-brand);
    background-size: 180% 100%;
    color: #fff;
    font-family: var(--font-heading);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 24px -12px rgba(14,95,232,.9);
    transition: background-position .5s ease, transform var(--transition), box-shadow var(--transition);
}

.quote-form__submit:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -12px rgba(14,95,232,.95);
}

.quote-form__submit:disabled { cursor: wait; opacity: .8; }

.quote-form__submit-arrow { transition: transform var(--transition); }
.quote-form__submit:hover:not(:disabled) .quote-form__submit-arrow { transform: translateX(3px); }

.quote-form__spinner {
    display: none;
    width: 15px;
    height: 15px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    animation: spinnerRotate .7s linear infinite;
}

.quote-form.is-sending .quote-form__submit-arrow { display: none; }
.quote-form.is-sending .quote-form__spinner { display: block; }

.quote-form__status {
    margin: 0;
    font-size: .78rem;
    color: #FCA5A5;
}
.quote-form__status:empty { display: none; }

.quote-form__note {
    margin: 0;
    text-align: center;
    font-size: .7rem;
    line-height: 1.5;
    color: rgba(255,255,255,.4);
}

/* ── Success state ─────────────────────────────────────────── */
.quote-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-block: var(--space-4) var(--space-2);
}

.quote-success[hidden] { display: none; }

.quote-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: var(--space-4);
    border-radius: var(--radius-full);
    background: rgba(74,222,128,.14);
    border: 1px solid rgba(74,222,128,.45);
    color: #4ADE80;
    animation: quotePop .4s cubic-bezier(.2,.9,.3,1.4);
}

@keyframes quotePop {
    from { transform: scale(.4); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

.quote-success__title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 var(--space-2);
}

.quote-success__text {
    font-size: .82rem;
    line-height: 1.6;
    color: rgba(255,255,255,.6);
    margin: 0 0 var(--space-5);
}

.quote-success__btn {
    padding: .6rem 1.5rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.06);
    color: #fff;
    font-family: var(--font-heading);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.quote-success__btn:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.35);
}

/* Locks the page behind the panel */
body.quote-modal-open { overflow: hidden; }

/* ── Small screens (JS adds .is-centered for the placement) ── */
@media (max-width: 640px) {
    .quote-pop__panel { padding: var(--space-6) var(--space-5); }

    /* 16px input text keeps iOS from zooming on focus */
    .quote-field input,
    .quote-field select { font-size: 1rem; padding-block: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
    .quote-pop__backdrop,
    .quote-pop__panel { transition: none; }
    .quote-pop__panel { transform: none; }
    .quote-success__icon { animation: none; }
    .quote-form__submit:hover:not(:disabled) { transform: none; }
}
