﻿/**
 * PF Contact Form — frontend.css
 * Globalne style formularzy: zaokrąglone pola, pełny border, styl skinoe.
 */

/* intl-tel-input — dopasuj do stylu underline -------------------------------------------------------- */
.pf-cf-tel-input + .iti,
.iti {
    width: 100%;
    display: block;
}
.iti__tel-input {
    width: 100%;
}
.iti__flag-container {
    left: 0;
}

/* ═══════════
   WRAPPER & FORM
══════════════════════════════════════════════════════ */
.pf-cf-form-wrap {
    width: 100%;
}

.pf-cf-form-wrap--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: min-height .3s ease;
}

.pf-cf-form {
    width: 100%;
}

/* ══════════════════════════════════════════════════════
   GRID PÓL
══════════════════════════════════════════════════════ */
.pf-cf-fields-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pf-cf-field {
    position: relative;
    margin-bottom: 20px;
}

.pf-cf-field--half {
    width: 100%;
}

/* ══════════════════════════════════════════════════════
   ETYKIETA
══════════════════════════════════════════════════════ */
.pf-cf-field > label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: color-mix(in srgb, var(--contrast) 70%, transparent);
    margin-bottom: 6px;
    letter-spacing: .02em;
}

.pf-cf-required {
    color: #c0392b;
    margin-left: 1px;
}

/* ══════════════════════════════════════════════════════
   POLA TEKSTOWE — styl zaokrąglony (skinoe)
══════════════════════════════════════════════════════ */
.pf-cf-form input[type="text"],
.pf-cf-form input[type="email"],
.pf-cf-form input[type="tel"],
.pf-cf-form input[type="number"],
.pf-cf-form input[type="date"],
.pf-cf-form textarea,
.pf-cf-form select {
    display: block;
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: 8px;
    background-color: #ffffff;
    color: var(--contrast);
    outline: none;
    box-shadow: none;
    transition: border-color .3s ease, box-shadow .3s ease;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.pf-cf-form input[type="text"]:focus,
.pf-cf-form input[type="email"]:focus,
.pf-cf-form input[type="tel"]:focus,
.pf-cf-form input[type="number"]:focus,
.pf-cf-form input[type="date"]:focus,
.pf-cf-form textarea:focus,
.pf-cf-form select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
    outline: none;
}

.pf-cf-form input[type="text"]:focus-visible,
.pf-cf-form input[type="email"]:focus-visible,
.pf-cf-form input[type="tel"]:focus-visible,
.pf-cf-form input[type="number"]:focus-visible,
.pf-cf-form input[type="date"]:focus-visible,
.pf-cf-form textarea:focus-visible,
.pf-cf-form select:focus-visible {
    outline: none;
}

/* Invalid/error state */
.pf-cf-form input[aria-invalid="true"],
.pf-cf-form textarea[aria-invalid="true"],
.pf-cf-form select[aria-invalid="true"] {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

/* Placeholder */
.pf-cf-form input::placeholder,
.pf-cf-form textarea::placeholder {
    color: color-mix(in srgb, var(--contrast) 50%, transparent);
    opacity: 1;
    font-weight: 400;
}

/* Textarea */
.pf-cf-form textarea {
    resize: vertical;
    min-height: 150px;
}

/* Select — strzałka */
.pf-cf-form select {
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 10px 6px;
}

/* ══════════════════════════════════════════════════════
   KOMUNIKAT BŁĘDU POLA
══════════════════════════════════════════════════════ */
.pf-cf-field-error {
    display: block;
    font-size: 12px;
    color: #c0392b;
    margin-top: 3px;
    min-height: 16px;
    line-height: 1.3;
}

/* ══════════════════════════════════════════════════════
   RADIO — standardowe małe kółka (bez przepisywania togglem)
══════════════════════════════════════════════════════ */
.pf-cf-field--radio .pf-cf-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #222;
    margin-bottom: 6px;
    user-select: none;
}

.pf-cf-field--radio .pf-cf-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #1a3a5c;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════
   CHECKBOX — prostokątny toggle (Android-style, square)
══════════════════════════════════════════════════════ */

/* Ukryj natywny checkbox */
.pf-cf-field--checkbox .pf-cf-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Reset margin-bottom z .pf-cf-field > label dla checkboxa */
.pf-cf-field--checkbox > label {
    margin-bottom: 0;
}

/* Wrapper etykiety */
.pf-cf-field--checkbox .pf-cf-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    user-select: none;
    line-height: 1.5;
    position: relative;
}

/* Track (tło togglea) — ::before */
.pf-cf-field--checkbox .pf-cf-option::before {
    content: '';
    flex-shrink: 0;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: #bbb;
    border-radius: 3px;         /* lekko zaokrąglone, ale prostokąt jak na screenie */
    position: relative;
    transition: background .2s;
    margin-top: 1px;
}

/* Knob (kwadratowy przełącznik) — ::after */
.pf-cf-field--checkbox .pf-cf-option::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 4px;                   /* (24px track + 2*1px margin-top - 18px knob) / 2 = 3px + 1px margin-top */
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s, box-shadow .15s;
}

