/* =====================================================================
   HEIRA IconCaptcha Pro — Central Stylesheet
   Neon #00D4C0 theme, 3-mode support: sequence, grid, puzzle
   ===================================================================== */

/* ── CSS Variables ── */
:root {
  --hc-neon:        #00D4C0;
  --hc-neon-dim:    rgba(0, 212, 192, 0.18);
  --hc-neon-glow:   0 0 12px rgba(0, 212, 192, 0.55);
  --hc-bg-dark:     rgba(8, 12, 18, 0.96);
  --hc-bg-card:     rgba(13, 20, 30, 0.98);
  --hc-bg-inner:    rgba(4, 8, 14, 0.95);
  --hc-border:      rgba(0, 212, 192, 0.25);
  --hc-border-hov:  rgba(0, 212, 192, 0.6);
  --hc-text:        #e2e8f0;
  --hc-text-muted:  rgba(148, 163, 184, 0.8);
  --hc-success:     #10b981;
  --hc-danger:      #f43f5e;
  --hc-warn:        #f59e0b;
  --hc-radius:      14px;
  --hc-transition:  0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Keyframe Animations ── */
@keyframes hc-pop-in {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  70%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes hc-ping {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes hc-shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  35%       { transform: translateX(8px); }
  55%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}
@keyframes hc-fade-in {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes hc-fade-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}
@keyframes hc-slide-in {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes hc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,192,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(0,212,192,0); }
}
@keyframes hc-progress {
  from { width: 100%; }
  to   { width: 0%; }
}
@keyframes hc-spin {
  to { transform: rotate(360deg); }
}
@keyframes hc-bounce-in {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

/* ── Checkbox Trigger Button ── */
.hc-checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--hc-bg-dark);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius);
  cursor: pointer;
  transition: border-color var(--hc-transition), box-shadow var(--hc-transition);
  user-select: none;
  position: relative;
  overflow: hidden;
}
.hc-checkbox-row:hover {
  border-color: var(--hc-border-hov);
  box-shadow: var(--hc-neon-glow);
}
.hc-checkbox-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,212,192,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.hc-checkbox-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(0, 212, 192, 0.45);
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--hc-transition);
}
.hc-checkbox-row.hc-verified .hc-checkbox-box {
  background: var(--hc-neon);
  border-color: var(--hc-neon);
  box-shadow: 0 0 8px rgba(0,212,192,0.6);
  animation: hc-bounce-in 0.35s ease forwards;
}
.hc-checkbox-box svg {
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}
.hc-checkbox-row.hc-verified .hc-checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}
.hc-checkbox-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--hc-text);
  flex: 1;
}
.hc-checkbox-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.hc-checkbox-brand-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--hc-neon);
  letter-spacing: 0.05em;
}
.hc-checkbox-brand-sub {
  font-size: 9px;
  color: var(--hc-text-muted);
}
.hc-verified-text {
  color: var(--hc-neon);
}

/* ── Overlay / Modal Backdrop ── */
.hc-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}
.hc-overlay.hc-visible {
  display: flex !important;
  animation: hc-fade-in 0.22s ease forwards;
}
.hc-overlay.hc-closing {
  animation: hc-fade-out 0.18s ease forwards;
}

/* ── Main Widget Card ── */
.hc-widget {
  width: 100%;
  max-width: 480px;
  background: var(--hc-bg-card);
  border: 1px solid var(--hc-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), var(--hc-neon-glow);
  animation: hc-slide-in 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
  position: relative;
}
.hc-widget.hc-shake {
  animation: hc-shake 0.45s ease forwards;
}

/* ── Widget Header ── */
.hc-header {
  padding: 16px 18px 14px;
  background: rgba(0, 212, 192, 0.06);
  border-bottom: 1px solid var(--hc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hc-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0,212,192,0.12);
  border: 1px solid var(--hc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hc-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--hc-text);
  line-height: 1.2;
}
.hc-header-sub {
  font-size: 11px;
  color: var(--hc-text-muted);
  margin-top: 2px;
}
.hc-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hc-btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--hc-border);
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--hc-transition);
  color: var(--hc-text-muted);
}
.hc-btn-icon:hover {
  border-color: var(--hc-neon);
  color: var(--hc-neon);
  box-shadow: 0 0 8px rgba(0,212,192,0.3);
}
.hc-timer-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--hc-border);
  color: var(--hc-text-muted);
  transition: all 0.3s;
}
.hc-timer-badge.hc-urgent {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.5);
  color: var(--hc-danger);
}

