/* ============================================================
   Verification — "Verify any page" badge + verify/unverify modal.
   Scoped to .vbadge* (inline badge) and .verify-* (modal).
   Uses css/style.css design tokens (light + dark) with fallbacks.

   The verified GREEN is defined as module-local custom properties
   (--vgreen / --vgreen-soft) so it reads well in BOTH themes. It flips
   for a forced dark theme (:root[data-theme="dark"]) AND for the system
   preference (@media prefers-color-scheme: dark), while an explicit
   light theme always wins.
   ============================================================ */

.vbadge,
.verify-overlay {
  --vgreen: #2e9d5b;                    /* authoritative green, light theme */
  --vgreen-soft: rgba(46, 160, 90, 0.13);
}

:root[data-theme="dark"] .vbadge,
:root[data-theme="dark"] .verify-overlay {
  --vgreen: #4ec582;                    /* brighter for dark surfaces */
  --vgreen-soft: rgba(78, 197, 130, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vbadge,
  :root:not([data-theme="light"]) .verify-overlay {
    --vgreen: #4ec582;
    --vgreen-soft: rgba(78, 197, 130, 0.16);
  }
}

/* ============================== badge ============================== */
.vbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  line-height: 1;
  font-family: var(--font-display, sans-serif);
  color: var(--vgreen);
  white-space: nowrap;
  user-select: none;
}
.vbadge-ic {
  display: block;
  flex: 0 0 auto;
  color: var(--vgreen); /* seal fill = currentColor; the check is white */
}
.vbadge-label {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--vgreen);
}

/* sizes */
.vbadge-sm {
  gap: 0;
}
.vbadge-sm .vbadge-ic {
  width: 14px;
  height: 14px;
}

/* md + lg render as a soft-green pill */
.vbadge-md,
.vbadge-lg {
  border-radius: 999px;
  background: var(--vgreen-soft);
}
.vbadge-md {
  padding: 2px 8px 2px 6px;
}
.vbadge-md .vbadge-ic {
  width: 15px;
  height: 15px;
}
.vbadge-md .vbadge-label {
  font-size: 13px;
}
.vbadge-lg {
  padding: 3px 11px 3px 8px;
  gap: 5px;
}
.vbadge-lg .vbadge-ic {
  width: 20px;
  height: 20px;
}
.vbadge-lg .vbadge-label {
  font-size: 15px;
}

/* ============================== modal ============================== */
.verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 1210; /* above the search overlay if needed */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  background: rgba(8, 9, 22, 0.5);
  font-family: var(--font, sans-serif);
  animation: verify-fade 0.14s ease;
}

.verify-card {
  width: 440px;
  max-width: 100%;
  background: var(--bg-modal, #fff);
  color: var(--text, #1f2335);
  border: 1px solid var(--border, #e7e8f1);
  border-radius: var(--radius-pane, 14px);
  box-shadow: var(--shadow-pane, 0 10px 40px rgba(8, 9, 22, 0.35));
  overflow: hidden;
  animation: verify-pop 0.16s cubic-bezier(0.2, 0.85, 0.3, 1);
}

/* ---- head ---- */
.verify-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 14px 14px 20px;
}
.verify-headicon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--vgreen); /* seal fill */
}
.verify-seal {
  display: block;
}
.verify-headtext {
  flex: 1 1 auto;
  min-width: 0;
}
.verify-title {
  font-family: var(--font-display, sans-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.25;
  color: var(--text, #1f2335);
}
.verify-subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-light, #676d89);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.verify-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-ctl, 8px);
  font-size: 13px;
  color: var(--text-light, #676d89);
  transition: background 0.12s, color 0.12s;
}
.verify-close:hover {
  background: var(--bg-hover, rgba(35, 39, 74, 0.055));
  color: var(--text, #1f2335);
}

/* ---- body ---- */
.verify-body {
  padding: 0 20px 4px;
}
.verify-copy {
  margin-bottom: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-light, #676d89);
}

/* already-verified info block */
.verify-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-ctl, 8px);
  background: var(--vgreen-soft);
}
.verify-info-who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display, sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--vgreen);
}
.verify-info-ic {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--vgreen);
}
.verify-info-seal {
  display: block;
}
.verify-info-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text, #1f2335);
  white-space: pre-wrap;
  word-break: break-word;
}

/* read-only "can't verify" message */
.verify-muted {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-ctl, 8px);
  background: var(--bg-callout, #f1f2f9);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-faint, #989db6);
}

/* optional note textarea (matches app inputs) */
.verify-note {
  display: block;
  width: 100%;
  min-height: 76px;
  margin-bottom: 14px;
  padding: 9px 11px;
  resize: vertical;
  font-family: var(--font, sans-serif);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text, #1f2335);
  background: var(--bg-input, #fff);
  border: 1px solid var(--border, #e7e8f1);
  border-radius: var(--radius-ctl, 8px);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.verify-note::placeholder {
  color: var(--text-placeholder, rgba(31, 35, 53, 0.34));
}
.verify-note:focus {
  border-color: var(--accent, #5b5bd6);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.16);
}

/* subtle "verifying as workspace admin" note */
.verify-adminnote {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-light, #676d89);
}
.verify-adminnote-ic {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--accent-soft, #8f8ff3);
}

/* ---- actions ---- */
.verify-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 20px 20px;
}
.verify-btn {
  font-family: var(--font, sans-serif);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-ctl, 8px);
  border: 1px solid var(--border-strong, #d0d2e2);
  background: transparent;
  color: var(--text, #1f2335);
  transition: background 0.12s, border-color 0.12s, filter 0.12s, opacity 0.12s;
}
.verify-btn:hover {
  background: var(--bg-hover, rgba(35, 39, 74, 0.055));
}
.verify-btn-primary {
  border-color: transparent;
  background: var(--accent, #5b5bd6);
  color: #fff;
}
.verify-btn-primary:hover {
  background: var(--accent-hover, #4a4ac8);
}
.verify-btn-danger {
  border-color: transparent;
  background: var(--danger, #e5534b);
  color: #fff;
}
.verify-btn-danger:hover {
  filter: brightness(0.94);
}
.verify-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---- animation (guarded) ---- */
@keyframes verify-fade {
  from {
    opacity: 0;
  }
}
@keyframes verify-pop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}
@media (prefers-reduced-motion: reduce) {
  .verify-overlay,
  .verify-card {
    animation: none;
  }
}

/* ---- small screens ---- */
@media (max-width: 480px) {
  .verify-overlay {
    padding: 8vh 14px 14px;
  }
  .verify-card {
    width: 100%;
  }
}

/* ===== app-level placement of the verified badge (added by integration) ===== */
#verified-row { margin: 6px 0 2px; }
#verified-row.hidden { display: none; }
.page-verified-badge { display: inline-flex; }
.page-verified-badge:hover { filter: brightness(1.03); }
.lib-verified { vertical-align: middle; margin-left: 2px; }
.lib-p-title .vbadge-sm { transform: translateY(-1px); }
