/* Self-contained styles for the shared onboarding modal.
   This file must be loaded on every site that uses onboarding-modal.js.
   It intentionally duplicates styles that also appear in main's inline <style>
   so that comm (and any future site) renders the modal correctly without
   depending on site-specific inline CSS. */

/* ── Overlay backdrop ───────────────────────────────────────────────────── */
.lb-auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(58, 31, 16, 0.42);
  backdrop-filter: blur(8px);
}
.lb-auth-modal.open { display: flex; }

/* ── Dialog box ─────────────────────────────────────────────────────────── */
.lb-auth-dialog {
  width: min(420px, 100%);
  border: 1px solid var(--color-border, rgba(84,50,22,0.15));
  border-radius: 8px;
  background: var(--color-cream-50, #fffaf3);
  box-shadow: var(--shadow-card, 0 4px 24px rgba(0,0,0,0.12));
  padding: 24px;
}
.lb-auth-dialog-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ── Onboarding dialog size override ────────────────────────────────────── */
.lb-onboarding-dialog {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Dialog header + close button ───────────────────────────────────────── */
.lb-dialog-header { position: relative; }
.lb-dialog-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #8a7060);
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
.lb-dialog-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-brown-800, #3a1f10);
}

/* ── Form elements ──────────────────────────────────────────────────────── */
.lb-form-group { margin-top: 16px; }
.lb-form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-brown-800, #3a1f10);
  margin-bottom: 6px;
}
.lb-required { color: #c0392b; }
.lb-form-input,
.lb-form-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border, rgba(84,50,22,0.15));
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  background: white;
  color: var(--color-brown-800, #3a1f10);
  box-sizing: border-box;
}
.lb-form-input:focus,
.lb-form-select:focus {
  outline: 2px solid var(--color-brown-700, #7c4a25);
}
.lb-form-hint {
  margin-top: 4px;
  font-size: 13px;
  color: #c0392b;
}

/* ── Nickname input + check button row ──────────────────────────────────── */
.lb-nickname-check-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lb-nickname-check-row .lb-form-input {
  flex: 1;
  min-width: 0;
}

/* ── Consent group ──────────────────────────────────────────────────────── */
.lb-consent-group {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-consent-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--color-text-sub, #6b5e54);
  cursor: pointer;
}
.lb-consent-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.lb-terms-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--color-brown-700, #7c4a25);
  text-decoration: underline;
  cursor: pointer;
}

/* ── Interest tags ──────────────────────────────────────────────────────── */
.lb-interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.lb-interest-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid var(--color-border, rgba(84,50,22,0.15));
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 250, 243, 0.84);
  color: var(--color-brown-800, #3a1f10);
}
.lb-interest-tag:has(input:checked) {
  background: var(--color-brown-700, #7c4a25);
  border-color: var(--color-brown-700, #7c4a25);
  color: white;
}
.lb-interest-tag input[type="checkbox"] { display: none; }

/* ── Custom interest input ──────────────────────────────────────────────── */
.lb-custom-interest-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.lb-custom-interest-row .lb-form-input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 5px 10px;
}
.lb-custom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.lb-custom-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-brown-700, #7c4a25);
  color: white;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}
.lb-custom-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 1px;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}
.lb-custom-tag-remove:hover { opacity: 1; }

/* ── Submit button + footer ─────────────────────────────────────────────── */
.lb-btn-sm {
  min-height: 28px;
  padding: 0 10px;
  font-size: 13px;
}
.lb-auth-message {
  margin-top: 12px;
  color: var(--color-text-muted, #8a7060);
  font-size: 14px;
  line-height: 1.55;
}
.lb-onboarding-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted, #8a7060);
}
.lb-onboarding-footer button {
  background: none;
  border: none;
  color: var(--color-text-sub, #6b5e54);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ── My-page dialog ─────────────────────────────────────────────────────── */
.lb-mypage-dialog {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}
.lb-mypage-section-save {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}
.lb-mypage-section-save .lb-form-input { flex: 1; }
.lb-danger-zone {
  border-top: 1px solid var(--color-border, rgba(84,50,22,0.15));
  padding-top: 16px;
  margin-top: 24px;
}
.lb-btn-danger {
  border: 1px solid #c0392b;
  background: #c0392b;
  color: white;
  border-radius: 6px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* ── Terms / Privacy / Marketing overlay modals ─────────────────────────── */
.lb-terms-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(58, 31, 16, 0.5);
  backdrop-filter: blur(6px);
}
.lb-terms-modal.open { display: flex; }
.lb-terms-dialog {
  width: min(560px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--color-cream-50, #fffaf3);
  border: 1px solid var(--color-border, rgba(84,50,22,0.15));
  border-radius: 8px;
  box-shadow: var(--shadow-card, 0 4px 24px rgba(0,0,0,0.12));
  padding: 24px;
}
.lb-terms-dialog h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-brown-800, #3a1f10);
}
.lb-terms-dialog h4 {
  font-size: 14px;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 4px;
  color: var(--color-brown-800, #3a1f10);
}
.lb-terms-dialog p,
.lb-terms-dialog li {
  font-size: 13px;
  color: var(--color-text-sub, #6b5e54);
  line-height: 1.65;
}
.lb-terms-dialog ul {
  padding-left: 18px;
  margin: 4px 0;
}
.lb-terms-close-row { margin-top: 20px; text-align: right; }
