/* ============================================================================
   BioLogic Signature Generator — front-end styles
   Design tokens: Navy #23346A · Blue #5C81F7 · Red #C3151B · Coral #FF7854
                  Yellow #FFCF00 · Light BG #f8f9fb · Border #e0e4f0
   ========================================================================= */

/* ── Base ────────────────────────────────────────────────────────────── */
.bl-siggen {
  max-width: 1200px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #23346A;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.bl-siggen *, .bl-siggen *::before, .bl-siggen *::after { box-sizing: border-box; }

/* ── Language switch (top-right) ─────────────────────────────────────── */
.bl-siggen .bl-lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 8px;
}
.bl-siggen .bl-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 6px 10px;
  border: 1px solid #e0e4f0;
  border-radius: 6px;
  background: #fff;
  color: #6b7590;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.bl-siggen .bl-lang-btn:hover { border-color: #5C81F7; color: #23346A; }
.bl-siggen .bl-lang-btn.is-active {
  background: #23346A;
  border-color: #23346A;
  color: #fff;
}

/* ── Layout: 2 columns (form + gallery) ─────────────────────────────── */
.bl-siggen__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .bl-siggen__layout { grid-template-columns: 1fr; }
}

/* ── Cards ─────────────────────────────────────────────────────────── */
.bl-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(35, 52, 106, 0.08);
  padding: 2rem;
}
.bl-siggen__form.bl-card {
  background: #23346A;
  border-top: none;
  color: #fff;
  box-shadow: 0 4px 16px rgba(35, 52, 106, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.bl-siggen__gallery.bl-card {
  background: #23346A;
  border-top: none;
  color: #fff;
  box-shadow: 0 4px 16px rgba(35, 52, 106, 0.25);
  padding: 1.5rem;
}
.bl-preview.bl-card {
  border-top: 4px solid #FFCF00;
  margin-top: 1.5rem;
}

/* ── Fields ────────────────────────────────────────────────────────── */
.bl-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}
.bl-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #23346A;
  margin: 0;
}
.bl-opt { color: #9aa3bd; font-weight: 400; font-size: 0.85em; }
.bl-sublabel {
  display: block;
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #23346A;
}
.bl-siggen .bl-siggen__form .bl-sublabel {
  color: #FFCF00;
}
.bl-req { color: #C3151B; font-weight: 700; }
.bl-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7590;
  line-height: 1.5;
}

/* ── Inputs / textarea / select ────────────────────────────────────── */
.bl-siggen .bl-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  margin: 0;
  border: 1px solid #e0e4f0;
  border-radius: 6px;
  background: #fff;
  color: #23346A;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.bl-siggen .bl-input::placeholder { color: #9aa3bd; }
.bl-siggen .bl-input:focus {
  outline: none;
  border-color: #5C81F7;
  box-shadow: 0 0 0 3px rgba(92, 129, 247, 0.18);
}
.bl-siggen textarea.bl-input { resize: vertical; min-height: 90px; }
.bl-siggen .bl-input--readonly { background: #fafbfe; color: #23346A; }

/* Notice textarea: soft coral border */
.bl-siggen .bl-input--notice {
  border-color: #f0d9d0;
  background: #fff;
}

/* Custom select arrow (two diagonals forming a caret) */
.bl-siggen select.bl-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #5C81F7 50%),
    linear-gradient(135deg, #5C81F7 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 55%,
    calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* ── Row with 2 equal columns ──────────────────────────────────────── */
.bl-siggen .bl-row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: end;
}
.bl-siggen .bl-row-2 > .bl-field {
  min-width: 0;
  width: 100%;
}
@media (max-width: 600px) {
  .bl-siggen .bl-row-2 { grid-template-columns: 1fr; }
}

/* ── LinkedIn radio "chips" ────────────────────────────────────────── */
.bl-siggen .bl-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 500px) {
  .bl-siggen .bl-radio-group { grid-template-columns: 1fr; }
}
.bl-siggen .bl-radio-inline {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 2px solid #e0e4f0;
  border-radius: 6px;
  background: #fff;
  color: #6b7590;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  user-select: none;
}
.bl-siggen .bl-radio-inline input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.bl-siggen .bl-radio-inline::before {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid #c6cddf;
  background: #fff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.bl-siggen .bl-radio-inline:hover {
  border-color: #c6cddf;
  color: #23346A;
}
.bl-siggen .bl-radio-inline:has(input:checked) {
  border-color: #5C81F7;
  background: rgba(92, 129, 247, 0.08);
  color: #23346A;
}
.bl-siggen .bl-radio-inline:has(input:checked)::before {
  border-color: #5C81F7;
  background: #5C81F7;
  box-shadow: inset 0 0 0 3px #fff;
}
/* Focus ring on the visible chip (native input receives :focus) */
.bl-siggen .bl-radio-inline:focus-within {
  box-shadow: 0 0 0 3px rgba(92, 129, 247, 0.18);
}

/* ── Important Notice — highlighted card block ─────────────────────── */
.bl-siggen .bl-field--notice {
  padding: 1rem 1rem 1rem 1.25rem;
  border-left: 4px solid #FF7854;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(135deg, rgba(255, 120, 84, 0.07), rgba(255, 207, 0, 0.05));
}

.bl-siggen .bl-field--notice .bl-label { color: #C3151B; }
.bl-siggen .bl-icon-warn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 4px;
  background: #FF7854;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Newsletter subscriptions box ──────────────────────────────────── */
.bl-siggen .bl-newsletter-box {
  padding: 1.5rem;
  border: 1px solid #e0e4f0;
  border-radius: 8px;
  background: #f8f9fb;
  gap: 0.5rem;
}
.bl-siggen .bl-newsletter-box .bl-label { margin-bottom: 0.25rem; }
.bl-siggen .bl-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  margin: 0;
  font-size: 0.9rem;
  color: #23346A;
  cursor: pointer;
  line-height: 1.4;
}
.bl-siggen .bl-checkbox-label input[type="checkbox"] {
  width: 17px; height: 17px;
  margin: 0;
  accent-color: #5C81F7;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Banner selector (readonly input + clear button) ───────────────── */
.bl-siggen .bl-banner-selector {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}
.bl-siggen .bl-banner-selector .bl-input { flex: 1; }

/* ── Submit row ────────────────────────────────────────────────────── */
.bl-siggen .bl-submit-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 0.25rem;
  margin: 0;
}
.bl-siggen .bl-submit-row .bl-btn {
  flex: 1 1 auto;
  min-width: 200px;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.bl-siggen .bl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border: 1px solid #e0e4f0;
  border-radius: 6px;
  background: #fff;
  color: #23346A;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bl-siggen .bl-btn:hover { background: #f8f9fb; }

.bl-siggen .bl-btn--primary {
  background: #C3151B;
  color: #fff;
  border-color: #C3151B;
}
.bl-siggen .bl-btn--primary:hover {
  background: #a01117;
  border-color: #a01117;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(195, 21, 27, 0.25);
}

.bl-siggen .bl-btn--light {
  background: transparent;
  color: #5C81F7;
  border: 2px solid #5C81F7;
}
.bl-siggen .bl-btn--light:hover {
  background: #5C81F7;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(92, 129, 247, 0.25);
}

.bl-siggen .bl-btn--orange {
  background: #FF7854;
  color: #fff;
  border-color: #FF7854;
}
.bl-siggen .bl-btn--orange:hover {
  background: #e56a48;
  border-color: #e56a48;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 120, 84, 0.25);
}

.bl-siggen .bl-btn--ghost {
  padding: 0.75rem 1.25rem;
  border: 2px solid #e0e4f0;
  background: #fff;
  color: #6b7590;
  font-size: 0.9rem;
  white-space: nowrap;
}
.bl-siggen .bl-btn--ghost:hover {
  border-color: #C3151B;
  color: #C3151B;
  background: #fff;
}

/* ── Alerts ────────────────────────────────────────────────────────── */
.bl-siggen .bl-alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.bl-siggen .bl-alert--error {
  background: rgba(195, 21, 27, 0.08);
  border: 1px solid rgba(195, 21, 27, 0.3);
  color: #C3151B;
}
.bl-siggen .bl-alert--warning {
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #7a5b17;
}

/* ── Gallery header ────────────────────────────────────────────────── */
.bl-siggen .bl-gallery__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.bl-siggen .bl-gallery__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #23346A;
}
.bl-siggen .bl-gallery__count {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  background: #5C81F7;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Gallery scroll area ───────────────────────────────────────────── */
.bl-siggen .bl-gallery__grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-top: 1rem;
}
.bl-siggen .bl-gallery__grid::-webkit-scrollbar { width: 8px; }
.bl-siggen .bl-gallery__grid::-webkit-scrollbar-thumb {
  background: #d7ddef;
  border-radius: 4px;
}
.bl-siggen .bl-gallery__grid::-webkit-scrollbar-track { background: transparent; }

/* ── Banner items ──────────────────────────────────────────────────── */
.bl-siggen .bl-banner-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  border: 2px solid #e0e4f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  color: #23346A;
  transition: all 0.15s ease;
}
.bl-siggen .bl-banner-item:hover:not(:disabled) {
  border-color: #5C81F7;
  box-shadow: 0 2px 8px rgba(35, 52, 106, 0.08);
}
.bl-siggen .bl-banner-item.is-selected {
  border-color: #5C81F7;
  background: rgba(92, 129, 247, 0.05);
}
.bl-siggen .bl-banner-item:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.bl-siggen .bl-banner-item__name {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #23346A;
  word-break: break-word;
}
.bl-siggen .bl-banner-item__img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 6px;
  border: 1px solid #eef0f7;
}

