/* CSS Reset variables and styles */
:root {
  --bg-color: #0b0f19;
  --surface-color: rgba(17, 24, 39, 0.65);
  --border-color: rgba(55, 65, 81, 0.8);
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --success-color: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --brand-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  /* Subtle radial gradient background */
  background-image: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.15), transparent 60%);
}

/* Beautiful Vertical Lines / Rain */
.v-lines-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.v-line {
  position: absolute;
  top: -100px;
  width: 1px;
  height: 15vh;
  background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.6), transparent);
  animation: fall linear infinite;
  opacity: 0;
}

@keyframes fall {
  0% { transform: translateY(-100px); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0; }
}

/* Grid background for dev aesthetic */
.grid-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
  z-index: 0;
  pointer-events: none;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

/* Wrapper */
.safelink-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Glass Card - Medium Compact Size */
.safelink-box {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes slideUpFade {
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-icon {
  width: 38px; height: 38px;
  background: var(--brand-gradient);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 15px var(--accent-glow);
}

.brand-icon svg { 
  width: 20px; height: 20px; 
  fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; 
}

.title-group {
  text-align: left;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1.2;
}

p.subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

/* Progress Steps */
.steps-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  padding: 0;
}
.steps-container::before {
  content: '';
  position: absolute;
  top: 13px; /* Center of 26px circle */
  left: 30px;
  right: 30px;
  height: 2px;
  background: rgba(255, 255, 255, 0.05); /* Stealthy empty path */
  z-index: 0;
}
.progress-track {
  position: absolute;
  top: 13px;
  left: 30px;
  right: 30px;
  height: 2px;
  z-index: 1;
}
/* Super Clean Progress Line */
.step-progress-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent-color);
  width: 0%; 
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5); /* Soft premium glow */
  border-radius: 2px;
}
/* Removed laser dot entirely for a cleaner look */
.step-progress-line::after {
  display: none;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 60px;
  color: var(--text-secondary);
  transition: all 0.4s ease;
}
.step-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-color); /* Cutout effect */
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active Step */
.step-item.active {
  color: #fff;
}
.step-item.active .step-circle {
  border-color: var(--accent-color);
  background: var(--bg-color);
  color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); /* Minimal outer ring */
}

/* Completed Step */
.step-item.completed .step-circle {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: #fff;
}
.step-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Content Area */
.content-area {
  position: relative;
  min-height: 100px; /* dynamic height base */
}

/* Shared card styles */
.step-card {
  position: absolute;
  top: 0; left: 0; width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.98);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.step-card.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  position: relative;
  pointer-events: auto;
}

/* Captcha Box */
.captcha-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}

.captcha-box:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.2);
}

.captcha-box:active {
  transform: scale(0.98);
}

.captcha-left {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
}

.checkbox {
  width: 24px; height: 24px;
  border: 2px solid var(--text-secondary);
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkbox svg {
  width: 14px; height: 14px;
  fill: none; stroke: transparent; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  transition: all 0.3s;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.checkbox.checked {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 12px var(--accent-glow);
}

.checkbox.checked svg {
  stroke: #fff;
  stroke-dashoffset: 0;
}

.captcha-right {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: right;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
  opacity: 0.7;
}

/* Timer */
.timer-container {
  text-align: center;
  padding: 10px 0;
}

.timer-text {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.timer-circle {
  width: 80px; height: 80px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.timer-circle::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
}

.timer-circle::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 15px rgba(255,255,255,0.2);
}

/* Button */
.action-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
  font-weight: 600;
  background: var(--accent-color);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}
.action-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}
.action-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}
.action-btn:hover::before {
  left: 100%;
}
.action-btn:active {
  transform: translateY(1px);
}
.action-btn svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

.ready-text {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 500;
}
.success-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--accent-color);
}
.success-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-check 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.1s;
}
@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

/* Footer info */
.security-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 12px;
  color: rgba(156, 163, 175, 0.6);
  font-family: 'Inter', sans-serif;
}

.security-badge svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none; stroke-width: 2;
}

/* Scanning Skeleton UI */
.scanning-ui {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  height: 70px;
}
.skeleton-box {
  width: 140px;
  height: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.skeleton-box.short {
  width: 90px;
}
.skeleton-box::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
  animation: skeleton-glow 1.2s infinite ease-in-out;
}
@keyframes skeleton-glow {
  0% { left: -50%; }
  100% { left: 150%; }
}

/* Additional specific styles for error page */
.error-icon {
  width: 60px; height: 60px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px auto;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-icon svg {
  width: 30px; height: 30px;
  stroke: #ef4444; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

.error-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.error-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 30px;
  line-height: 1.6;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--surface-color);
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
}

.home-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.home-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 2;
}

/* ========================================== */
/* ADVERTISEMENT PLACEMENT STYLES (RESPONSIVE)*/
/* ========================================== */
.ad-container {
  width: 100%; display: flex; justify-content: center; align-items: center;
  margin: 20px 0; z-index: 10;
}
.ad-placeholder {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15); border-radius: 12px;
  color: rgba(255,255,255,0.3); display: flex; flex-direction: column;
  justify-content: center; align-items: center; font-size: 11px;
  font-family: 'JetBrains Mono', monospace; text-align: center; position: relative;
}
.ad-placeholder::before {
  content: 'AD SPACE / SPONSOR'; font-weight: 600; font-size: 9px;
  letter-spacing: 1px; opacity: 0.5; margin-bottom: 4px;
}
.ad-top .ad-placeholder { width: 320px; height: 50px; }
@media (min-width: 768px) { .ad-top .ad-placeholder { width: 728px; height: 90px; } }
.ad-incard .ad-placeholder { width: 100%; max-width: 300px; height: 250px; margin: 0 auto; }
.ad-sticky {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(12px);
  padding: 10px 0; margin: 0; box-shadow: 0 -10px 30px rgba(0,0,0,0.6); z-index: 100;
}
.ad-sticky .ad-placeholder { width: 320px; height: 50px; border: none; background: rgba(255,255,255,0.05); }
.ad-popup-overlay {
  position: fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
  z-index: 999; display: flex; justify-content: center; align-items: center;
}
.ad-popup {
  position: relative; background: var(--surface-color);
  border: 1px solid var(--border-color); border-radius: 16px;
  padding: 15px; box-shadow: 0 0 50px rgba(0,0,0,0.9);
}
.ad-popup .ad-placeholder { width: 300px; height: 250px; }
