/* ═══════════════════════════════════════════════════════════
   GATED DOWNLOAD FORM  (.rdf-*)  — SHARED COMPONENT STYLES
   Markup: template-parts/promo-cards/download-form.php
   Behaviour: custom-assets/js/resource-download-form.js
   Handler: intone_handle_resource_download_form() in functions.php

   Extracted out of single-post.css (2026-07-31) because the same
   component is now embedded outside a single post: the Public Sector
   page's lead-magnet band renders it too, and single-post.css never
   loads on a page. Enqueued by intone_resource_form_assets() wherever
   the form actually appears, so there is one copy of these rules and
   no chance of the two surfaces drifting apart.

   Layout that is specific to the single-post SIDEBAR (stacking order,
   narrow-column max-width) deliberately stayed behind in
   single-post.css — it is not a property of the component.
   ═══════════════════════════════════════════════════════════ */

.rdf-card {
  border: 1px solid #a5abb3;
  background: #fff;
  padding: 24px 22px;
  font-family: 'Public Sans', sans-serif;
}

.rdf-heading {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: #141414;
  margin: 0 0 8px;
}

.rdf-intro {
  font-size: 15px;
  line-height: 1.55;
  color: #333;
  margin: 0 0 18px;
}

.rdf-form { margin: 0; }

/* Honeypot — visually and semantically hidden from real users */
.rdf-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.rdf-row { margin: 0 0 14px; }

.rdf-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rdf-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.rdf-group > label,
.rdf-fieldset > legend {
  font-size: 13px;
  font-weight: 600;
  color: #233963;
  padding: 0;
}

.rdf-req { color: #d33; }

.rdf-form input[type="text"],
.rdf-form input[type="email"],
.rdf-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #a5abb3;
  border-radius: 4px;
  background: #fff;
  color: #141414;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rdf-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23233963' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.rdf-form input::placeholder { color: #8a9099; }

.rdf-form input:focus,
.rdf-form select:focus {
  outline: none;
  border-color: #233963;
  box-shadow: 0 0 0 3px rgba(35, 57, 99, 0.15);
}

.rdf-form input.invalid,
.rdf-form select.invalid {
  border-color: #d33;
  box-shadow: 0 0 0 3px rgba(221, 51, 51, 0.12);
}

.rdf-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.rdf-fieldset.invalid > legend { color: #d33; }

.rdf-radios {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.rdf-radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 400;
  color: #141414;
  cursor: pointer;
}

.rdf-radio input { accent-color: #233963; width: 16px; height: 16px; }

.rdf-actions { margin: 20px 0 0; }

.rdf-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border: 2px solid #233963;
  background: #233963;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.rdf-submit:hover { background: #fff; color: #233963; }

.rdf-submit:disabled,
.rdf-submit.loading {
  opacity: 0.75;
  cursor: default;
  background: #233963;
  color: #fff;
}

.rdf-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rdf-spin 0.7s linear infinite;
}

.rdf-submit.loading .rdf-spinner { display: inline-block; }

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

.rdf-consent {
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
  margin: 14px 0 0;
}

.rdf-consent a { color: #233963; text-decoration: underline; }

.rdf-status {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
}

.rdf-status.success {
  padding: 12px 14px;
  background: #e7f6ec;
  border: 1px solid #9bd6ac;
  color: #1a6b34;
}

.rdf-status.error {
  padding: 12px 14px;
  background: #fdecec;
  border: 1px solid #f0b4b4;
  color: #a12626;
}

/* Editor-only "not live yet" notice (no Document chosen) */
.rdf-card--notice {
  background: #fff8e5;
  border-color: #e8c766;
}
.rdf-card--notice p { margin: 0 0 6px; font-size: 14px; color: #6a5300; }
.rdf-card--notice p:last-child { margin-bottom: 0; }

/* ── Gated Download Form — dark mode ─────────────────────── */
[data-theme="dark"] .rdf-card {
  background: var(--t-surface-raised);
  border-color: var(--t-border-strong);
}

[data-theme="dark"] .rdf-heading { color: var(--t-text); }
[data-theme="dark"] .rdf-intro { color: var(--t-text-muted); }

[data-theme="dark"] .rdf-group > label,
[data-theme="dark"] .rdf-fieldset > legend {
  color: var(--t-text);
}

[data-theme="dark"] .rdf-form input[type="text"],
[data-theme="dark"] .rdf-form input[type="email"],
[data-theme="dark"] .rdf-form select {
  background: var(--t-surface);
  border-color: var(--t-border-strong);
  color: var(--t-text);
}

[data-theme="dark"] .rdf-form input::placeholder { color: var(--t-text-muted); }

[data-theme="dark"] .rdf-form input:focus,
[data-theme="dark"] .rdf-form select:focus {
  border-color: var(--ds-gold, #f6b43f);
  box-shadow: 0 0 0 3px rgba(246, 180, 63, 0.2);
}

[data-theme="dark"] .rdf-radio { color: var(--t-text); }
[data-theme="dark"] .rdf-radio input { accent-color: var(--ds-gold, #f6b43f); }

[data-theme="dark"] .rdf-submit {
  background: var(--ds-gold, #f6b43f);
  border-color: var(--ds-gold, #f6b43f);
  color: #1a1a1a;
}
[data-theme="dark"] .rdf-submit:hover {
  background: transparent;
  color: var(--ds-gold, #f6b43f);
}
[data-theme="dark"] .rdf-submit:disabled,
[data-theme="dark"] .rdf-submit.loading {
  background: var(--ds-gold, #f6b43f);
  color: #1a1a1a;
}
[data-theme="dark"] .rdf-spinner {
  border-color: rgba(26, 26, 26, 0.35);
  border-top-color: #1a1a1a;
}

[data-theme="dark"] .rdf-consent { color: var(--t-text-muted); }
[data-theme="dark"] .rdf-consent a { color: var(--ds-gold, #f6b43f); }

[data-theme="dark"] .rdf-status.success {
  background: rgba(45, 122, 62, 0.18);
  border-color: rgba(120, 200, 140, 0.5);
  color: #9be0af;
}
[data-theme="dark"] .rdf-status.error {
  background: rgba(160, 40, 40, 0.18);
  border-color: rgba(220, 120, 120, 0.5);
  color: #f2b3b3;
}

[data-theme="dark"] .rdf-card--notice {
  background: rgba(232, 199, 102, 0.12);
  border-color: var(--ds-gold, #f6b43f);
}
[data-theme="dark"] .rdf-card--notice p { color: var(--ds-gold, #f6b43f); }

/* Single-column fallback for very narrow sidebars */
@media (max-width: 400px) {
  .rdf-row--2col { grid-template-columns: 1fr; }
}

