/* ============================================================
   Access gate — shared email-gate modal for the premium
   industry briefings.

   Loaded only by the eight /industries/<slug>/ preview pages.
   Uses the tokens declared on :root in style.css so the gate
   inherits the site's palette rather than restating it.
   ============================================================ */

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 31, 46, 0.82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.gate-overlay[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.gate-dialog {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--color-white, #fff);
  color: var(--color-text, #1a1a2e);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-xl, 0 24px 64px rgba(0, 0, 0, 0.12));
  padding: 36px;
  transform: translateY(12px);
  transition: transform 0.18s ease;
}

.gate-overlay[data-open="true"] .gate-dialog { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .gate-overlay,
  .gate-dialog { transition: none; }
}

.gate-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-green, #008540);
}

.gate-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
}

.gate-intro {
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--color-muted, #6b7280);
}

.gate-field { margin-bottom: 16px; }

.gate-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.gate-label .gate-optional {
  font-weight: 400;
  color: var(--color-muted, #6b7280);
}

.gate-input {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  color: inherit;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  transition: border-color var(--transition, 0.18s ease);
}

.gate-input:focus {
  outline: none;
  border-color: var(--color-green, #008540);
  box-shadow: 0 0 0 3px var(--color-green-glow, rgba(0, 133, 64, 0.15));
}

.gate-input[aria-invalid="true"] { border-color: #b42318; }

.gate-error {
  display: none;
  margin: 6px 0 0;
  font-size: 13px;
  color: #b42318;
}

.gate-error[data-visible="true"] { display: block; }

/* The recovery link inside a rate-limit error.

   A rate-limit message is the only error here the visitor cannot fix by
   correcting the field above it, so its contact link is the action, not
   a footnote — it gets its own line and a button-like target rather than
   inheriting the error text's 13px red run-on. It stays in the error's
   red family, because it is still an error being reported.

   line-height on .gate-error is left alone: this is a block child, and
   raising the paragraph's leading to suit it would loosen every
   single-line field error on the form. */
.gate-error-contact {
  /* block, not inline-block: appended inside the error <p>, an
     inline-block sits on the last line of the sentence and reads as a
     word in it. width:fit-content keeps the target the size of its own
     label rather than the full column. */
  display: block;
  width: fit-content;
  margin-top: 12px;
  padding: 7px 14px;
  border: 1px solid currentColor;
  border-radius: 8px;
  color: #b42318;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.gate-error-contact:hover,
.gate-error-contact:focus-visible {
  background: #b42318;
  color: #fff;
}

.gate-consent {
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-muted, #6b7280);
}

.gate-submit {
  width: 100%;
  padding: 13px 24px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--color-green, #008540);
  border: 0;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: background var(--transition, 0.18s ease);
}

.gate-submit:hover:not(:disabled) { background: var(--color-green-light, #00A44E); }
.gate-submit:disabled { opacity: 0.6; cursor: progress; }

.gate-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--color-muted, #6b7280);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.gate-close:hover { background: var(--color-light, #f8f9fa); }

.gate-dialog { position: relative; }

/* Focus visibility is a requirement, not a nicety — the whole
   dialog is keyboard-operable. */
.gate-dialog :focus-visible {
  outline: 3px solid var(--color-green, #008540);
  outline-offset: 2px;
}

/* ---- success state ---- */
.gate-success { display: none; text-align: center; padding: 12px 0; }
.gate-success[data-visible="true"] { display: block; }

.gate-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-green-glow, rgba(0, 133, 64, 0.15));
  color: var(--color-green, #008540);
}

.gate-success-title { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.gate-success-text  { margin: 0; font-size: 15px; color: var(--color-muted, #6b7280); }

.gate-form[data-hidden="true"] { display: none; }

@media (max-width: 560px) {
  .gate-dialog { padding: 28px 22px; }
  .gate-title  { font-size: 20px; }
}