/* Stan aktywny — checked */
.pf-cf-field--checkbox .pf-cf-option input[type="checkbox"]:checked ~ span,
.pf-cf-field--checkbox .pf-cf-option:has(input[type="checkbox"]:checked)::before {
    background: var(--accent);
}

/* Przesuń knob w prawo gdy checked */
.pf-cf-field--checkbox .pf-cf-option:has(input[type="checkbox"]:checked)::after {
    transform: translateX(24px);
}

/* Focus ring — dostępność */
.pf-cf-field--checkbox .pf-cf-option:has(input[type="checkbox"]:focus-visible)::before {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Fallback dla przeglądarek bez :has() — używamy JS-owej klasy pf-cf-checked dodawanej przez frontend.js */
.pf-cf-field--checkbox .pf-cf-option.pf-cf-checked::before {
    background: var(--accent);
}
.pf-cf-field--checkbox .pf-cf-option.pf-cf-checked::after {
    transform: translateX(24px);
}

/* ══════════════════════════════════════════════════════
   PRZYCISK WYŚLIJ
══════════════════════════════════════════════════════ */
.pf-cf-btn--submit {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--contrast);
    border: 2px solid var(--contrast);
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s, color .2s, transform .3s ease, opacity .2s;
    margin-top: 8px;
    text-align: center;
    box-sizing: border-box;
}