/* ── Preview card ──────────────────────────────────────────────────── */
.bl-siggen .bl-preview__title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #23346A;
}
.bl-siggen .bl-preview__frame {
  border: 1px dashed #d7ddef;
  border-radius: 8px;
  overflow: hidden;
  background: #fafbfe;
}
.bl-siggen .bl-preview__iframe {
  display: block;
  width: 100%;
  min-height: 220px;
  border: 0;
  background: #fff;
}
.bl-siggen .bl-preview__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.bl-siggen .bl-preview__raw { margin-top: 1rem; }
.bl-siggen .bl-preview__raw summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: #5C81F7;
  font-weight: 600;
  padding: 0.25rem 0;
}
.bl-siggen .bl-preview__raw summary:hover { color: #C3151B; }
.bl-siggen .bl-raw-html {
  display: block;
  width: 100%;
  min-height: 260px;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e0e4f0;
  border-radius: 6px;
  background: #f8f9fb;
  color: #23346A;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.75rem;
  box-sizing: border-box;
  resize: vertical;
}

/* ============================================================================
   BLUE FORM VARIANT — form card on solid blue (#5C81F7) background
   ========================================================================= */

/* Text tones inside the blue form */
.bl-siggen .bl-siggen__form .bl-label {
  color: #fff;
}
.bl-siggen .bl-siggen__form .bl-opt {
  color: rgba(255, 255, 255, 0.7);
}
.bl-siggen .bl-siggen__form .bl-req {
  color: #FFCF00;
}
.bl-siggen .bl-siggen__form .bl-hint {
  color: rgba(255, 255, 255, 0.85);
}

/* Input focus: switch to yellow to stand out from the blue container */
.bl-siggen .bl-siggen__form .bl-input:focus {
  border-color: #FFCF00;
  box-shadow: 0 0 0 3px rgba(255, 207, 0, 0.35);
}

/* Radio chips — glassy on blue, solid white when selected */
.bl-siggen .bl-siggen__form .bl-radio-inline {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.92);
}
.bl-siggen .bl-siggen__form .bl-radio-inline::before {
  border-color: rgba(255, 255, 255, 0.6);
  background: transparent;
}
.bl-siggen .bl-siggen__form .bl-radio-inline:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.bl-siggen .bl-siggen__form .bl-radio-inline:has(input:checked) {
  background: #fff;
  border-color: #fff;
  color: #23346A;
}
.bl-siggen .bl-siggen__form .bl-radio-inline:has(input:checked)::before {
  background: #23346A;
  border-color: #23346A;
  box-shadow: inset 0 0 0 3px #fff;
}
.bl-siggen .bl-siggen__form .bl-radio-inline:focus-within {
  box-shadow: 0 0 0 3px rgba(255, 207, 0, 0.35);
}

