/*
 * Formularz leadów `[me360_formularz_kontaktowy]`. Wygląd 1:1 ze starymi formularzami Elementora
 * (popupy 4972, 4995, 5027, 6428, 6611): pola-pigułki na jasnym tle, turkusowy przycisk z ciemnym
 * kółkiem i strzałką. Selektory z `form.me360-lf`, bo motyw BuddyBoss stylizuje `input` globalnie.
 */
form.me360-lf {
    /* --lf-ink: ciemny tekst na turkusie (przycisk, ptaszek) — ten sam w obu motywach */
    --lf-ink: #0c1a27;
    --lf-text: var(--lf-ink);
    --lf-placeholder: var(--lf-ink);
    --lf-muted: #5a5a5a;
    --lf-link: inherit;
    --lf-field: rgba(203, 212, 210, 0.25);
    --lf-focus-bg: #fff;
    --lf-line: #d6d9dd;
    --lf-accent: #33e5bd;
    --lf-danger: #c62828;
    --lf-font: "ClashDisplay", "Clash Display", system-ui, sans-serif;

    /* bez `container-type`: w wyśrodkowanym kontenerze flex Elementora Chrome liczył wtedy wysokość
       przy zerowej szerokości (≈180 px pustego miejsca pod przyciskiem w popupie doradcy) */
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    margin: 0;
    font-family: var(--lf-font);
    color: var(--lf-text);
    /* kontenery Elementora często centrują tekst; zgoda i błędy mają być od lewej */
    text-align: left;
}

/* Nagłówek (zawsze, tekst wg wariantu): pogrubiony Clash Display */
form.me360-lf .me360-lf__title {
    margin: 0;
    color: var(--lf-text);
    font-family: var(--lf-font);
    font-size: clamp(20px, 1.6vw + 8px, 30px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-align: center;
}

/* Zeronest: wybrany pakiet pod nagłówkiem (wypełnia lead-form.js) */
form.me360-lf .me360-lf__chip {
    align-self: center;
    margin: -12px 0 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(51, 229, 189, 0.16);
    color: var(--lf-text);
    font-family: var(--lf-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

form.me360-lf .me360-lf__chip[hidden] {
    display: none;
}

/* doradca: wąska kolumna popupu 6428/6611 — „Skontaktuj się z doradcą" w jednej linii */
form.me360-lf--advisor .me360-lf__title {
    font-size: clamp(20px, 1.6vw + 2px, 24px);
}

/* wąski formularz (sidebar ~230 px; klasę daje lead-form.js) */
form.me360-lf.is-narrow {
    gap: 16px;
}

form.me360-lf.is-narrow .me360-lf__title {
    font-size: 20px;
}

form.me360-lf.is-narrow .me360-lf__input {
    font-size: 16px;
}

form.me360-lf.is-narrow .me360-lf__submit {
    padding-left: 16px;
    font-size: 14px;
}

form.me360-lf.is-narrow .me360-lf__submit-icon svg {
    width: 34px;
    height: 34px;
}

form.me360-lf .me360-lf__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* `visibility: hidden`: pole nie dostaje fokusu (Tab ani focus() pułapki fokusu popupu Elementora, który
   łapie pierwszy `:focusable`), więc tekst klienta nie trafi do pułapki. Bot dalej widzi pole w HTML. */
form.me360-lf .me360-lf__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
}

form.me360-lf .me360-lf__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font: inherit;
}

form.me360-lf .me360-lf__input {
    box-sizing: border-box;
    width: 100%;
    min-height: 41px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 32px;
    background: var(--lf-field);
    box-shadow: none;
    color: var(--lf-text);
    font-family: var(--lf-font);
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

form.me360-lf .me360-lf__input::placeholder {
    color: var(--lf-placeholder);
    opacity: 1;
}

form.me360-lf .me360-lf__textarea {
    min-height: 46px;
    line-height: 1.3;
    resize: vertical;
}

form.me360-lf .me360-lf__input:focus-visible {
    border-color: var(--lf-accent);
    background: var(--lf-focus-bg);
    box-shadow: 0 0 0 3px rgba(51, 229, 189, 0.3);
}

form.me360-lf .me360-lf__input[aria-invalid="true"] {
    border-color: var(--lf-danger);
}

form.me360-lf .me360-lf__input[aria-invalid="true"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.18);
}

form.me360-lf .me360-lf__error {
    padding: 0 14px;
    color: var(--lf-danger);
    font-size: 13px;
    line-height: 1.3;
}

form.me360-lf .me360-lf__error:empty {
    display: none;
}

/* Zgoda RODO */
form.me360-lf .me360-lf__consent {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

form.me360-lf .me360-lf__consent-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--lf-muted);
    font-family: var(--lf-font);
    font-size: 12.5px;
    line-height: 1.45;
    cursor: pointer;
}