/* ── Target Sequence Row (Sequence Mode) ── */
.hc-targets-row {
  padding: 10px 16px;
  background: var(--hc-bg-inner);
  border-bottom: 1px solid var(--hc-border);
}
.hc-targets-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hc-text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hc-targets-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hc-target-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,212,192,0.2);
  background: rgba(0,0,0,0.35);
  font-size: 11px;
  font-weight: 600;
  color: var(--hc-text-muted);
  transition: all var(--hc-transition);
}
.hc-target-chip.hc-chip-active {
  border-color: var(--hc-neon);
  background: var(--hc-neon-dim);
  color: var(--hc-neon);
  box-shadow: 0 0 6px rgba(0,212,192,0.25);
  animation: hc-pulse 1.4s infinite;
}
.hc-target-chip.hc-chip-done {
  border-color: rgba(16,185,129,0.4);
  background: rgba(16,185,129,0.12);
  color: var(--hc-success);
}
.hc-target-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
}
.hc-target-arrow {
  color: rgba(0,212,192,0.3);
  font-size: 12px;
}

/* ── Stage Area ── */
.hc-stage-wrap {
  padding: 10px;
  background: rgba(0,0,0,0.5);
}
.hc-stage {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  cursor: crosshair;
  border: 1px solid var(--hc-border);
  background: #060b12;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.hc-stage.hc-stage-success {
  border-color: rgba(16,185,129,0.6);
  box-shadow: 0 0 20px rgba(16,185,129,0.2);
}
.hc-stage.hc-stage-fail {
  border-color: rgba(244,63,94,0.6);
  box-shadow: 0 0 20px rgba(244,63,94,0.2);
}

/* Dot pattern overlay */
.hc-stage-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image:
    radial-gradient(rgba(0,212,192,1) 1px, transparent 1px),
    radial-gradient(rgba(0,212,192,1) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}

/* SVG noise lines layer */
.hc-noise-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ── Placed Icons ── */
.hc-icon-wrap {
  position: absolute;
  z-index: 10;
  padding: 8px;
  border-radius: 11px;
  background: rgba(13,20,30,0.85);
  border: 1px solid rgba(0,212,192,0.18);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s, box-shadow 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hc-icon-wrap:hover {
  transform: translate(-50%, -50%) scale(1.14) !important;
  border-color: rgba(0,212,192,0.55);
  box-shadow: 0 0 14px rgba(0,212,192,0.25);
}
.hc-icon-svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* ── Click Markers ── */
.hc-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hc-pop-in 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.hc-marker-ping {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,212,192,0.3);
  animation: hc-ping 0.8s ease-out forwards;
}
.hc-marker-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hc-neon);
  color: #020c0b;
  font-weight: 900;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 12px rgba(0,212,192,0.7);
  position: relative;
}

