/* ============================================================
   1R AntiBot — captcha UI (stable for WP + WooCommerce + themes)
   Layout: 60% checkbox | 40% branding
   ============================================================ */

/* Safety: predictable sizing everywhere inside widget */
.r1ab-box,
.r1ab-box *{
  box-sizing:border-box;
}

/* Outer box: no inner padding, arena can be full-width */
.r1ab-box{
  width: 270px;
  max-width: 270px;
  border:1px solid #dcdcde;
  border-radius:10px;
  padding:0;
  margin:14px 0;
  background:#fff;
  overflow:hidden;

  /* anti-theme: do not let floats/flex layouts drag the widget */
  display:block !important;
  float:none !important;
  clear:both !important;
}

/* Inner padding wrapper (everything except arena) */
.r1ab-inner{
  padding:10px;
}

.r1ab-row{
  display:none;
  align-items:center;
  gap:10px;
}

.r1ab-logo{
  width:28px;
  height:28px;
  display:inline-block;
}

.r1ab-title{
  font-weight:600;
}

/* ============================================================
   TOP GRID: 60% checkbox | 40% logo + link
   ============================================================ */
.r1ab-topgrid{
  display:grid;
  grid-template-columns: 60% 40%;
  gap:12px;
  align-items:start;
  width:100%;
}

/* Left column (checkbox area) */
.r1ab-left{
  min-width:0;
}

/* Right column (logo + link, centered) */
.r1ab-right{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  text-align:center;
  gap:3px;
}

.r1ab-brand-logo{
  width:28px;
  height:28px;
  display:block;
}

.r1ab-brand-link{
  font-size:10px;
  line-height:1.2;
  color:#50575e;
  text-decoration:none;
}
.r1ab-brand-link:hover{
  text-decoration:underline;
}

/* ============================================================
   CHECKBOX — native, stable, protected from theme overrides
   ============================================================ */

/* IMPORTANT: style only OUR checkbox label, not all labels */
.r1ab-box label.r1ab-checkbox{
  display:flex !important;
  align-items:center !important;
  gap:10px;
  padding:10px;
  border:1px solid #c3c4c7;
  background:#f5f5f5;
  border-radius:8px;
  max-width:100%;

  float:none !important;
  width:auto !important;
  clear:none !important;
  margin:0 !important;
}

/* protect native checkbox from custom theme "pretty checkbox" rules */
.r1ab-box label.r1ab-checkbox input[type="checkbox"]{
  position:static !important;
  float:none !important;
  margin:0 !important;
  width: 24px !important;
  height: 24px !important;
  opacity:1 !important;
  visibility:visible !important;
  transform:none !important;
  flex:0 0 auto;
}

/* text next to checkbox */
.r1ab-box label.r1ab-checkbox span{
  font-size:12px;
  line-height:1.2;
  display:block;
}

/* ============================================================
   CAPTCHA SHOW / HIDE
   ============================================================ */
.r1ab-wrap{
  overflow:hidden;
  max-height:0;
  opacity:0;
  transform:translateY(-6px);
  pointer-events:none;
}

.r1ab-wrap.is-open{
  max-height:1200px;
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
}

.r1ab-wrap.is-anim{
  transition:max-height .28s ease, opacity .22s ease, transform .22s ease;
}

/* ============================================================
   PROBE (icon to match)
   ============================================================ */
.r1ab-probe{
  display:flex;
  align-items:center;
  gap:8px;
}

.r1ab-probe-title{
  font-weight:600;
}

.r1ab-probe .svg{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.r1ab-probe .svg svg{
  width:30px;
  height:30px;
  display:block;
}

/* ============================================================
   ARENA — edge-to-edge
   ============================================================ */
.r1ab-arena{
  position:relative;
  width:100%;
  border:0;
  margin:0;
  padding:0;
  overflow:hidden;
}

.r1ab-arena .arena-wrap{
  position:relative;
  width:100%;
  min-height:200px;
  margin:0;
  padding:0;
}

.r1ab-arena canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

/* ============================================================
   STATUS TEXT
   ============================================================ */
.r1ab-note{
  font-size:13px;
  color:#50575e;
}

.r1ab-error{
  color:#d63638;
}

.r1ab-ok{
  color:#1f883d;
}

/* ============================================================
   MOBILE: stack columns vertically
   ============================================================ */
@media (max-width: 420px){
  .r1ab-topgrid{
    grid-template-columns: 1fr;
    gap:8px;
  }

  .r1ab-right{
    align-items:flex-start;
    text-align:left;
  }
}

/* ============================================================
   ANTI-THEME OVERRIDES (fix #commentform label { position:absolute; ... })
   Put this block at the END of the file.
   ============================================================ */

/* Reset any theme rules that target labels inside the review form */
#commentform .r1ab-box label,
.woocommerce #commentform .r1ab-box label{
  position:static !important;
  left:auto !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  margin:0 !important;
}

/* Ensure our checkbox label stays flex even if theme forces block/absolute */
#commentform .r1ab-box label.r1ab-checkbox,
.woocommerce #commentform .r1ab-box label.r1ab-checkbox{
  display:flex !important;
  align-items:center !important;
}

/* Some themes apply line-height/size to #commentform label — keep ours stable */
#commentform .r1ab-box label.r1ab-checkbox span{
  font-size:12px !important;
  line-height:1.2 !important;
}



/* Общие стили для всех чекбоксов с одинаковыми размерами */
.r1ab-checkbox input[type=checkbox]:checked::before {
    margin: -0.1875rem 0 0 -0.25rem !important;
    height: 1.8125rem !important;
    width: 1.8125rem !important;
}

/* Специально для мобильных устройств */
@media screen and (max-width: 782px) {
    .r1ab-checkbox input[type=checkbox]:checked::before {
        width: 1.8125rem !important;
        height: 1.8125rem !important;
        margin: -0.1875rem 0 0 -0.25rem !important;
    }
}

/* Убедимся, что сами чекбоксы тоже одинакового размера */
.r1ab-checkbox input[type=checkbox] {
    width: 1.8125rem !important;
    height: 1.8125rem !important;
}

@media screen and (max-width: 782px) {
    .r1ab-checkbox input[type=checkbox] {
        width: 1.8125rem !important;
        height: 1.8125rem !important;
    }
}



/* Родительский контейнер */
.r1ab-box {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
}

/* Обертка капчи */
.r1ab-wrap {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    background: #fff !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2) !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    margin-top: 10px !important;
    transition: opacity 0.2s ease !important;
}

/* Скрытое состояние */
.r1ab-wrap.is-anim[aria-hidden="true"] {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Видимое состояние */
.r1ab-wrap.is-anim[aria-hidden="false"] {
    display: block !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

/* Фиксированная высота арены */
.r1ab-arena,
.arena-wrap {
    height: 240px !important;
    min-height: 240px !important;
    max-height: 240px !important;
    overflow: hidden !important;
}

/* Canvas */
#BgCanvas_r1ab_qktQTnwPPoztVqsrAG,
#FgCanvas_r1ab_qktQTnwPPoztVqsrAG {
    width: 100% !important;
    height: 240px !important;
    object-fit: contain !important;
}

/* Убираем возможные артефакты при загрузке */
.r1ab-wrap.is-anim {
    visibility: visible !important;
}

/* На мобильных */
@media (max-width: 768px) {
    .r1ab-wrap {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 20px) !important;
        max-width: 500px !important;
    }
}