/* Guard Slider CAPTCHA & Anti-Bot UI Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --track-bg: #1f2937;
  --track-border: #374151;
  --handle-bg: #ffffff;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 2px rgba(255, 255, 255, 0.08);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.05) 0px, transparent 60%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* App Container */
.guard-container {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.guard-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #38bdf8, #10b981);
}

.guard-header {
  margin-bottom: 24px;
}

.guard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a5b4fc;
  margin-bottom: 12px;
}

.guard-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.guard-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* CAPTCHA Box */
.captcha-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.captcha-stage {
  position: relative;
  width: 340px;
  height: 180px;
  margin: 0 auto 16px auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: #000;
  user-select: none;
  -webkit-user-select: none;
}

.captcha-bg-img {
  width: 340px;
  height: 180px;
  display: block;
  pointer-events: none;
}

.captcha-piece-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.captcha-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  transition: opacity 0.2s ease;
}

.captcha-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Slider Track */
.slider-track {
  position: relative;
  width: 340px;
  height: 44px;
  margin: 0 auto;
  background: var(--track-bg);
  border: 1px solid var(--track-border);
  border-radius: 22px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.slider-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.4), rgba(56, 189, 248, 0.5));
  pointer-events: none;
  transition: width 0.05s ease-out;
}

.slider-track.success .slider-progress {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.6), rgba(52, 211, 153, 0.7));
}

.slider-track.failed .slider-progress {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.6), rgba(248, 113, 113, 0.7));
}

.slider-hint-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.slider-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, transform 0.1s ease;
  z-index: 4;
}

.slider-handle:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.slider-handle svg {
  width: 18px;
  height: 18px;
  color: #1f2937;
  transition: transform 0.2s ease, color 0.2s ease;
}

.slider-track.success .slider-handle {
  background: var(--success);
  box-shadow: 0 0 16px var(--success-glow);
}

.slider-track.success .slider-handle svg {
  color: #ffffff;
}

.slider-track.failed .slider-handle {
  background: var(--danger);
  box-shadow: 0 0 16px var(--danger-glow);
}

.slider-track.failed .slider-handle svg {
  color: #ffffff;
}

/* Captcha Footer controls */
.captcha-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 340px;
  margin: 12px auto 0 auto;
}

.refresh-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.refresh-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.captcha-status-msg {
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.captcha-status-msg.success {
  color: var(--success);
}

.captcha-status-msg.error {
  color: var(--danger);
}

/* Protected Application Area */
.protected-content-box {
  display: none;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.protected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.protected-info {
  font-size: 13px;
  color: #d1fae5;
  margin-bottom: 16px;
  line-height: 1.5;
}

.reset-btn {
  background: #374151;
  color: #f3f4f6;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.reset-btn:hover {
  background: #4b5563;
}