/* ── Status Overlays ── */
.hc-overlay-status {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: hc-fade-in 0.2s ease forwards;
  padding: 20px;
  text-align: center;
}
.hc-overlay-status.hc-overlay-success {
  background: rgba(4, 30, 20, 0.88);
}
.hc-overlay-status.hc-overlay-fail {
  background: rgba(30, 4, 12, 0.88);
}
.hc-overlay-status.hc-overlay-expired {
  background: rgba(30, 20, 4, 0.88);
}
.hc-overlay-status svg {
  filter: drop-shadow(0 0 10px currentColor);
}
.hc-overlay-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.hc-overlay-sub {
  font-size: 12px;
  opacity: 0.7;
  color: #fff;
}
.hc-btn-retry {
  margin-top: 8px;
  padding: 7px 18px;
  border-radius: 9px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.hc-btn-retry:hover { opacity: 0.85; }
.hc-btn-retry-fail    { background: var(--hc-danger); color: #fff; }
.hc-btn-retry-expired { background: var(--hc-warn); color: #020202; }

/* ── Timer Progress Bar ── */
.hc-timer-bar-wrap {
  height: 3px;
  background: rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.hc-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--hc-neon), #00f0e0);
  box-shadow: 0 0 6px rgba(0,212,192,0.6);
  transition: background 1s;
}
.hc-timer-bar.hc-timer-urgent {
  background: linear-gradient(90deg, var(--hc-danger), #ff6b6b);
  box-shadow: 0 0 6px rgba(244,63,94,0.6);
}

/* ── Footer Controls ── */
.hc-footer {
  padding: 10px 14px;
  background: rgba(0,0,0,0.4);
  border-top: 1px solid var(--hc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hc-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hc-btn-sm {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--hc-border);
  background: rgba(0,0,0,0.35);
  color: var(--hc-text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--hc-transition);
}
.hc-btn-sm:hover:not(:disabled) {
  border-color: var(--hc-neon);
  color: var(--hc-neon);
}
.hc-btn-sm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.hc-progress-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--hc-text-muted);
}
.hc-branding {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(0,212,192,0.45);
  letter-spacing: 0.04em;
}

/* ── Grid Mode ── */
.hc-grid-header {
  padding: 14px 18px;
  background: rgba(0, 212, 192, 0.08);
  border-bottom: 1px solid var(--hc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hc-grid-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--hc-text);
}
.hc-grid-sub {
  font-size: 11px;
  color: var(--hc-text-muted);
  margin-top: 2px;
}
.hc-grid-category {
  color: var(--hc-neon);
  font-weight: 700;
  text-decoration: underline dotted;
}
.hc-grid-body {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0,0,0,0.5);
}
.hc-grid-cell {
  position: relative;
  height: 90px;
  border-radius: 11px;
  border: 1px solid rgba(0,212,192,0.15);
  background: rgba(13,20,30,0.85);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  transition: all var(--hc-transition);
  user-select: none;
}
.hc-grid-cell:hover {
  border-color: rgba(0,212,192,0.5);
  background: rgba(0,212,192,0.06);
  box-shadow: 0 0 10px rgba(0,212,192,0.12);
  transform: scale(1.03);
}
.hc-grid-cell.hc-cell-selected {
  border-color: var(--hc-neon);
  background: rgba(0,212,192,0.12);
  box-shadow: 0 0 14px rgba(0,212,192,0.25);
  transform: scale(0.97);
}
.hc-grid-cell-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--hc-text-muted);
  text-align: center;
}
.hc-cell-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--hc-neon);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hc-bounce-in 0.25s ease forwards;
}
.hc-grid-footer {
  padding: 10px 14px;
  background: rgba(0,0,0,0.4);
  border-top: 1px solid var(--hc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hc-selected-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--hc-text-muted);
}
.hc-btn-verify {
  padding: 7px 18px;
  border-radius: 9px;
  border: none;
  background: var(--hc-neon);
  color: #020c0b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--hc-transition);
  box-shadow: 0 0 10px rgba(0,212,192,0.35);
}
.hc-btn-verify:hover {
  background: #00f0e0;
  box-shadow: 0 0 16px rgba(0,212,192,0.55);
}
.hc-status-success-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hc-success);
}
.hc-status-fail-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hc-danger);
}

/* ── Puzzle Slider Mode ── */
.hc-puzzle-track-area {
  padding: 12px;
  background: rgba(0,0,0,0.5);
}
.hc-puzzle-stage {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--hc-border);
  background: linear-gradient(135deg, #060b14 0%, #0a1525 50%, #06111e 100%);
  margin-bottom: 14px;
}
.hc-puzzle-target {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 2px dashed rgba(0,212,192,0.55);
  background: rgba(0,212,192,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--hc-neon);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: hc-pulse 1.8s infinite;
}
.hc-puzzle-piece {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(13,20,30,0.9);
  border: 2px solid var(--hc-neon);
  box-shadow: 0 0 16px rgba(0,212,192,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.05s linear;
}
.hc-puzzle-success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4,30,20,0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--hc-success);
  animation: hc-fade-in 0.2s ease forwards;
}
.hc-slider-wrap {
  padding: 0 6px;
}
.hc-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hc-slider-track {
  flex: 1;
  position: relative;
  height: 8px;
  background: rgba(0,212,192,0.1);
  border: 1px solid rgba(0,212,192,0.25);
  border-radius: 8px;
  cursor: pointer;
}
.hc-slider-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hc-neon), #00f0e0);
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,212,192,0.4);
  transition: width 0.05s linear;
}
.hc-slider-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--hc-neon);
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 12px rgba(0,212,192,0.7);
  cursor: grab;
  transition: left 0.05s linear;
}
.hc-slider-thumb:active { cursor: grabbing; }
.hc-slider-hint {
  font-size: 10px;
  color: var(--hc-text-muted);
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
}

/* ── Loading Spinner ── */
.hc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 180px;
  gap: 12px;
  color: var(--hc-text-muted);
  font-size: 12px;
  font-weight: 600;
}
.hc-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0,212,192,0.15);
  border-top-color: var(--hc-neon);
  border-radius: 50%;
  animation: hc-spin 0.8s linear infinite;
}

/* ── Error State ── */
.hc-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 120px;
  color: var(--hc-danger);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 16px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .hc-widget { max-width: 100%; border-radius: 14px; }
  .hc-stage { height: 200px; }
  .hc-grid-cell { height: 78px; }
  .hc-puzzle-stage { height: 150px; }
}
