/* 508 Ministry 25% Self-Promo Info Icon & Luminous Guide Modal
 * Self-hosted SIL OFL 1.1 Cormorant + Figtree only. Zero external CDN fonts.
 */

.sp508-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  margin-left: 5px;
  padding: 0;
  border-radius: 999px;
  border: 1.5px solid #f7dc88;
  background: linear-gradient(145deg, #fff5cf 0%, #e4b243 55%, #c88d1d 100%);
  color: #102040;
  font-family: 'Cormorant', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 2px 10px rgba(228, 178, 67, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.sp508-info-btn:hover,
.sp508-info-btn:focus-visible {
  transform: translateY(-1px) scale(1.07);
  box-shadow: 0 4px 16px rgba(242, 200, 100, 0.72), 0 0 0 3px rgba(242, 200, 100, 0.28);
  outline: none;
  filter: brightness(1.04);
}

.sp508-info-btn.is-in-rate-row {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin-left: 0;
  align-self: center;
  font-size: 17px;
}

.sp508-chip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 4px 10px 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(212, 155, 42, 0.65);
  background: linear-gradient(135deg, #fffdf5 0%, #fff2cc 100%);
  color: #142546;
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(200, 141, 29, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sp508-chip-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 141, 29, 0.3);
}

.sp508-chip-trigger .sp508-chip-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f3c963, #c68b1c);
  color: #0f1e3a;
  font-family: 'Cormorant', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
}

/* LUMINOUS MODAL BACKDROP & DIALOG */
.sp508-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 19, 41, 0.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  overflow-y: auto;
  box-sizing: border-box;
}

.sp508-backdrop.is-open {
  display: flex;
}

.sp508-modal {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffdf8 0%, #f8faff 100%);
  border: 1.5px solid rgba(212, 155, 42, 0.75);
  box-shadow: 0 28px 80px rgba(6, 16, 36, 0.45), 0 0 0 1px rgba(255, 245, 207, 0.7) inset;
  color: #132342;
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

.sp508-modal *,
.sp508-modal *::before,
.sp508-modal *::after {
  box-sizing: border-box;
}

.sp508-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  background: linear-gradient(135deg, #0c1d3e 0%, #1a3b78 65%, #122854 100%);
  border-bottom: 2px solid #d49b2a;
  color: #ffffff;
  flex-shrink: 0;
}

.sp508-head-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.sp508-head-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff1bd, #d49b2a);
  color: #0d1d3c;
  font-family: 'Cormorant', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(242, 200, 100, 0.45);
}

.sp508-head-title {
  margin: 0;
  font-family: 'Cormorant', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: #fffdf7;
}

.sp508-head-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #d3e4fb;
}

.sp508-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.sp508-close:hover {
  background: rgba(242, 200, 100, 0.28);
  transform: scale(1.06);
}

.sp508-body {
  padding: 20px 22px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 1. HERO STRIP */
.sp508-hero {
  display: grid;
  grid-template-columns: 196px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fffaf0 0%, #f5f9ff 100%);
  border: 1.5px solid rgba(212, 155, 42, 0.52);
  box-shadow: 0 8px 24px rgba(15, 34, 70, 0.07);
}

.sp508-cover-link {
  display: block;
  width: 196px;
  height: 261px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #d49b2a;
  box-shadow: 0 12px 28px rgba(11, 27, 54, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  background: #0b1b36;
  flex-shrink: 0;
}

.sp508-cover-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(11, 27, 54, 0.32);
}

.sp508-cover-img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 264px;
  object-fit: cover;
  object-position: center top;
}

.sp508-hero-copy {
  min-width: 0;
}

.sp508-eyebrow {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: #fdf0ca;
  border: 1px solid #e2b857;
  color: #6f4704;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sp508-hero-h2 {
  margin: 0 0 8px;
  font-family: 'Cormorant', Georgia, serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  color: #0f2144;
}

.sp508-hero-p {
  margin: 0 0 11px;
  font-size: 13.8px;
  line-height: 1.52;
  color: #293e5e;
}

.sp508-override-box {
  padding: 11px 13px;
  border-radius: 12px;
  background: linear-gradient(135deg, #edf4ff 0%, #f5f9ff 100%);
  border: 1.25px solid #9ab9e8;
  border-left: 4px solid #1e4b94;
  font-size: 13px;
  line-height: 1.48;
  color: #162e57;
  margin-bottom: 13px;
}

.sp508-override-box strong {
  color: #103775;
}

.sp508-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sp508-btn-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0e2246 0%, #1e4b94 100%);
  color: #ffffff;
  font-size: 13.2px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #1e4b94;
  box-shadow: 0 4px 12px rgba(14, 34, 70, 0.22);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.sp508-btn-pdf:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  color: #ffffff;
}

.sp508-btn-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 11px;
  background: #ffffff;
  color: #10254a;
  font-size: 13.2px;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid #d49b2a;
  transition: background 0.14s ease, transform 0.14s ease;
}

.sp508-btn-dl:hover {
  background: #fff7df;
  transform: translateY(-1px);
  color: #10254a;
}

/* 2. 12 TRACKABLE ADVERTISING FORMS GRID */
.sp508-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sp508-sec-title {
  margin: 0;
  font-family: 'Cormorant', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #0e2042;
}

.sp508-sec-hint {
  font-size: 12.2px;
  font-weight: 600;
  color: #526888;
}

