/* Google Fonts wstrzykiwane - w WP często jest już w motywie no ale upewnijmy się */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.rkb-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.rkb-widget.rkb-widget--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Kursor typewriter */
.rkb-tw-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #070729;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: rkb-blink 0.6s step-end infinite;
}

@keyframes rkb-blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

/* WERSJA 3 — Karta (Card) */
.rkb-v3 {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.rkb-v3 .rkb-card {
    position: relative;
    background: #ffffff;
    border-radius: 0;
    padding: 22px 24px 20px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #A93CBE;
    max-width: 380px;
    width: 380px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, width 0.3s ease;
    cursor: default;
    box-sizing: border-box;
    /* Reset for WP themes */
}

/* Remove WP default list margins */
.rkb-v3 .rkb-card * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.rkb-v3 .rkb-card.show {
    opacity: 1;
    transform: translateY(0);
}

.rkb-v3 .rkb-card.hide {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}

/* Lead Form UI */
.rkb-form-card {
    width: 600px !important;
    max-width: 90vw !important;
    padding: 30px 28px !important;
    border-left: none !important;
    border-radius: 0 !important;
}

.rkb-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.rkb-form-header-title {
    font-size: 18px;
    font-weight: 700;
    color: #070729;
}

.rkb-form-header-close {
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.rkb-form-header-close:hover {
    color: #475569;
}

/* --- FORM INPUTS (Floating Label Style) --- */

/* Fieldset Container */
.rkb-fieldset-contact {
    border: none;
    border-radius: 0;
    padding: 24px 16px 4px 16px;
    /* Extra top padding to clear the legend */
    margin-bottom: 8px;
    background: transparent;
    position: relative;
}

.rkb-fieldset-legend {
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    padding: 0 8px;
    /* Background cut effect */
    background: #ffffff;
    margin-bottom: 0px;
    width: auto;
    border: none;
}

.rkb-form-flex-row {
    display: flex;
    gap: 8px !important;
    margin-bottom: 8px;
    width: 100%;
}

.rkb-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    position: relative;
}

/* Base Label Styling (no longer floating) */
.rkb-input-group>label {
    font-family: 'Poppins', sans-serif !important;
    font-size: 13px;
    font-weight: 700;
    color: #070729;
    /* Ciemny tak jak na mock-up'ie */
    margin-bottom: 6px;
    display: block;
}

/* Style for non-floating header in checkbox group */
.rkb-checkbox-group>label:first-child {
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px;
    font-weight: 700;
    color: #070729;
    position: static;
    background: transparent;
    padding: 0;
    margin-bottom: 12px;
    display: block;
}

.rkb-input-group input[type="text"],
.rkb-input-group input[type="email"],
.rkb-input-group input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif !important;
    padding: 14px 16px;
    border: none;
    border-left: 2px solid #cbd5e1;
    border-radius: 0;
    font-size: 14px;
    color: #334155;
    background: #f4f5f8;
    position: relative;
    z-index: 1;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.rkb-input-group input::placeholder {
    font-family: 'Poppins', sans-serif !important;
    color: #94a3b8;
    font-weight: 400;
}

/* Active / Focus State */
.rkb-input-group input:focus {
    /* Focus border color gets overridden by inline PHP dynamic styles to primary_color */
    border-color: #0d9488;
    background: #eef2f6;
}

/* --- CHECKBOXES (New style from screenshot with icons if needed) --- */
.rkb-checkbox {
    font-family: 'Poppins', sans-serif !important;
    display: flex;
    align-items: center;
    /* Center align with new larger font */
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500 !important;
    color: #1e293b !important;
    /* Darker text */
    margin-bottom: 12px !important;
}

.rkb-checkbox input[type="checkbox"] {
    margin-top: 0 !important;
    /* Reset margin because of align-items:center */
    accent-color: #be185d;
    /* Pinkish-red accent from submit button */
    width: 18px;
    height: 18px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
}

.rkb-checkbox input[type="checkbox"] {
    margin-top: 3px !important;
    accent-color: currentColor;
    width: 16px;
    height: 16px;
}

.rkb-consents {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    margin-top: 18px;
}

.rkb-consent-text {
    font-size: 11px;
    line-height: 1.4;
    color: #64748b;
}

.rkb-consent-text a {
    text-decoration: underline;
}

.rkb-form-submit-wrap {
    display: flex;
    justify-content: flex-end;
}

.rkb-widget-form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #A93CBE;
    color: #fff !important;
    border: none;
    padding: 12px 28px;
    border-radius: 0 12px 0 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    box-shadow: 0 4px 14px rgba(169, 60, 190, 0.35);
}

