/*
 * Dot captcha — presentation.
 * Ported verbatim from the HoeStory theme (css/esc-login-main.css, "Captcha"
 * and "Dark mode captcha" blocks) plus the error box the widget shows when
 * a form is submitted before the challenge is solved.
 */

/* Captcha */
.esc-captcha {
  margin: 0 0 16px;
  text-align: left;
}

.esc-captcha input[type="text"][name="session_ref"] {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.esc-dot-captcha {
  border: 1px solid #eadada;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
  box-sizing: border-box;
  box-shadow: 0 6px 18px rgba(60, 28, 28, 0.06);
  padding: 8px;
}

.esc-dot-captcha-head,
.esc-dot-captcha-progress {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.esc-dot-captcha-head {
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  margin-bottom: 5px;
  position: relative;
  text-align: center;
}

.esc-dot-captcha-title {
  line-height: 1.2;
  padding: 0 50px;
}

.esc-dot-captcha-instruction {
  color: #6b5b5b;
  font-size: 12px;
  line-height: 1.35;
  margin: 5px 0 0;
  text-align: center;
}

.esc-dot-captcha-status {
  background: #f7eeee;
  border-radius: 999px;
  color: #9e171c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

.esc-dot-captcha-canvas {
  background: #fbfaf9;
  border: 1px solid #eadfdf;
  border-radius: 10px;
  box-shadow: none;
  cursor: crosshair;
  display: block;
  height: 48px;
  max-height: 48px;
  opacity: 1;
  touch-action: none;
  transition: opacity 0.24s ease, max-height 0.28s ease, border-width 0.28s ease;
  width: 100%;
  box-sizing: border-box;
}

.esc-dot-captcha-progress {
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

.esc-dot-captcha-check {
  align-items: center;
  background: #f1eeee;
  border: 1px solid #d9d0d0;
  border-radius: 50%;
  color: #a79c9c;
  display: inline-flex;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  width: 22px;
}

.esc-dot-captcha-check i {
  display: block;
  font-size: 12px;
  line-height: 1;
}

.esc-dot-captcha-check.is-filled {
  background: #1fa35b;
  border-color: #168748;
  color: #fff;
  transform: scale(1.04);
}

.esc-dot-captcha.is-passed {
  border-color: #7bc795;
  background: #fbfffc;
}

.esc-dot-captcha.is-passed .esc-dot-captcha-canvas {
  border-width: 0;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.esc-dot-captcha.is-passed .esc-dot-captcha-status {
  color: #1f7a3d;
  background: #e9f7ee;
}

.esc-dot-captcha.is-blocked {
  border-color: #df1820;
  background: #fff5f5;
}

.esc-dot-captcha.is-blocked .esc-dot-captcha-canvas {
  border-width: 0;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.esc-dot-captcha.is-blocked .esc-dot-captcha-status {
  color: #a91313;
  background: #fde8e8;
}

/* Error box (the theme's .esc-login-error, shown under the widget) */
.esc-captcha-error {
  display: none;
  background: #ffe0e0;
  color: #a91313;
  padding: 10px 15px;
  border-radius: 20px;
  margin: 0 0 16px;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ---- Dark mode captcha ---- */
html[data-esc-theme="dark"] .esc-dot-captcha {
  border-color: #3a3a3c;
  background: linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

html[data-esc-theme="dark"] .esc-dot-captcha-head {
  color: #e5e5e7;
}

html[data-esc-theme="dark"] .esc-dot-captcha-instruction {
  color: #a1a1a6;
}

html[data-esc-theme="dark"] .esc-dot-captcha-status {
  background: #3a2a2a;
  color: #ff8a8a;
}

html[data-esc-theme="dark"] .esc-dot-captcha-canvas {
  background: #1c1c1e;
  border-color: #3a3a3c;
}

html[data-esc-theme="dark"] .esc-dot-captcha-check {
  background: #2c2c2e;
  border-color: #3a3a3c;
  color: #6e6e73;
}

html[data-esc-theme="dark"] .esc-dot-captcha-check.is-filled {
  background: #1fa35b;
  border-color: #168748;
  color: #fff;
}

html[data-esc-theme="dark"] .esc-dot-captcha.is-passed {
  border-color: #2d6b4a;
  background: #1a2e22;
}

html[data-esc-theme="dark"] .esc-dot-captcha.is-passed .esc-dot-captcha-status {
  color: #4ddb88;
  background: #1a3322;
}

html[data-esc-theme="dark"] .esc-dot-captcha.is-blocked {
  border-color: #8b2020;
  background: #2a1a1a;
}

html[data-esc-theme="dark"] .esc-dot-captcha.is-blocked .esc-dot-captcha-status {
  color: #ff8a8a;
  background: #3a1e1e;
}