.sp508-channels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.sp508-ch-pill {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1.25px solid #d5e0f0;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sp508-ch-pill:hover {
  border-color: #d49b2a;
  background: #fffcf3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 146, 40, 0.14);
}

.sp508-ch-pill.is-selected {
  border-color: #c89228;
  background: linear-gradient(135deg, #fffaf0 0%, #fff3d1 100%);
  box-shadow: 0 4px 14px rgba(200, 146, 40, 0.22);
}

.sp508-ch-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0e2246;
  color: #f6d57a;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.sp508-ch-name {
  font-size: 12.6px;
  font-weight: 800;
  color: #102344;
  line-height: 1.25;
}

.sp508-ch-sub {
  font-size: 11.4px;
  color: #4c6282;
  line-height: 1.32;
  margin-top: 2px;
}

/* 3. SUBMIT EXTERNAL AD LINKS CARD */
.sp508-form-card {
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(155deg, #ffffff 0%, #f5f8ff 100%);
  border: 1.5px solid #cbd9ee;
}

.sp508-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #eef4fd;
  border: 1px solid #c6d8f2;
  margin-bottom: 14px;
  font-size: 13px;
  color: #162e57;
}

.sp508-status-bar.is-qualified {
  background: linear-gradient(135deg, #eefaf2 0%, #fff9e6 100%);
  border-color: #7cc59a;
  color: #104929;
}

.sp508-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sp508-badge-qual {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #146c3a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
}

.sp508-badge-agent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1e4b94;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
}

.sp508-ref-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #0f2144;
  color: #e4effd;
  font-size: 12.2px;
}

.sp508-ref-row code {
  color: #f6d57a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}

.sp508-copy-ref {
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(246, 213, 122, 0.65);
  background: rgba(246, 213, 122, 0.16);
  color: #fff3c4;
  font-size: 11.8px;
  font-weight: 700;
  cursor: pointer;
}

.sp508-copy-ref:hover {
  background: rgba(246, 213, 122, 0.3);
}

.sp508-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sp508-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sp508-field.is-full {
  grid-column: 1 / -1;
}

.sp508-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #162b4d;
}

.sp508-input,
.sp508-select,
.sp508-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #c6d4e8;
  background: #ffffff;
  color: #11223f;
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sp508-input:focus,
.sp508-select:focus,
.sp508-textarea:focus {
  outline: none;
  border-color: #c89228;
  box-shadow: 0 0 0 3px rgba(212, 155, 42, 0.22);
}

.sp508-textarea {
  min-height: 82px;
  resize: vertical;
}

.sp508-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
}

.sp508-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1.5px solid #b98017;
  background: linear-gradient(135deg, #ffe9a8 0%, #e1ae3c 55%, #c78b1b 100%);
  color: #102040;
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(199, 139, 27, 0.34);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.sp508-btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(199, 139, 27, 0.45);
  filter: brightness(1.03);
}

.sp508-btn-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.sp508-signin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #0e2246;
  color: #fff6d1;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

.sp508-signin-link:hover {
  background: #1a3b78;
  color: #ffffff;
}

.sp508-msg {
  margin-top: 11px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  display: none;
}

.sp508-msg.is-ok {
  display: block;
  background: #edf9f2;
  border: 1px solid #84cca0;
  color: #11532d;
}

.sp508-msg.is-err {
  display: block;
  background: #fff3f2;
  border: 1px solid #e7a49d;
  color: #8c2017;
}

/* SUBMITTED LINKS LIST */
.sp508-list-wrap {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid #d5e0f0;
}

.sp508-list-title {
  margin: 0 0 9px;
  font-size: 13px;
  font-weight: 800;
  color: #162b4d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sp508-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp508-sub-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #d7e2f0;
  font-size: 12.6px;
}

.sp508-sub-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.sp508-sub-ch {
  font-size: 11.4px;
  font-weight: 800;
  color: #9c670d;
}

.sp508-sub-url {
  color: #14438b;
  font-weight: 600;
  text-decoration: underline;
  word-break: break-all;
}

.sp508-sub-notes {
  font-size: 11.6px;
  color: #506584;
}

.sp508-sub-pill {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e6f6ec;
  border: 1px solid #88cda3;
  color: #125c31;
  font-size: 11px;
  font-weight: 800;
}

/* RESPONSIVE MOBILE */
@media (max-width: 780px) {
  .sp508-backdrop {
    padding: 10px;
    align-items: flex-end;
  }
  .sp508-modal {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }
  .sp508-head {
    padding: 13px 15px;
  }
  .sp508-head-title {
    font-size: 20px;
  }
  .sp508-body {
    padding: 14px 14px 18px;
    gap: 14px;
  }
  .sp508-hero {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 14px;
  }
  .sp508-cover-link {
    width: 150px;
    height: 200px;
    max-width: 150px;
    margin: 0 auto;
  }
  .sp508-cover-img {
    max-height: 200px;
  }
  .sp508-hero-h2 {
    font-size: 23px;
  }
  .sp508-channels-grid {
    grid-template-columns: 1fr 1fr;
  }
  .sp508-form-grid {
    grid-template-columns: 1fr;
  }
  .sp508-btn-submit,
  .sp508-btn-pdf,
  .sp508-btn-dl {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .sp508-channels-grid {
    grid-template-columns: 1fr;
  }
}