.rkb-widget-form button[type="submit"]:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.rkb-widget-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rkb-form-response {
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.rkb-form-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.rkb-form-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Spinner */
.rkb-loader {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-left-color: #fff;
    border-radius: 50%;
    animation: rkb-spin 1s linear infinite;
}

@keyframes rkb-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* -------------------------------------
   Basic Card Setup
-------------------------------------- */
.rkb-v3 .rkb-card__title {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #070729;
    line-height: 1.3;
    margin-bottom: 6px;
    white-space: nowrap;
}

.rkb-v3 .rkb-card__sub {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #888;
    line-height: 1.4;
    margin-bottom: 14px;
}

.rkb-v3 .rkb-card__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rkb-v3 .rkb-card__btn {
    display: inline-block;
    padding: 9px 20px;
    background: #A93CBE;
    color: #fff !important;
    border: none;
    border-radius: 0 12px 0 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 4px 14px rgba(169, 60, 190, 0.35);
}

.rkb-v3 .rkb-card__btn:hover,
.rkb-v3 .rkb-card__btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(169, 60, 190, 0.45);
    color: #fff !important;
}

.rkb-v3 .rkb-card__btn span {
    display: inline-block;
    transition: transform 0.2s;
}

.rkb-v3 .rkb-card__btn:hover span {
    transform: translateX(3px);
}

.rkb-v3 .rkb-card__link {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #999 !important;
    text-decoration: none;
    transition: color 0.2s;
    background: transparent !important;
}


/* --- TEMATY ZAPYTANIA (TOPICS GRID) --- */
.rkb-topics-section {
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}
.rkb-topics-section > label {
    font-size: 13px;
    font-weight: 700;
    color: #070729;
    margin-bottom: 10px;
    display: block;
}
.rkb-topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.rkb-topic-card {
    cursor: pointer;
    display: block;
    margin: 0 !important;
}
/* Ukrywamy domyślny checkbox, żeby stylować sam kafelek */
.rkb-topic-card input[type="checkbox"] {
    display: none !important; 
}
.rkb-topic-card-inner {
    border: 2px solid #cbd5e1;
    border-radius: 8px;
padding: 16px 12px !important;
    text-align: center;
    background: #fff;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.rkb-topic-card:hover .rkb-topic-card-inner {
    border-color: #94a3b8;
    background: #f8fafc;
}

.rkb-topic-image {
    max-width: 32px;
    max-height: 32px;
    margin-bottom: 8px;
    object-fit: contain;
}
.rkb-topic-title {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    line-height: 1.3;
}
@media(max-width: 480px) {
    .rkb-topics-grid {
        grid-template-columns: 1fr; /* Na telefonach jeden pod drugim */
    }
}

.rkb-v3 .rkb-card__link:hover {
    color: #A93CBE !important;
}

/* Card close — X szary */
.rkb-v3 .rkb-card__close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 20px;
    color: #ccc;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.rkb-v3 .rkb-card__close:hover {
    color: #999;
}

/* Mini avatar z badge */
.rkb-mini {
    align-self: flex-end;
    margin-top: 10px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rkb-mini.vis {
    opacity: 1;
    transform: scale(1);
}

.rkb-mini:hover {
    transform: scale(1.1);
}

.rkb-mini img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.rkb-mini__dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 13px;
    height: 13px;
    background: #22c55e;
    border: 2.5px solid #fff;
    border-radius: 50%;
}

.rkb-mini__badge {
	display: none;
    position: absolute;
    top: -4px;
    left: -8px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    padding: 1px 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #A93CBE;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Mobile responsive fixes */
@media(max-width:768px) {
    .rkb-form-flex-row {
        flex-direction: column;
        gap: 0;
    }
}

@media(max-width:480px) {
    .rkb-widget {
        bottom: 16px;
        right: 16px;
    }

    .rkb-form-card {
        width: calc(100vw - 32px) !important;
        padding: 20px 16px !important;
        max-height: 80vh;
        overflow-y: auto;
    }

    .rkb-v3 .rkb-card {
        width: calc(100vw - 32px);
        max-width: 360px;
    }
}