/* ============================================================
   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;
}
