/* =====================================================================
   LICENSE & ACCESS section + request form modal
   Loaded after style.css; reuses its custom properties.
   ===================================================================== */

/* ---------- License badge on download cards ---------- */
.license-note {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}
.license-note a { text-decoration: underline; text-underline-offset: 2px; }
.license-note a:hover { color: var(--primary); }
/* style.css gives every .download-card p flex-grow + bottom margin; undo for the note */
.download-card p.license-note { flex-grow: 0; margin: 14px 0 0; }

/* ---------- License & Access section ---------- */
#license { background: var(--bg-alt); }

.access-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--border);
  border: 1px solid var(--border);
}

.access-card {
  background: var(--card-bg);
  padding: 36px 30px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.access-card.is-featured::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
}

.access-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.access-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}

.access-lead {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.access-list {
  list-style: none;
  flex-grow: 1;
  margin-bottom: 24px;
}

.access-list li {
  position: relative;
  padding-left: 22px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 9px;
}

.access-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--secondary);
  border-bottom: 2px solid var(--secondary);
  transform: rotate(-45deg);
}

.access-list a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

.access-list li.is-no::before {
  border: none;
  width: 10px;
  height: 2px;
  top: 0.72em;
  background: var(--muted);
  transform: none;
}

.access-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: var(--bg-alt);
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.access-card .btn { width: 100%; justify-content: center; }

.access-footnote {
  max-width: 820px;
  margin: 32px auto 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.access-footnote a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* Accent button for the custom-collection CTA */
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- Modal ---------- */
.rq-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(16, 16, 30, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.rq-backdrop.is-open { opacity: 1; visibility: visible; }

body.rq-lock { overflow: hidden; }

.rq-dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.rq-backdrop.is-open .rq-dialog { transform: none; }

.rq-head {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}
.rq-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
  padding-right: 40px;
}
.rq-head p { font-size: 0.85rem; color: var(--muted); }

.rq-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
}
.rq-close:hover { background: var(--bg-alt); color: var(--primary); }

.rq-body { padding: 24px 32px 8px; }

.rq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.rq-full { grid-column: 1 / -1; }

.rq-field label,
.rq-legend {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.rq-req { color: var(--accent); }
.rq-hint { font-weight: 400; color: var(--muted); }

.rq-field input[type="text"],
.rq-field input[type="email"],
.rq-field select,
.rq-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.rq-field textarea { min-height: 84px; resize: vertical; }
.rq-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.rq-field input:focus,
.rq-field select:focus,
.rq-field textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(90, 57, 182, 0.15);
}
.rq-field.has-error input,
.rq-field.has-error select,
.rq-field.has-error textarea { border-color: #c62828; }
.rq-error {
  display: none;
  font-size: 0.74rem;
  color: #c62828;
  margin-top: 4px;
}
.rq-field.has-error .rq-error,
.rq-fieldset.has-error .rq-error { display: block; }

/* Chips (checkbox / radio pills) */
.rq-fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
/* float the legend so it sits inside the fieldset box (e.g. the grey custom-collection panel) */
.rq-fieldset > legend { float: left; width: 100%; padding: 0; }
.rq-fieldset > legend + * { clear: both; }

.rq-row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 18px;
}
.rq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rq-chip { position: relative; }
.rq-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.rq-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
  background: #fff;
}
.rq-chip span:hover { border-color: var(--primary); }
.rq-chip input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.rq-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(90, 57, 182, 0.25); }

/* Custom collection block */
.rq-custom-q {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 16px 18px;
}
.rq-custom-q .rq-legend { font-size: 0.86rem; margin-bottom: 4px; }
.rq-custom-q .rq-sub { font-size: 0.78rem; color: var(--muted); margin-bottom: 12px; }

.rq-custom-fields {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
  padding: 18px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.rq-custom-fields.is-visible { display: grid; }

/* Consent */
.rq-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.rq-consent input { margin-top: 3px; accent-color: var(--primary); }
.rq-consent a { text-decoration: underline; text-underline-offset: 2px; }

.rq-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.rq-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px 28px;
  flex-wrap: wrap;
}
.rq-foot small { font-size: 0.78rem; color: var(--muted); }
.rq-foot small a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.rq-submit[disabled] { opacity: 0.6; cursor: progress; }

.rq-form-error {
  display: none;
  margin: 0 32px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #8a1c1c;
  background: #fdecec;
  border-radius: var(--radius);
}
.rq-form-error.is-visible { display: block; }

/* Success state */
.rq-success {
  display: none;
  padding: 56px 32px 48px;
  text-align: center;
}
.rq-success.is-visible { display: block; }
.rq-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: #fff;
}
.rq-success h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.rq-success p { font-size: 0.9rem; color: var(--text-secondary); max-width: 460px; margin: 0 auto 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .access-grid { grid-template-columns: 1fr; max-width: 640px; }
}

@media (max-width: 640px) {
  .rq-backdrop { padding: 0; align-items: stretch; }
  .rq-dialog { max-width: none; min-height: 100%; border-radius: 0; }
  .rq-head { padding: 22px 20px 16px; }
  .rq-body { padding: 20px 20px 4px; }
  .rq-foot { padding: 16px 20px 24px; }
  .rq-form-error { margin: 0 20px; }
  .rq-grid,
  .rq-row3,
  .rq-custom-fields.is-visible { grid-template-columns: 1fr; }
  .rq-foot .btn { width: 100%; justify-content: center; }
  .access-card { padding: 30px 22px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .rq-backdrop, .rq-dialog { transition: none; }
}
