/* Компонент согласия с политикой ПД */
.policy-consent {
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 12px 0;
}

.policy-consent__label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

/* Скрываем нативный input, но оставляем доступным */
.policy-consent__checkbox {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

/* Кастомный квадратик через псевдоэлемент на label */
.policy-consent__label::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-right: 10px;
    margin-top: 1px;
    border: 2px solid #888;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

/* Состояние «отмечено» */
.policy-consent__checkbox:checked + .policy-consent__text {
    /* текст не меняем, но нужен для каскада */
}

.policy-consent__label:has(.policy-consent__checkbox:checked)::before {
    background: #1e40af;
    border-color: #1e40af;
    /* Галочка через CSS */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.5 3.5 6.5-7'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Фоллбэк для браузеров без :has() — через JS-класс */
.policy-consent__label.is-checked::before {
    background: #1e40af;
    border-color: #1e40af;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.5 3.5 6.5-7'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.policy-consent__text {
    flex: 1;
}

.policy-consent__text a {
    color: #1e40af;
    text-decoration: underline;
}

.policy-consent__text a:hover {
    text-decoration: none;
}

.policy-consent__error {
    color: #d00;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.3;
}

/* Режим для слабовидящих */
.optimize .policy-consent {
    background: none;
    border-color: currentColor;
}

.optimize .policy-consent__label::before {
    border-color: currentColor;
}

.optimize .policy-consent__text a {
    color: inherit;
}
