@charset "UTF-8";

/* Popup-mode widgets live inside the form but must be invisible until the modal opens */
.luxar-captcha[data-lc-popup] {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.luxar-captcha {
  display: inline-block;
  /* Don't stretch in flex/grid containers when not in popup */
  align-self: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--lc-text, #333);
  line-height: 1.4;
  box-sizing: border-box;
}
.luxar-captcha *,
.luxar-captcha *::before,
.luxar-captcha *::after {
  box-sizing: inherit;
}

.lc-widget {
  position: relative;
  /* Responsive: never wider than viewport minus small margin */
  min-width: min(260px, 100vw - 20px);
  box-sizing: border-box;
  padding: 16px;
  border-radius: var(--lc-radius, 8px);
  background: var(--lc-bg, #fff);
  color: var(--lc-text, #333);
  border: var(--lc-border-width, 1px) solid var(--lc-border, #ddd);
  box-shadow: var(--lc-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
}

/* Locked state: dimensions fixed by JS, content centred to avoid jumps */
.lc-widget.lc-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Result icon fills the locked widget's inner area (respects padding) */
.lc-widget.lc-locked .lc-result-icon {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.lc-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--lc-border, #ddd);
  border-top-color: var(--lc-accent, #3a7bd5);
  border-radius: 50%;
  animation: lc-spin 0.7s linear infinite;
}

@keyframes lc-spin {
  to {
    transform: rotate(360deg);
  }
}
.lc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border: none;
  border-radius: var(--lc-btn-radius, calc(var(--lc-radius, 8px) - 2px));
  background: var(--lc-accent, #3a7bd5);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  user-select: none;
}
.lc-btn:hover:not(:disabled) {
  opacity: 0.88;
}
.lc-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.lc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.lc-btn.lc-btn-main {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.lc-btn.lc-btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.lc-input {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 8px 12px;
  border: 1px solid var(--lc-border, #ddd);
  border-radius: calc(var(--lc-radius, 8px) - 2px);
  background: var(--lc-bg, #fff);
  color: var(--lc-text, #333);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lc-input:focus {
  border-color: var(--lc-accent, #3a7bd5);
  /* Prominent focus ring for keyboard users (WCAG AA) */
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.22);
}

.lc-prompt {
  margin-bottom: 10px;
  color: var(--lc-text, #333);
  font-weight: 500;
}

.lc-success {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2e7d32;
  font-weight: 500;
}

.lc-check {
  font-size: 20px;
}

.lc-error,
.lc-blocked,
.lc-timeout {
  color: var(--lc-error, #c62828);
  font-weight: 500;
}

/* Result icons (success / fail) */
.lc-result-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

/* Shield-bot result SVG — animation is driven by JS */
.lc-bot-svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .22));
}

.lc-math {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-math-expr {
  font-size: 20px;
  font-weight: 700;
  color: var(--lc-text, #333);
  text-align: center;
  padding: 8px 0;
}

.lc-text-captcha {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-captcha-img {
  display: block;
  max-width: 100%;
  border-radius: 4px;
}

.lc-spots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Touch target: 44×44px minimum per WCAG */
.lc-spot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.lc-spot:hover {
  transform: scale(1.1);
  border-color: var(--lc-text, #333);
}
.lc-spot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.35);
}

.lc-hold {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-hold-bar {
  height: 6px;
  background: var(--lc-border, #ddd);
  border-radius: 3px;
  overflow: hidden;
}

.lc-hold-fill {
  height: 100%;
  background: var(--lc-accent, #3a7bd5);
  width: 0%;
  transition: width 0.1s linear;
}

.lc-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Slider value label */
.lc-slider-val {
  text-align: right;
  font-size: 12px;
  color: #999;
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}

.lc-slider {
  width: 100%;
  cursor: pointer;
  accent-color: var(--lc-accent, #3a7bd5);
}

.lc-rotate-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.lc-rotate-figure {
  font-size: 48px;
  line-height: 1;
  transition: transform 0.2s;
  user-select: none;
}

.lc-rotate-controls {
  display: flex;
  gap: 8px;
}

.lc-order-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.lc-order-item {
  padding: 8px 14px;
  background: var(--lc-border, #ddd);
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  font-weight: 700;
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
  touch-action: none;
}
.lc-order-item.lc-dragging {
  opacity: 0.4;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  transform: scale(1.05);
}
.lc-order-item:focus-visible {
  outline: 2px solid var(--lc-accent, #3a7bd5);
  outline-offset: 2px;
}

.lc-imgsel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 8px 0;
}

.lc-imgsel-cell {
  position: relative;
  aspect-ratio: 1;
  background: var(--lc-border, #eee);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  font-size: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  border: 2px solid transparent;
}
.lc-imgsel-cell:hover {
  transform: scale(1.04);
}
.lc-imgsel-cell:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.35);
}
.lc-imgsel-cell.lc-selected {
  border-color: var(--lc-accent, #3a7bd5);
  box-shadow: 0 0 0 1px var(--lc-accent, #3a7bd5);
}
.lc-imgsel-cell.lc-selected::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 14px;
  font-weight: 700;
  color: var(--lc-accent, #3a7bd5);
  line-height: 1;
  text-shadow: 0 0 3px #fff;
}

/* Skeleton loader while images load */
.lc-imgsel-cell.lc-skeleton {
  background: linear-gradient(90deg, var(--lc-border, #eee) 25%, #f8f8f8 50%, var(--lc-border, #eee) 75%);
  background-size: 200% 100%;
  animation: lc-skeleton 1.4s ease infinite;
}
@keyframes lc-skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.lc-imgsel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.lc-memory-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
  transition: opacity 0.3s ease;
}
/* Fade phase transition */
.lc-memory-cards.lc-fade {
  opacity: 0;
}

.lc-memory-card {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.15s;
}
.lc-memory-card:hover {
  transform: scale(1.08);
}
.lc-memory-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.4);
}

/* Countdown badge shown during memorization phase */
.lc-memory-countdown {
  display: inline-block;
  font-size: 12px;
  color: #999;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
  font-weight: 400;
}

/* Reload button — 36×36 for adequate touch target */
.lc-reload {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-top: 10px;
  margin-left: auto;
  border: 1px solid var(--lc-border, #ddd);
  border-radius: 50%;
  background: var(--lc-bg, #fff);
  color: var(--lc-text, #888);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
}
.lc-reload:hover {
  opacity: 1;
  color: var(--lc-accent, #3a7bd5);
  border-color: var(--lc-accent, #3a7bd5);
}
.lc-reload:focus-visible {
  outline: 2px solid var(--lc-accent, #3a7bd5);
  outline-offset: 2px;
  opacity: 1;
}
.lc-reload svg {
  width: 15px;
  height: 15px;
  display: block;
  flex-shrink: 0;
}
/* Continuous spin while loading new task */
.lc-reload.lc-spinning svg {
  animation: lc-spin 0.6s linear infinite;
}

/* Countdown badge overlaid on the fail SVG during cooldown */
.lc-cooldown-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: clamp(42px, 11vw, 54px);
  height: clamp(42px, 11vw, 54px);
  background: var(--lc-bg, #fff);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  flex-shrink: 0;
}

.lc-ring-track {
  fill: none;
  stroke: var(--lc-border, #e5e5e5);
  stroke-width: 4;
}

.lc-ring-fill {
  fill: none;
  stroke: #e53935;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear;
}

.lc-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 800;
  color: #e53935;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  line-height: 1;
}

.lc-cooldown-sub {
  font-size: 12px;
  color: #999;
  text-align: center;
  padding-bottom: 2px;
}

/* Auto dark mode for widgets using lc-theme-auto */
@media (prefers-color-scheme: dark) {
  .lc-theme-auto {
    --lc-bg: #1e1e2e;
    --lc-border: #3a3a5c;
    --lc-accent: #7c9eff;
    --lc-text: #e0e0f0;
    --lc-radius: 8px;
    --lc-shadow: 0 2px 12px rgba(0, 0, 0, .35);
    --lc-error: #ef9a9a;
  }
  .lc-theme-auto .lc-input {
    background: #16162a;
    color: #e0e0f0;
  }
  .lc-theme-auto .lc-imgsel-cell {
    background: #2a2a42;
  }
  .lc-theme-auto .lc-order-item {
    background: #2a2a42;
    color: #e0e0f0;
  }
}