.pf-cf-btn--submit:hover {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.pf-cf-btn--submit:disabled,
.pf-cf-btn--submit.pf-cf-btn--loading {
    opacity: .6;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════
   NAWIGACJA MULTI-STEP
══════════════════════════════════════════════════════ */
.pf-cf-btn--next,
.pf-cf-btn--prev {
    display: inline-block;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    margin-top: 8px;
    margin-right: 8px;
}

.pf-cf-btn--prev {
    background: #888;
}

.pf-cf-btn--next:hover  { background: #122d4a; }
.pf-cf-btn--prev:hover  { background: #666; }

.pf-cf-step-nav {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ══════════════════════════════════════════════════════
   STOPKA FORMULARZA (przycisk WYŚLIJ w single-step)
══════════════════════════════════════════════════════ */
.pf-cf-form-footer {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* Układ poziomy: captcha/turnstile po lewej, przycisk po prawej */
.pf-cf-form-footer--inline {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
}

.pf-cf-form-footer--inline .pf-cf-captcha-wrap {
    flex: 0 0 auto;
    align-self: flex-start;
}

.pf-cf-form-footer--inline .pf-cf-btn--submit {
    flex: 0 0 50%;
    width: 50%;
    margin-top: 5px;
    margin-left: 10px;
}

/* ══════════════════════════════════════════════════════
   ANIMACJE — sukces (chowanie formularza + pojawianie thank you)
══════════════════════════════════════════════════════ */
@keyframes escCfFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-12px); }
}

@keyframes escCfFadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes escCfFadeOutDown {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(12px); }
}

.pf-cf-form--success-hide {
    animation: escCfFadeOut .35s ease forwards;
    pointer-events: none;
}

.pf-cf-form--animate-in {
    animation: escCfFadeInUp .4s ease both;
}

.pf-cf-form-messages--animate-in {
    animation: escCfFadeInUp .4s ease .05s both;
}

.pf-cf-form-messages--animate-out {
    animation: escCfFadeOutDown .35s ease forwards;
    pointer-events: none;
}


.pf-cf-form-messages {
    font-size: 14px;
    margin-top: 0;
    min-height: 0;
}

.pf-cf-form-messages--success {
    color: #1e7e34;
    padding: 14px 18px;
    background: #d4edda;
    border-left: 4px solid #1e7e34;
    border-radius: 6px;
    width: 100%;
    margin-top: 16px;
    font-weight: 500;
}

.pf-cf-form-messages--error {
    color: #721c24;
    padding: 14px 18px;
    background: #f8d7da;
    border-left: 4px solid #c0392b;
    border-radius: 6px;
    margin-top: 16px;
}

/* ══════════════════════════════════════════════════════
   PASEK KROKÓW (multi-step)
══════════════════════════════════════════════════════ */
.pf-cf-steps-bar {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.pf-cf-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 10px;
    font-size: 13px;
    color: #999;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: default;
}

.pf-cf-step--active {
    color: #1a3a5c;
    border-bottom-color: #1a3a5c;
    font-weight: 600;
}

.pf-cf-step--completed {
    color: #1e7e34;
    border-bottom-color: #1e7e34;
}

.pf-cf-step-indicator__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e0e0e0;
    font-size: 12px;
    font-weight: 700;
    color: #666;
}

.pf-cf-step--active   .pf-cf-step-indicator__num { background: #1a3a5c; color: #fff; }
.pf-cf-step--completed .pf-cf-step-indicator__num { background: #1e7e34; color: #fff; }

/* ══════════════════════════════════════════════════════
   CAPTCHA WRAP
══════════════════════════════════════════════════════ */
.pf-cf-captcha-wrap {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pf-cf-turnstile-container {
    width: fit-content;
}

.pf-cf-captcha-wrap--invisible {
    margin: 0;
}

/* ══════════════════════════════════════════════════════
   RESPONSYWNOŚĆ
══════════════════════════════════════════════════════ */
@media (min-width: 640px) {
    .pf-cf-fields-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 24px;
    }

    .pf-cf-field--full {
        grid-column: 1 / -1;
    }

    .pf-cf-field--half {
        grid-column: auto;
    }

    .pf-cf-form-footer {
        align-items: stretch;
    }

    .pf-cf-form-footer--inline {
        align-items: flex-start;
    }
}

@media (max-width: 639px) {
    .pf-cf-form input[type="text"],
    .pf-cf-form input[type="email"],
    .pf-cf-form input[type="tel"],
    .pf-cf-form input[type="number"],
    .pf-cf-form input[type="date"],
    .pf-cf-form textarea,
    .pf-cf-form select {
        padding: 12px 15px;
        font-size: 14px;
    }

    .pf-cf-btn--submit {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* inline footer resetuje się do pionowego na mobile */
    .pf-cf-form-footer--inline {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ══════════════════════════════════════════════════════
   TOGGLE BUTTON FIELD
══════════════════════════════════════════════════════ */
.pf-cf-field--toggle_button {
    display: flex;
    justify-content: center;
    margin-bottom: 12px !important;
}

.pf-cf-field--toggle_button .pf-cf-field-error {
    display: none;
}

.pf-cf-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem 2rem;
    background: #0E4577;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background .2s;
    line-height: 1.4;
}

.pf-cf-toggle-btn:hover {
    background: #0a2d4e;
}

.pf-cf-toggle-btn__chevron {
    font-size: .8em;
    transition: transform .25s ease;
    flex-shrink: 0;
}

.pf-cf-toggle-btn[aria-expanded="true"] .pf-cf-toggle-btn__chevron {
    transform: rotate(180deg);
}

/* ══════════════════════════════════════════════════════
   SELECT2 — styl zaokrąglony (pasujący do reszty pól)
══════════════════════════════════════════════════════ */
.pf-cf-field .select2-container {
    width: 100% !important;
}

/* Pole wyboru (ramka zaokrąglona) */
.pf-cf-field .select2-container--default .select2-selection--multiple {
    background: var(--base);
    border: 1px solid color-mix(in srgb, var(--contrast) 30%, transparent);
    border-radius: 8px;
    padding: 8px 20px;
    min-height: 50px;
    box-shadow: none;
    cursor: text;
    transition: border-color .3s ease, box-shadow .3s ease;
}

.pf-cf-field .select2-container--default.select2-container--focus .select2-selection--multiple,
.pf-cf-field .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--contrast-2);
    box-shadow: 0 0 0 3px rgba(43, 42, 41, 0.1);
    outline: none;
}

/* Lista chipów — override select2 float layout → flex */
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 !important;
    margin: 0;
    gap: 4px;
}

/* Placeholder */
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #999;
    font-size: 14px;
    line-height: 28px;
    padding: 0;
}

/* Pole wyszukiwania — select2 v4.1 używa <textarea> */
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-search {
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
}
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-search__field,
.pf-cf-field .select2-container .select2-search--inline .select2-search__field,
.pf-cf-field textarea.select2-search__field {
    box-sizing: border-box !important;
    font-size: 14px !important;
    color: #222;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    height: 20px !important;
    min-height: 0 !important;
    max-height: 20px !important;
    line-height: 20px !important;
    resize: none !important;
    overflow: hidden !important;
    vertical-align: middle;
}

/* Chip — select2 domyślnie: position:relative, padding-left:20px (na absolutny ×).
   Zastępujemy to flexem: × jest w normalnym flow */
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__choice {
    position: static !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    background: #0E4577;
    color: #fff;
    border: none !important;
    border-radius: 12px;
    padding: 3px 8px !important;
    padding-left: 10px !important;
    font-size: 12px;
    line-height: 1.4;
    margin: 2px 0 !important;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
}

/* Tekst wewnątrz chipa */
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    order: 1;
    padding: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Przycisk × — select2 domyślnie: position:absolute; left:0; top:0.
   Resetujemy do static i stylujemy w linii */
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    order: 2;
    position: static !important;
    left: auto !important;
    top: auto !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.2) !important;
    outline: none;
}
.pf-cf-field .select2-container--default .select2-selection--multiple .select2-selection__choice__remove span {
    line-height: 1;
}

/* Dropdown */
.select2-dropdown {
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    z-index: 9999;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #0E4577;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: #e8eef6;
    color: #0E4577;
}

/* Podpowiedź o wielokrotnym wyborze */
.pf-cf-multiselect-hint {
    display: block;
    color: #aaa;
    font-size: 11px;
    margin-top: 3px;
    line-height: 1.3;
}
