/* ── Content Gating ───────────────────────────────────────────────────────── */

/* Gated element: blurred and non-interactive until unlocked */
[data-gated]:not([data-unlocked]) {
  filter: blur(2px);
  user-select: none;
  pointer-events: none;
}

/* Wrapper provides relative positioning for the overlay */
.gated-wrapper {
  position: relative;
  display: inline-block;
}

/* Overlay sits on top of blurred content */
.gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}

/* Hide overlay once unlocked */
[data-unlocked] .gate-overlay {
  display: none;
}

/* ── Gate Modal ───────────────────────────────────────────────────────────── */

#gate-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#gate-modal.active {
  display: flex;
}

#gate-modal-inner {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

#gate-modal-backdrop {
  position: fixed;
  inset: 0;
}

.gate-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 1;
  transition: background 0.15s;
}

.gate-modal-close:hover {
  background: #f3f4f6;
}

#gate-form-wrap {
  padding: 40px;
}

#gate-success {
  display: none;
  padding: 48px 40px;
  text-align: center;
}

#gate-error-msg {
  display: none;
  padding: 8px 40px 0;
  text-align: center;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
}

.gate-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1.5px solid #f3f4f6;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
  font-family: inherit;
}

.gate-input:focus {
  border-color: #3b82f6;
}

.gate-submit-btn {
  width: 100%;
  background: #2563eb;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  padding: 16px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  transition: background 0.15s;
  font-family: inherit;
}

.gate-submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.gate-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@keyframes gate-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gate-spinner {
  display: inline-block;
  animation: gate-spin 1s linear infinite;
}
