/* 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 {
  width: 100vw; height: 100vh; height: 100dvh;
  margin: 0; padding: 0; display: flex; justify-content: center; align-items: center;
  overflow: hidden; /* ABSOLUTELY prevent horizontal and vertical scrollbars */
  background-color: var(--bg-color); font-family: 'Inter', sans-serif;
  color: var(--text-primary); transition: background-image 1.5s ease;
  position: relative;
}

body.theme-blue { background-image: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.15), transparent 60%); }
body.theme-purple { background-image: radial-gradient(circle at 50% -20%, rgba(139, 92, 246, 0.15), transparent 60%); }
body.theme-green { background-image: radial-gradient(circle at 50% -20%, rgba(16, 185, 129, 0.15), transparent 60%); }

.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(255, 255, 255, 0.3), transparent);
  animation: fall linear infinite; opacity: 0; transition: background 1.5s ease;
}
body.theme-blue .v-line { background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.6), transparent); }
body.theme-purple .v-line { background: linear-gradient(to bottom, transparent, rgba(139, 92, 246, 0.6), transparent); }
body.theme-green .v-line { background: linear-gradient(to bottom, transparent, rgba(16, 185, 129, 0.6), transparent); }

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

.grid-bg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; 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%);
}

.safelink-wrapper { 
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 2; padding: 0; display: flex; justify-content: center; align-items: center; 
}
.view-container { 
  position: absolute; width: 100%; padding: 0 24px; /* EXACT safe spacing left and right to prevent horizontal touching without stretching */
  display: flex; justify-content: center; align-items: center; transition: all 0.4s ease; 
}

/* ------------------------------------------- */
/* NATIVE DYNAMIC GEOMETRY GLASS CARD          */
/* ------------------------------------------- */
.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; /* Locked width to perfectly emulate pro-spacing securely. NO height variable defined. */
  min-height: 350px; /* Smooth aesthetic anchor naturally scaling to inputs instead of jumping massively */
  display: flex; flex-direction: column; justify-content: center; gap: 20px; /* NORMAL SPACING flex replaces wide holes perfectly */
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.4s ease;
}

/* Neon Glow Integration tied natively to environmental phase themes */
body.theme-blue .safelink-box:not(.premium) {
  border: 1px solid rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.4), inset 0 0 12px rgba(59, 130, 246, 0.15), 0 20px 40px rgba(0,0,0,0.6);
}
body.theme-purple .safelink-box:not(.premium) {
  border: 1px solid rgba(139, 92, 246, 0.8);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), inset 0 0 12px rgba(139, 92, 246, 0.15), 0 20px 40px rgba(0,0,0,0.6);
}

.safelink-box.premium { border: 1px solid rgba(16, 185, 129, 0.4); box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 50px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255,255,255,0.1); }

/* Header */
.brand-header { display: flex; align-items: center; justify-content: center; gap: 14px; position: relative; z-index: 1;}
.brand-header.center-mode { flex-direction: column; text-align: center; gap: 6px; }
.brand-icon { width: 38px; height: 38px; flex-shrink: 0; 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; display: flex; flex-direction: column; gap: 2px; }
.brand-header.center-mode .title-group { text-align: center; }
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; line-height:1; }

/* Captcha Box */
.captcha-box { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 18px 16px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, box-shadow 0.2s; box-shadow: inset 0 0 15px rgba(0,0,0,0.2); }
@media (hover: hover) and (pointer: fine) { .captcha-box:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); } }
.captcha-box:active { transform: scale(0.96); opacity: 0.7; transition: transform 0.05s ease-out, opacity 0.05s; }
.captcha-left { display: flex; align-items: center; gap: 16px; font-size: 15px; font-weight: 500; color: #fff;}
.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; flex-shrink: 0;}
.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.8; font-weight: 500; }

/* Security Scan UI */
.scan-container { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1;}
.scan-header { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); font-weight: 600;}
.scan-pct { color: #8b5cf6; font-weight: 700; }
.scan-bar-bg { width: 100%; height: 6px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); }
.scan-bar-fill { width: 0%; height: 100%; background: #8b5cf6; box-shadow: 0 0 10px rgba(139, 92, 246, 0.6); border-radius: 4px; transition: width 0.2s ease-out; }

/* Trust Features Footer */
.trust-features { display: flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); padding: 14px 16px; border-radius: 12px; position: relative; z-index: 1;}
.tf-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-secondary); font-family: 'Inter', sans-serif; font-weight: 500;}
.tf-row svg { width: 16px; height: 16px; stroke: var(--success-color); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;}
.trust-features.highlighted { border-color: rgba(16, 185, 129, 0.2); background: rgba(16, 185, 129, 0.05); }
.trust-features.highlighted .tf-row { color: var(--success-color); justify-content: center; font-size: 13px; font-weight: 600;}

/* Timer */
.timer-circle { width: 80px; height: 80px; margin: 0 auto; border-radius: 50%; display: flex; justify-content: center; align-items: center; position: relative; z-index: 1;}
.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.05); }
.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; }
#v2-spinner::after { border-top-color: #8b5cf6; }
#v3-spinner::after { border-top-color: var(--success-color); }
/* ABSOLUTELY INFINITE SPIN: Removed artificial finishing halt state universally */
@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); }

/* Animation for greeting */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* Hero Unlock Icon */
.hero-unlock-icon { width: 70px; height: 70px; background: rgba(16, 185, 129, 0.1); border-radius: 20px; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px auto; border: 1px solid rgba(16, 185, 129, 0.2); color: var(--success-color); box-shadow: 0 0 20px rgba(16, 185, 129, 0.2); }
.hero-unlock-icon svg { width: 34px; height: 34px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin:round; }

/* 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: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s, box-shadow 0.2s; 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; z-index: 1;}
.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; }
@media (hover: hover) and (pointer: fine) { .action-btn:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.4); }
.action-btn:hover::before { left: 100%; } }
.action-btn:active { transform: scale(0.96); opacity: 0.85; transition: transform 0.05s ease-out, opacity 0.05s; }
.action-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;}

/* Error Page Specifics Inherited directly from previous perfectly working state */
.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; text-align: center; }
.error-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 30px; line-height: 1.6; text-align: center; }
.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: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s; }
@media (hover: hover) and (pointer: fine) { .home-btn:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); } }
.home-btn:active { transform: scale(0.96); opacity: 0.85; transition: transform 0.05s ease-out, opacity 0.05s; }
.home-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