/* Important Notice — white card that pops against the blue form */
.bl-siggen .bl-siggen__form .bl-field--notice {
  background: #fff;
  border-left: 4px solid #FF7854;
}
.bl-siggen .bl-siggen__form .bl-field--notice .bl-label {
  color: #C3151B;
}
.bl-siggen .bl-siggen__form .bl-field--notice .bl-opt {
  color: #9aa3bd;
}
.bl-siggen .bl-siggen__form .bl-field--notice .bl-hint {
  color: #6b7590;
}

/* Newsletter box — solid white so checkbox labels stay readable */
.bl-siggen .bl-siggen__form .bl-newsletter-box {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-label {
  color: #23346A;
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-opt {
  color: #9aa3bd;
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-checkbox-label {
  color: #23346A;
}
/* Radio chips inside the white newsletter box override the navy-form styling. */
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-radio-group--3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (max-width: 560px) {
  .bl-siggen .bl-siggen__form .bl-newsletter-box .bl-radio-group--3col {
    grid-template-columns: 1fr;
  }
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-radio-inline {
  background: #fff;
  border-color: #e0e4f0;
  color: #6b7590;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-radio-inline::before {
  border-color: #c6cddf;
  background: #fff;
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-radio-inline:hover {
  border-color: #5C81F7;
  color: #23346A;
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-radio-inline:has(input:checked) {
  border-color: #5C81F7;
  background: rgba(92, 129, 247, 0.08);
  color: #23346A;
}
.bl-siggen .bl-siggen__form .bl-newsletter-box .bl-radio-inline:has(input:checked)::before {
  background: #5C81F7;
  border-color: #5C81F7;
  box-shadow: inset 0 0 0 3px #fff;
}

/* Signature-light button — outline yellow instead of outline blue */
.bl-siggen .bl-siggen__form .bl-btn--light {
  background: transparent;
  color: #FFCF00;
  border: 2px solid #FFCF00;
}
.bl-siggen .bl-siggen__form .bl-btn--light:hover {
  background: #FFCF00;
  color: #23346A;
  border-color: #FFCF00;
  box-shadow: 0 4px 12px rgba(255, 207, 0, 0.35);
}

/* "No banner" ghost button — glassy white on blue */
.bl-siggen .bl-siggen__form .bl-btn--ghost {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.bl-siggen .bl-siggen__form .bl-btn--ghost:hover {
  background: #fff;
  border-color: #fff;
  color: #C3151B;
}

/* Error alert — bring back white background so red text stays readable */
.bl-siggen .bl-siggen__form .bl-alert--error {
  background: #fff;
  border-color: rgba(195, 21, 27, 0.4);
  color: #C3151B;
}

/* Checkbox labels sitting directly on the navy form background (not those
   inside the white newsletter box, which keep their navy text). */
.bl-siggen .bl-siggen__form .bl-field:not(.bl-newsletter-box) > .bl-checkbox-label,
.bl-siggen .bl-siggen__form .bl-field:not(.bl-newsletter-box) > .bl-checkbox-label span {
  color: #fff;
}

/* ============================================================================
   BLUE GALLERY VARIANT — gallery card on solid navy (#23346A) background
   ========================================================================= */

.bl-siggen .bl-siggen__gallery .bl-gallery__title {
  color: #fff;
}
.bl-siggen .bl-siggen__gallery .bl-hint {
  color: rgba(255, 255, 255, 0.85);
}
.bl-siggen .bl-siggen__gallery .bl-gallery__count {
  background: #FFCF00;
  color: #23346A;
}

/* Banner cards stand out as white cards on the navy backdrop */
.bl-siggen .bl-siggen__gallery .bl-banner-item {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  color: #23346A;
}
.bl-siggen .bl-siggen__gallery .bl-banner-item:hover:not(:disabled) {
  border-color: rgba(255, 207, 0, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.bl-siggen .bl-siggen__gallery .bl-banner-item.is-selected {
  border-color: #FFCF00;
  border-width: 4px;
  padding: calc(0.75rem - 2px);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 207, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}
.bl-siggen .bl-siggen__gallery .bl-banner-item.is-selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #FFCF00;
  color: #23346A;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.bl-siggen .bl-siggen__gallery .bl-banner-item {
  position: relative;
}
.bl-siggen .bl-siggen__gallery .bl-banner-item:disabled {
  opacity: 0.35;
}

/* Scrollbar visible on navy */
.bl-siggen .bl-siggen__gallery .bl-gallery__grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
}

/* No-banner warning alert readable on navy */
.bl-siggen .bl-siggen__gallery .bl-alert--warning {
  background: #fff;
  border-color: #ffd591;
  color: #7a5b17;
}
