/* ================================================
   GLOBAL RESET & BASE STYLES
   ================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  /* Subtle cool-grey background matching screenshots */
  background-color: #f0f2f5;
}

/* ================================================
   UTILITY: Hidden class — toggled via JS
   ================================================ */
.hidden {
  display: none !important;
}

/* ================================================
   OVERLAY
   Covers entire viewport, blocks interaction with
   underlying content until verification completes
   ================================================ */
.overlay {
  position: fixed;
  inset: 0;                        /* top/right/bottom/left: 0 */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Same cool-grey as page background */
  background-color: #f0f2f5;
  /* Smooth fade-out when dismissed */
  transition: opacity 0.5s ease;
}

/* State applied by JS when verification succeeds */
.overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ================================================
   CARD
   Centred white panel with shadow — matches screenshots
   ================================================ */
.card {
  background: #ffffff;
  border-radius: 16px;
  /* Layered shadow for realistic depth */
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 20px 48px rgba(0, 0, 0, 0.06);
  padding: 48px 56px 44px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  /* Prevent layout jump when panels swap */
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ================================================
   CARD TYPOGRAPHY
   ================================================ */
.card-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #1f2937;           /* Near-black, matches screenshot */
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #6b7280;           /* Medium grey, matches screenshot */
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 6px;
}

/* ================================================
   STEP 1 — CHECKBOX PANEL
   ================================================ */
.checkbox-panel {
  width: 100%;
  margin-top: 10px;
}

/* Outer pill-shaped row — the "I'm not a robot" button */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.checkbox-wrapper:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.checkbox-wrapper:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* ---- Custom checkbox square ---- */
.custom-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

/* State: box ticked (blue border) */
.custom-checkbox.checked {
  border-color: #1a73e8;
  background: #fff;
}

/* SVG checkmark inside box */
.checkmark {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.custom-checkbox.checked .checkmark {
  opacity: 1;
  transform: scale(1);
}

/* Label text */
.checkbox-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #111827;
  letter-spacing: -0.1px;
}

/* ================================================
   STEP 2 — LOADING PANEL
   ================================================ */
.loading-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
  animation: fadeIn 0.35s ease forwards;
}

/* Wrapper centres the spinner ring */
.spinner-wrapper {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Circular spinner ---- */
.spinner {
  width: 54px;
  height: 54px;
  border: 3px solid #e5e7eb;          /* Light grey track */
  border-top-color: #1a73e8;          /* Blue leading arc — matches screenshot */
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ---- Status messages ---- */
.loading-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.loading-msg {
  font-size: 0.875rem;
  color: #374151;
  font-weight: 400;
  opacity: 0;                         /* Start invisible */
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* State applied by JS to reveal each message */
.loading-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================
   ANIMATIONS
   ================================================ */

/* Spinner rotation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Panel fade-in when loading panel mounts */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================
   RESPONSIVE — Mobile adjustments
   ================================================ */
@media (max-width: 520px) {
  .card {
    margin: 0 16px;
    padding: 36px 28px 32px;
  }

  .card-title {
    font-size: 1.3rem;
  }

  .checkbox-wrapper {
    padding: 16px 18px;
  }
}
