/* ============================================
   GateUnlock — Custom Styles
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #6C5CE7;
  --primary-hover: #5A4BD1;
  --primary-glow: rgba(108, 92, 231, 0.35);
  --accent: #00CEFF;
  --accent-glow: rgba(0, 206, 255, 0.25);
  --bg-dark: #0B0E17;
  --bg-card: rgba(17, 21, 35, 0.85);
  --bg-card-hover: rgba(24, 29, 50, 0.92);
  --border-subtle: rgba(108, 92, 231, 0.18);
  --border-hover: rgba(108, 92, 231, 0.4);
  --text-primary: #F1F1F6;
  --text-secondary: #9B9BB4;
  --text-muted: #5E5E7A;
  --success: #00E676;
  --success-glow: rgba(0, 230, 118, 0.25);
  --danger: #FF5252;
  --warning: #FFD740;
  --gradient-hero: linear-gradient(135deg, #0B0E17 0%, #161A2E 50%, #1A1040 100%);
  --gradient-card: linear-gradient(145deg, rgba(108, 92, 231, 0.08), rgba(0, 206, 255, 0.04));
  --gradient-btn: linear-gradient(135deg, #6C5CE7, #8B5CF6);
  --gradient-btn-hover: linear-gradient(135deg, #5A4BD1, #7C3AED);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Animated Background ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-mesh::before,
.bg-mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.bg-mesh::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-glow), transparent 70%);
  top: -10%;
  right: -10%;
}

.bg-mesh::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  bottom: -10%;
  left: -10%;
  animation-delay: -10s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* ---------- Layout Container ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 960px;
}

/* ---------- Header ---------- */
.site-header {
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.03);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-btn);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* ---------- Ad Banner Placeholders ---------- */
.ad-banner {
  width: 100%;
  min-height: 90px;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 16px 0;
  background: rgba(108, 92, 231, 0.03);
  transition: var(--transition);
}

.ad-banner:hover {
  border-color: var(--border-hover);
  background: rgba(108, 92, 231, 0.06);
}

/* ---------- Hero Section ---------- */
.hero {
  text-align: center;
  padding: 40px 0 24px;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title .icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ---------- Action Type Grid ---------- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(108, 92, 231, 0.06);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.3;
}

.action-btn:hover {
  background: rgba(108, 92, 231, 0.12);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.action-btn.active {
  background: rgba(108, 92, 231, 0.18);
  border-color: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.action-btn .action-icon {
  font-size: 24px;
  line-height: 1;
}

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(11, 14, 23, 0.6);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(11, 14, 23, 0.8);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--gradient-btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
}

.btn-success {
  background: linear-gradient(135deg, #00C853, #00E676);
  color: #0B0E17;
  box-shadow: 0 4px 20px var(--success-glow);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px var(--success-glow);
}

.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: rgba(108, 92, 231, 0.08);
}

/* Completed action button (unlock page) */
.btn-completed {
  background: rgba(0, 230, 118, 0.12) !important;
  border: 1.5px solid rgba(0, 230, 118, 0.35);
  color: var(--success) !important;
  box-shadow: none !important;
  cursor: default;
  opacity: 0.85;
}

.btn-completed:hover {
  transform: none !important;
}

/* Dynamic action URL input groups */
.action-url-group {
  position: relative;
  padding-left: 12px;
  border-left: 2px solid var(--border-subtle);
}

.action-url-group .form-label {
  text-transform: none;
  font-size: 0.82rem;
}

/* ---------- Generated Link Output ---------- */
.output-area {
  display: none;
  margin-top: 20px;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.output-area.visible {
  display: block;
}

.output-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(0, 230, 118, 0.06);
  border: 1.5px solid rgba(0, 230, 118, 0.25);
  border-radius: var(--radius-sm);
}

.output-box .link-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--success);
  word-break: break-all;
  user-select: all;
}

.copy-btn {
  padding: 8px 16px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: var(--radius-xs);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.copy-btn:hover {
  background: rgba(0, 230, 118, 0.2);
}

.copy-btn.copied {
  background: var(--success);
  color: var(--bg-dark);
}

/* ---------- Unlock Page Styles ---------- */
.unlock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}

.unlock-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.unlock-card .card {
  padding: 40px 32px;
}

.unlock-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.unlock-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid var(--border-subtle);
  color: var(--text-muted);
  transition: var(--transition);
}

.step.active {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.15);
  color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.step.completed {
  border-color: var(--success);
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border-subtle);
  transition: var(--transition);
}

.step-line.active {
  background: var(--primary);
}

.step-line.completed {
  background: var(--success);
}

/* ---------- Spinner ---------- */
.spinner-wrapper {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.spinner-wrapper.visible {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(108, 92, 231, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.timer-count {
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Unlock Button Area ---------- */
.unlock-actions {
  margin-top: 24px;
}

/* ---------- Error State ---------- */
.error-state {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.error-state.visible {
  display: block;
}

.error-state .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-state h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.error-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ---------- Stats Badge ---------- */
.stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 16px;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.site-footer a:hover {
  color: var(--primary);
}

/* ---------- Animations ---------- */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-in {
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 24px 20px;
  }

  .unlock-card .card {
    padding: 32px 20px;
  }

  .unlock-title {
    font-size: 1.35rem;
  }
}

@media (max-width: 400px) {
  .action-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .action-btn {
    padding: 12px 6px;
    font-size: 0.7rem;
  }
}