/* ====== Resource Gate Overlay ======
   Modal overlay that wraps an identical gate form on gated resource
   pages. Injected by js/resource-gate.js. Self-contained: does not
   depend on page-compass.css being loaded.
   ==================================== */

#resource-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.35s ease;
}

#resource-gate-overlay.rgo--closing {
  opacity: 0;
  pointer-events: none;
}

.rgo__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.rgo__card {
  position: relative;
  width: min(520px, calc(100vw - 2rem));
  margin: 1.5rem;
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  background: var(--color-white, #fff);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.rgo__heading {
  font-family: var(--font-display, serif);
  font-size: 1.4rem;
  font-weight: var(--font-weight-bold, 700);
  margin: 0 0 0.5rem;
  color: var(--color-blue, #1436BC);
}

.rgo__body {
  font-family: var(--font-body, 'Work Sans', sans-serif);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--grey-800, #333);
  margin: 0 0 1.25rem;
}

/* ---- Form inside the overlay ----
   Mirrors .compass-gate__* from page-compass.css, scoped under .rgo__form
   so gated pages don't need to load the full landing-page stylesheet. */

.rgo__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rgo__form .compass-gate__honeypot {
  display: none;
}

.rgo__form .compass-gate__fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rgo__form .compass-gate__field {
  min-width: 0;
}

.rgo__form .compass-gate__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.rgo__form .compass-gate__input {
  display: block;
  width: 100%;
  font-family: var(--font-body, 'Work Sans', sans-serif);
  font-size: 1rem;
  padding: 0.6em 0;
  border: none;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 0;
  background: transparent;
  color: var(--color-black, #000);
  outline: none;
  transition: border-color 0.2s;
}

.rgo__form .compass-gate__input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.rgo__form .compass-gate__input:focus {
  border-color: var(--color-blue, #1436BC);
}

.rgo__form .compass-gate__actions {
  margin-top: 0.5rem;
}

.rgo__form .compass-gate__submit {
  display: inline-block;
  width: 100%;
  font-family: var(--font-body, 'Work Sans', sans-serif);
  font-size: 1rem;
  font-weight: var(--font-weight-bold, 700);
  padding: 0.75em 1.5em;
  background: var(--color-yellow, #FFD54A);
  color: var(--color-black, #000);
  border: 2px solid var(--color-yellow, #FFD54A);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.rgo__form .compass-gate__submit:hover {
  background: transparent;
  color: var(--color-black, #000);
}

.rgo__form .compass-gate__submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.rgo__form .compass-gate__fine-print {
  margin: 0;
  font-family: var(--font-body, 'Work Sans', sans-serif);
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0.65;
}

.rgo__form .compass-gate__status {
  margin: 0;
}

.rgo__form .compass-gate__error {
  margin: 0;
  font-family: var(--font-body, 'Work Sans', sans-serif);
  font-size: 0.9rem;
  color: #c0392b;
}

/* Lock body scroll while the overlay is open. */
body.rgo-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  #resource-gate-overlay,
  .rgo__backdrop {
    transition: none;
    backdrop-filter: none;
  }
}