form.me360-lf .me360-lf__consent-label a {
    color: var(--lf-link);
    text-decoration: underline;
}

form.me360-lf .me360-lf__checkbox {
    flex: 0 0 auto;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1px solid var(--lf-line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

form.me360-lf .me360-lf__checkbox:checked {
    border-color: var(--lf-accent);
    background: var(--lf-accent);
}

form.me360-lf .me360-lf__checkbox:checked::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--lf-ink);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

form.me360-lf .me360-lf__checkbox:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 229, 189, 0.35);
}

form.me360-lf .me360-lf__checkbox[aria-invalid="true"] {
    border-color: var(--lf-danger);
}

form.me360-lf .me360-lf__consent .me360-lf__error {
    padding-left: 30px;
}

/* Komunikat ogólny (błąd serwera, sieci) */
form.me360-lf .me360-lf__status {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--lf-text);
}

form.me360-lf .me360-lf__status:empty {
    display: none;
}

form.me360-lf .me360-lf__status.is-error {
    color: var(--lf-danger);
}

/* Przycisk: turkusowy gradient, ciemne kółko ze strzałką */
form.me360-lf .me360-lf__submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 4px 4px 4px 24px;
    border: 0;
    border-radius: 40px;
    background: linear-gradient(90deg, #47ffd6 0%, #68fddc 51%, #16dede 100%);
    color: var(--lf-ink);
    font-family: var(--lf-font);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    text-transform: none;
    cursor: pointer;
    transition: box-shadow 0.2s ease, filter 0.2s ease;
}

form.me360-lf .me360-lf__submit:hover {
    box-shadow: 0 6px 20px rgba(51, 229, 189, 0.35);
}

form.me360-lf .me360-lf__submit:focus-visible {
    outline: 3px solid rgba(12, 26, 39, 0.35);
    outline-offset: 2px;
}

form.me360-lf .me360-lf__submit:disabled {
    cursor: progress;
    filter: saturate(0.6);
    box-shadow: none;
}

form.me360-lf .me360-lf__submit-icon {
    display: inline-flex;
    flex: 0 0 auto;
    color: var(--lf-ink);
    transition: transform 0.2s ease;
}

form.me360-lf .me360-lf__submit-icon svg {
    display: block;
    width: 40px;
    height: 40px;
}

form.me360-lf .me360-lf__submit:hover:not(:disabled) .me360-lf__submit-icon {
    transform: translateX(2px);
}

/*
 * Motyw ciemny na telefonie: klasa `me360-lf-ciemny-mobile` na przodku (kolumna popupu doradcy
 * 6428/6611 w Elementorze → Zaawansowane → Klasy CSS). Jak dawny `Doradca_Form_Mobile`:
 * półprzezroczyste pola, biały tekst, turkusowy link, ten sam przycisk. Ciemne tło kolumny na
 * telefonie ustawia Elementor (responsywne tło kolumny), nie ten plik: jego selektor i tak wygrywa.
 */
@media (max-width: 767px) {
    .me360-lf-ciemny-mobile form.me360-lf {
        --lf-text: #fff;
        --lf-placeholder: rgba(255, 255, 255, 0.75);
        --lf-muted: #fff;
        --lf-link: #23c9a3;
        --lf-focus-bg: rgba(203, 212, 210, 0.32);
        --lf-danger: #ff8a80;
    }
}

@media (max-width: 767px) {
    form.me360-lf {
        gap: 16px;
    }

    form.me360-lf .me360-lf__input,
    form.me360-lf .me360-lf__submit {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    form.me360-lf .me360-lf__input,
    form.me360-lf .me360-lf__submit,
    form.me360-lf .me360-lf__submit-icon {
        transition: none;
    }
}
