/* ── Form: Dofinansowanie BUR/KFS ────────────────────────────────────────── */

.ff-block {
    padding: 96px 0;
    background: var(--wp--preset--color--dark, #2E2E39);
    color: var(--wp--preset--color--white);
}

/* ── Layout: form pinned to the left ~50% column, like form-courses ────────── */

.ff-layout {
    display: flex;
}

.ff-form-col {
    width: 50%;
    max-width: 640px;
    min-width: 0;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.ff-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.ff-header[hidden] {
    display: none;
}

.ff-title {
    margin: 0;
    font-size: 40px;
    font-weight: 400;
    line-height: 1;
    color: var(--wp--preset--color--white);
}

.ff-header-line {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.ff-desc {
    margin: 0;
    font-size: 16px;
    font-weight: 300;
    line-height: 24px;
    color: var(--wp--preset--color--neutral-100);
}

.ff-program-name {
    margin: 0 0 40px;
    font-size: 32px;
    font-weight: 300;
    color: var(--wp--preset--color--white);
    line-height: 1;
}

.ff-step-label {
    margin: 0 0 40px;
    font-size: 24px;
    font-weight: 300;
    color: var(--wp--preset--color--white);
}

/* ── Section label ────────────────────────────────────────────────────────── */

.ff-section-label-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 32px 0 20px;
}

.ff-section-label {
    font-size: 16px;
    font-weight: 300;
    color: var(--wp--preset--color--neutral-100);
    line-height: 24px;
}

.ff-section-line {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

/* ── Type cards ───────────────────────────────────────────────────────────── */

.ff-type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ff-type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: var(--wp--preset--color--black);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.ff-type-card.is-selected {
    border-color: var(--wp--preset--color--white);
}

/* ── Chooser tiles (program picker, reuses .ff-type-card) ───────────────────── */

.ff-chooser-card {
    text-decoration: none;
}

.ff-chooser-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.ff-chooser-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 20px;
    color: var(--wp--preset--color--white);
}

.ff-type-radio-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ff-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #FAF8FF;
    color: var(--wp--preset--color--purple-500, #430B8E);
}

.ff-type-icon svg {
    width: 20px;
    height: 20px;
}

.ff-type-radio {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.ff-type-card.is-selected .ff-type-radio {
    border-color: var(--wp--preset--color--white);
}

.ff-type-card.is-selected .ff-type-radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--wp--preset--color--white);
}

.ff-type-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--wp--preset--color--white);
}

.ff-type-desc {
    font-size: 14px;
    font-weight: 300;
    color: #e4e4ea;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */

.ff-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ff-input,
.ff-select {
    height: 56px;
    padding: 0 24px;
}

.ff-input,
.ff-textarea,
.ff-select {
    width: 100%;
    box-sizing: border-box;
    background: var(--wp--preset--color--black);
    border: none;
    border-radius: 4px;
    color: var(--wp--preset--color--white);
    font-family: inherit;
    font-size: 14px;
    font-weight: 300;
    line-height: 20px;
    outline: none;
    transition: box-shadow 0.15s, padding-top 0.15s ease, padding-bottom 0.15s ease;
}

.ff-textarea {
    padding: 18px 24px;
    resize: vertical;
    min-height: 100px;
}

.ff-input:focus,
.ff-textarea:focus,
.ff-select:focus {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Shift the value down as the label floats up into the vacated space,
   instead of just cross-fading the label in place. */
.ff-input:focus,
.ff-input:not(:placeholder-shown),
.ff-textarea:focus,
.ff-textarea:not(:placeholder-shown),
.ff-select-wrap.is-floated .ff-select {
    padding-top: 18px;
    padding-bottom: 0;
}

.ff-input.ff-invalid,
.ff-textarea.ff-invalid,
.ff-select.ff-invalid {
    box-shadow: inset 0 0 0 1px #fc8181;
}

.ff-error-tip {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 300;
    line-height: 16px;
    color: #fc8181;
}

.ff-select-wrap {
    position: relative;
}

.ff-select {
    appearance: none;
    cursor: pointer;
    padding-right: 48px;
}

.ff-select:invalid {
    color: rgba(255, 255, 255, 0.5);
}

.ff-select option {
    background: var(--wp--preset--color--black);
    color: var(--wp--preset--color--white);
}

.ff-chevron {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: var(--wp--preset--color--white);
    pointer-events: none;
}

/* ── Floating labels ──────────────────────────────────────────────────────────
   The label is always visible (it IS the placeholder, inputs use
   placeholder=" ") and animates its own position/size from a resting spot
   that mimics a normal placeholder into a floated caption above the value,
   while the field's own padding shifts to make room (see the padding-top/
   -bottom rule above). .ff-input/.ff-textarea trigger via native :focus and
   :not(:placeholder-shown) (no JS needed). .ff-select has no native
   placeholder-shown equivalent, so script.js toggles ".is-floated" on the
   wrapper once a real (non-placeholder) option is picked. ────────────────── */

.ff-field {
    position: relative;
}

.ff-field-label,
.ff-select-label {
    position: absolute;
    left: 24px;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 300;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    transition: top 0.15s ease, font-size 0.15s ease, transform 0.15s ease, color 0.15s ease, line-height 0.15s ease;
}

.ff-select-label {
    right: 48px;
}

.ff-field--textarea .ff-field-label {
    top: 18px;
    transform: none;
}

.ff-label-req {
    color: inherit;
}

.ff-input:focus + .ff-field-label,
.ff-input:not(:placeholder-shown) + .ff-field-label,
.ff-textarea:focus + .ff-field-label,
.ff-textarea:not(:placeholder-shown) + .ff-field-label,
.ff-select-wrap.is-floated .ff-select-label {
    top: 10px;
    transform: none;
    font-size: 10px;
    line-height: 12px;
    color: rgba(255, 255, 255, 0.7);
}


/* ── Radio list (wielkość firmy) ──────────────────────────────────────────── */

.ff-radio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ff-radio-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--wp--preset--color--black);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    cursor: pointer;
}

