.rpl-wrap {
    max-width: 100%;
    box-sizing: border-box;
}

.rpl-form {
    width: 100%;
}

.rpl-field {
    margin-bottom: 18px;
}

.rpl-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.rpl-field > label span {
    font-weight: 400;
}

.rpl-field input[type="text"],
.rpl-field input[type="tel"],
.rpl-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d6d6d6;
    border-radius: 0;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    background: #fff;
    outline: none;
}

.rpl-field input[type="text"]:focus,
.rpl-field input[type="tel"]:focus,
.rpl-field textarea:focus {
    border-color: #999;
}

.rpl-field textarea {
    min-height: 120px;
    resize: vertical;
}

/* Cluster cards */
.rpl-clusters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.rpl-cluster-card {
    position: relative;
    display: block;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.rpl-cluster-card:hover {
    border-color: #999;
    transform: translateY(-1px);
}

.rpl-cluster-card > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rpl-cluster-visual {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f2f2f2;
}

.rpl-cluster-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .25s ease;
}

.rpl-cluster-card:hover .rpl-cluster-visual img {
    transform: scale(1.025);
}

.rpl-cluster-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #777;
    font-size: 13px;
}

.rpl-cluster-name {
    display: block;
    padding: 11px 12px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.rpl-cluster-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.85);
    transition: opacity .18s ease, transform .18s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
}

.rpl-cluster-check svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Selected state */
.rpl-cluster-card:has(input:checked) {
    border-color: #1fa33b;
    box-shadow: 0 0 0 2px rgba(31,163,59,.13);
}

.rpl-cluster-card:has(input:checked) .rpl-cluster-check {
    opacity: 1;
    transform: scale(1);
    color: #fff;
    background: #1fa33b;
    border-color: #1fa33b;
}

.rpl-cluster-card:has(input:checked) .rpl-cluster-name {
    color: #16852e;
}

.rpl-submit {
    width: 100%;
    border: 0;
    border-radius: 5px;
    padding: 13px 18px;
    background: #1fa33b;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, opacity .18s ease;
}

.rpl-submit:hover {
    background: #188d31;
}

.rpl-submit:disabled {
    opacity: .7;
    cursor: wait;
}

.rpl-submit-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.rpl-wa-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.rpl-response {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.rpl-response.success {
    color: #188d31;
}

.rpl-response.error {
    color: #c62828;
}

.rpl-empty {
    color: #777;
}

@media (max-width: 600px) {
    .rpl-clusters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .rpl-cluster-name {
        padding: 9px 10px 10px;
        font-size: 14px;
    }

    .rpl-cluster-check {
        width: 27px;
        height: 27px;
        top: 7px;
        right: 7px;
    }

    .rpl-cluster-check svg {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 360px) {
    .rpl-clusters {
        grid-template-columns: 1fr;
    }
}
