/* PlayServe lead-capture CTA — namespaced under .ps-lead- to avoid leaking into tenant themes. */
#ps-lead-cta, #ps-lead-cta * { box-sizing: border-box; }

/* ---- Collapsed badge: "Powered by PlayServe.co" + logo ---- */
.ps-lead-pill {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: 0.4rem 0.4rem 0.4rem 0.9rem;
    border: none; cursor: pointer;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 6px 20px rgba(8,30,22,0.18), 0 0 0 1px rgba(8,30,22,0.06);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    font-family: inherit; line-height: 1;
    transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.ps-lead-pill:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(8,30,22,0.26), 0 0 0 1px rgba(8,30,22,0.08); }
.ps-lead-pill__text { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ps-lead-pill__by { font-size: 10px; font-weight: 500; color: #8a94a3; letter-spacing: 0.01em; }
.ps-lead-pill__brand { font-size: 12px; font-weight: 800; color: #0b3d2e; letter-spacing: 0.01em; }
.ps-lead-pill__logo {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 999px;
    background: #0b3d2e; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(8,30,22,0.35);
    animation: ps-lead-pulse 2.6s ease-in-out 1.5s 3;
}
.ps-lead-pill__logo img { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; }
@keyframes ps-lead-pulse {
    0%,100% { box-shadow: 0 4px 12px rgba(8,30,22,0.35), 0 0 0 0 rgba(120,190,40,0.5); }
    50%     { box-shadow: 0 4px 12px rgba(8,30,22,0.35), 0 0 0 10px rgba(120,190,40,0); }
}

/* ---- CTA card ---- */
.ps-lead-card {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 61;
    width: min(340px, calc(100vw - 2rem));
    padding: 1.5rem 1.5rem 1.35rem;
    border-radius: 22px;
    background: linear-gradient(155deg, #0f5138 0%, #0b3d2e 100%);
    box-shadow: 0 18px 40px rgba(8,30,22,0.42);
    color: #eafaf2;
    font-family: inherit;
    animation: ps-lead-card-in 0.32s cubic-bezier(0.22,1,0.36,1);
}
.ps-lead-card[hidden] { display: none; }
@keyframes ps-lead-card-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ps-lead-card__close {
    position: absolute; top: 0.6rem; right: 0.7rem;
    background: none; border: none; cursor: pointer;
    font-size: 1.4rem; line-height: 1; color: rgba(255,255,255,0.7);
    width: 28px; height: 28px; border-radius: 999px;
}
.ps-lead-card__close:hover { background: rgba(255,255,255,0.14); color: #fff; }
.ps-lead-card__eyebrow {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: #8fe05a; margin-bottom: 0.5rem;
}
.ps-lead-card__title {
    font-size: 1.18rem; font-weight: 800; line-height: 1.3;
    margin-bottom: 0.5rem; color: #ffffff;
}
.ps-lead-card__sub {
    font-size: 0.85rem; line-height: 1.45; color: rgba(234,250,242,0.82);
    margin-bottom: 1.1rem;
}
.ps-lead-card__cta {
    display: block; width: 100%;
    padding: 0.85rem 1rem; border: none; cursor: pointer;
    border-radius: 999px;
    background: #ef4444; color: #fff;
    font-size: 1rem; font-weight: 700;
    box-shadow: 0 6px 16px rgba(239,68,68,0.4);
    transition: background 0.18s ease, transform 0.15s ease;
}
.ps-lead-card__cta:hover { background: #dc2626; transform: translateY(-1px); }

/* ---- Modal ---- */
.ps-lead-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; }
.ps-lead-modal[hidden] { display: none; }
.ps-lead-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,20,0.55);
    backdrop-filter: blur(2px);
}
.ps-lead-modal__panel {
    position: relative;
    width: min(640px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    margin: 0;
    background: #fff; border-radius: 22px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 30px 70px rgba(0,0,0,0.45);
    animation: ps-lead-card-in 0.3s cubic-bezier(0.22,1,0.36,1);
}
.ps-lead-modal__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.15rem 1.5rem;
    background: linear-gradient(120deg, #0f5138 0%, #0b3d2e 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.ps-lead-modal__header h2 {
    margin: 0; font-size: 1.3rem; font-weight: 800; color: #ffffff;
    display: flex; align-items: center; gap: 0.5rem;
}
.ps-lead-modal__spark { color: #8fe05a; }
.ps-lead-modal__close {
    background: none; border: none; cursor: pointer;
    font-size: 1.6rem; line-height: 1; color: rgba(255,255,255,0.8);
    width: 34px; height: 34px; border-radius: 999px;
}
.ps-lead-modal__close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.ps-lead-modal__body { padding: 1.4rem 1.5rem 1.6rem; overflow-y: auto; flex: 1; min-height: 0; }
.ps-lead-form__intro { margin: 0 0 1.25rem; color: #6b7280; font-size: 0.95rem; line-height: 1.5; }

/* Cal.com direct-booking pill (alternative to the form) */
.ps-lead-calbtn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 0.85rem 1rem;
    border-radius: 999px; background: #0b3d2e; color: #fff;
    font-size: 0.95rem; font-weight: 700; text-decoration: none;
    box-shadow: 0 6px 16px rgba(8,30,22,0.25);
    transition: background 0.18s ease, transform 0.15s ease;
}
.ps-lead-calbtn:hover { background: #0f5138; transform: translateY(-1px); }
.ps-lead-calbtn svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.ps-lead-or { display: flex; align-items: center; text-align: center; color: #9ca3af; font-size: 0.8rem; margin: 1rem 0; }
.ps-lead-or::before, .ps-lead-or::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }
.ps-lead-or span { padding: 0 0.75rem; }

.ps-lead-section {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em;
    text-transform: uppercase; color: #9ca3af;
    margin: 1.1rem 0 0.75rem;
}
.ps-lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ps-col-2 { grid-column: 1 / -1; }
.ps-lead-field {
    display: flex; flex-direction: column; gap: 0.4rem;
    min-width: 0;
}
.ps-lead-label {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem;
    font-size: 0.9rem; font-weight: 600; color: #374151;
}
.ps-opt { font-size: 0.75rem; font-weight: 500; color: #9ca3af; white-space: nowrap; }
.ps-req { color: #ef4444; }
.ps-lead-field input, .ps-lead-field select {
    width: 100%; padding: 0.7rem 0.85rem;
    border: 1px solid #e5e7eb; border-radius: 12px;
    font-size: 0.95rem; font-weight: 400; color: #111827;
    background: #fff; font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ps-lead-field input:focus, .ps-lead-field select:focus {
    outline: none; border-color: #1f8f4e;
    box-shadow: 0 0 0 3px rgba(31,143,78,0.18);
}
.ps-lead-field input::placeholder { color: #b6bcc4; }
.ps-err { display: block; margin-top: 0.3rem; color: #dc2626; font-size: 0.78rem; font-weight: 500; }

.ps-lead-radio { border: none; margin: 1.1rem 0 0; padding: 0; }
.ps-lead-radio legend { font-size: 0.9rem; font-weight: 600; color: #374151; margin-bottom: 0.5rem; padding: 0; }
.ps-lead-radio label { display: inline-flex; align-items: center; gap: 0.45rem; margin-right: 1.5rem; font-size: 0.92rem; color: #374151; cursor: pointer; }

.ps-lead-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.ps-lead-submit {
    flex: 1; padding: 0.9rem 1rem; border: none; cursor: pointer;
    border-radius: 999px; background: #ef4444; color: #fff;
    font-size: 1rem; font-weight: 700;
    box-shadow: 0 6px 16px rgba(239,68,68,0.35);
    transition: background 0.18s ease, transform 0.15s ease;
}
.ps-lead-submit:hover:not(:disabled) { background: #dc2626; transform: translateY(-1px); }
.ps-lead-submit:disabled { opacity: 0.7; cursor: default; }
.ps-lead-cancel { background: none; border: none; cursor: pointer; color: #6b7280; font-size: 0.95rem; font-weight: 600; }
.ps-lead-cancel:hover { color: #374151; }

/* ---- In-modal success state (replaces the success toast) ---- */
.ps-lead-success {
    padding: 2.75rem 1.75rem 2.5rem;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
    animation: ps-lead-card-in 0.3s cubic-bezier(0.22,1,0.36,1);
}
.ps-lead-success[hidden] { display: none; }
.ps-lead-success__check {
    width: 68px; height: 68px; border-radius: 999px;
    background: #e7f8ee; color: #1f8f4e;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; line-height: 1;
    box-shadow: 0 0 0 8px rgba(31,143,78,0.08);
}
.ps-lead-success__title { margin: 0.25rem 0 0; font-size: 1.4rem; font-weight: 800; color: #0b3d2e; }
.ps-lead-success__text { margin: 0; max-width: 30rem; color: #6b7280; font-size: 0.95rem; line-height: 1.55; }
.ps-lead-success__done {
    margin-top: 0.6rem; padding: 0.8rem 2.2rem; border: none; cursor: pointer;
    border-radius: 999px; background: #0b3d2e; color: #fff; font-size: 0.95rem; font-weight: 700;
    transition: background 0.18s ease, transform 0.15s ease;
}
.ps-lead-success__done:hover { background: #0f5138; transform: translateY(-1px); }

/* Honeypot — hidden from users, visible to bots */
.ps-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Hide Google's reCAPTCHA v3 badge (it collides with our bottom-right badge).
   Google's terms permit this AS LONG AS the reCAPTCHA disclosure text is shown
   in the form — see .ps-lead-legal in the modal. */
.grecaptcha-badge { visibility: hidden !important; }
.ps-lead-legal { margin-top: 0.9rem; font-size: 0.72rem; line-height: 1.5; color: #9ca3af; text-align: center; }
.ps-lead-legal a { color: #6b7280; text-decoration: underline; }

/* ---- Mobile: card becomes a full-width bottom card; clear the sticky book bar ---- */
@media (max-width: 899px) {
    .ps-lead-card {
        left: 0.75rem; right: 0.75rem; width: auto;
        bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px) + 70px);
        max-height: 75vh; overflow-y: auto;
    }
    /* Badge sits in the reserved right slot of the "Book a court" bar (or the
       bottom-right corner on pages without the bar) — not floating above it. */
    .ps-lead-pill { bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px)); right: 0.85rem; }
    /* While the card is open, hide the badge so the two don't stack */
    #ps-lead-cta:has(.ps-lead-card:not([hidden])) .ps-lead-pill { display: none; }
    .ps-lead-modal__panel { width: calc(100vw - 1.25rem); max-height: calc(100dvh - 1.25rem); border-radius: 18px; }
    .ps-lead-modal__header { padding: 1rem 1.15rem; }
    .ps-lead-modal__header h2 { font-size: 1.15rem; }
    .ps-lead-modal__body { padding: 1.15rem 1.15rem 1.35rem; }
}
@media (max-width: 640px) {
    .ps-lead-grid { grid-template-columns: 1fr; }
    .ps-lead-actions { flex-direction: column-reverse; align-items: stretch; }
    .ps-lead-cancel { padding: 0.6rem; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .ps-lead-pill, .ps-lead-pill__logo, .ps-lead-card, .ps-lead-modal__panel, .ps-lead-card__cta, .ps-lead-submit { animation: none !important; transition: none !important; }
}