.ff-radio-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ff-radio-box {
    position: relative;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.ff-radio-input:checked~.ff-radio-box {
    border-color: var(--wp--preset--color--pink-500, #DF006E);
}

.ff-radio-input:checked~.ff-radio-box::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--wp--preset--color--pink-500, #DF006E);
}

.ff-radio-label {
    font-size: 15px;
    color: var(--wp--preset--color--white);
}

/* ── Consent checkboxes ───────────────────────────────────────────────────── */

.ff-consent {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    cursor: pointer;
}

.ff-consent-cb {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ff-consent-box {
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.ff-consent-cb:checked~.ff-consent-box {
    background: var(--wp--preset--color--pink-500, #DF006E);
    border-color: var(--wp--preset--color--pink-500, #DF006E);
}

.ff-consent-cb:checked~.ff-consent-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--wp--preset--color--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ff-consent-cb.ff-invalid~.ff-consent-box {
    border-color: #fc8181;
}

.ff-consent-body {
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
}

.ff-consent-body--required,
.ff-consent-body--marketing {
    display: flex;
    gap: 4px;
}

.ff-consent-required-mark {
    flex-shrink: 0;
    color: #ff2126;
}

.ff-consent-body p {
    margin: 0;
}

.ff-consent-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ff-consent.is-expanded .ff-consent-clamp {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.ff-consent-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--wp--preset--color--white);
    cursor: pointer;
}

.ff-consent.is-expanded .ff-consent-more svg {
    transform: rotate(180deg);
}

/* ── Footer / buttons ─────────────────────────────────────────────────────── */

.ff-required-note {
    margin: 24px 0 0;
    font-size: 16px;
    font-weight: 300;
    line-height: 24px;
    color: var(--wp--preset--color--neutral-100);
}

.ff-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.ff-footer--step1 {
    justify-content: flex-end;
}

.ff-footer--step2 {
    justify-content: space-between;
}

.ff-next-btn,
.ff-back-btn,
.ff-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: transparent;
    border: 1px solid var(--wp--preset--color--white);
    border-radius: 0;
    color: var(--wp--preset--color--white);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ff-next-btn:hover,
.ff-back-btn:hover,
.ff-submit-btn:hover {
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--black, #1A1A25);
}

.ff-submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

.ff-submit-btn.is-loading {
    position: relative;
    color: transparent !important;
}

.ff-submit-btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--wp--preset--color--white);
    border-radius: 50%;
    animation: ff-btn-spin 0.6s linear infinite;
}

@keyframes ff-btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.ff-msg {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    background: rgba(252, 129, 129, 0.12);
    border: 1px solid rgba(252, 129, 129, 0.35);
    color: #fc8181;
    font-size: 14px;
}

.ff-msg.ff-msg--success {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.4);
    color: #7be2a5;
}

/* ── Thank you ────────────────────────────────────────────────────────────── */

.ff-thankyou-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ff-thankyou-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--wp--preset--color--white);
}

.ff-thankyou-icon svg {
    width: 32px;
    height: 32px;
}

.ff-thankyou-head .ff-title {
    margin: 0;
    font-size: 32px;
    font-weight: 400;
}

.ff-thankyou .ff-header-line {
    margin-bottom: 24px;
}

.ff-thankyou .ff-desc {
    margin-bottom: 40px;
}

.ff-guide-btn {
    display: inline-flex;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 992px) {
    .ff-form-col {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .ff-block {
        padding: 48px 0;
    }

    .ff-title {
        font-size: 28px;
    }

    .ff-program-name {
        font-size: 24px;
    }

    .ff-step-label {
        font-size: 18px;
        margin-bottom: 24px;
    }

    .ff-type-cards {
        grid-template-columns: 1fr;
    }

    .ff-footer--step2 {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .ff-back-btn,
    .ff-submit-btn,
    .ff-next-btn {
        justify-content: center;
        width: 100%;
    }
}
