/* LBC Certificates — verification popup shell + [certificate_search_popup] button.
   Everything is prefixed (lbc-) and scoped; the form and results inside reuse public.css (.lbc-app). */

html.lbc-popup-lock { overflow: hidden; }

/* ---- the button rendered by [certificate_search_popup] */
a.lbc-csp-button,
a.lbc-csp-button:visited {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .6em 1.4em; border-radius: 6px; border: 0;
  background: var(--lbc-brand, #14284B); color: #fff !important; text-decoration: none !important;
  font-weight: 700; font-size: 1rem; line-height: 1.2; letter-spacing: normal; text-transform: none;
  box-shadow: inset 0 -3px 0 var(--lbc-accent, #B08D45); cursor: pointer;
}
a.lbc-csp-button:hover { filter: brightness(1.12); }
a.lbc-csp-button:focus-visible { outline: 3px solid var(--lbc-accent, #B08D45); outline-offset: 2px; }

/* ---- modal */
dialog.lbc-popup {
  --lbc-brand: #14284B; --lbc-accent: #B08D45;
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px)); max-width: 560px;
  max-height: min(88vh, 860px); max-height: min(88dvh, 860px);
  margin: auto; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
  color: #17223B; background: #fff; box-shadow: 0 28px 70px rgba(8, 16, 34, .38);
  font-size: 16px; line-height: 1.6; text-align: start;
}
dialog.lbc-popup[open] { display: flex; flex-direction: column; animation: lbc-pop .18s ease-out; }
dialog.lbc-popup::backdrop { background: rgba(8, 15, 30, .64); backdrop-filter: blur(2px); }
@keyframes lbc-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { dialog.lbc-popup[open] { animation: none; } }
dialog.lbc-popup *, dialog.lbc-popup *::before, dialog.lbc-popup *::after { box-sizing: border-box; }

.lbc-popup .lbc-popup-head {
  flex: none; position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 58px; padding: 12px 56px; background: var(--lbc-brand); border-bottom: 3px solid var(--lbc-accent);
}
.lbc-popup .lbc-popup-head h2 {
  margin: 0; padding: 0; color: #fff; text-align: center; text-transform: none; letter-spacing: normal;
  font: 700 1.15rem/1.3 Georgia, "Noto Naskh Arabic", "Amiri", serif;
}
.lbc-popup .lbc-popup-close {
  position: absolute; inset-inline-end: 9px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 42px; height: 42px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: #fff; box-shadow: none;
  font: 400 30px/1 Arial, sans-serif; text-transform: none; cursor: pointer;
}
.lbc-popup .lbc-popup-close:hover { background: rgba(255, 255, 255, .14); }
.lbc-popup .lbc-popup-close:focus-visible { outline: 3px solid var(--lbc-accent); outline-offset: 0; }

.lbc-popup .lbc-popup-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* The plugin's own form/result styles, adapted to the modal. */
.lbc-popup .lbc-app.lbc-app-popup { max-width: none; margin: 0; padding: 22px 24px 6px; position: relative; }
.lbc-popup .lbc-app-popup > * { position: relative; }
.lbc-popup .lbc-app-popup .lbc-form { gap: .9rem; }
.lbc-popup .lbc-app-popup .lbc-seg { width: 100%; }
.lbc-popup .lbc-app-popup .lbc-seg label { flex: 1; text-align: center; }
.lbc-popup .lbc-app-popup .lbc-form .lbc-btn-primary { justify-self: stretch; width: 100%; box-shadow: inset 0 -3px 0 var(--lbc-accent); }
.lbc-popup .lbc-app-popup .lbc-form[aria-busy="true"] .lbc-btn-primary { opacity: .75; cursor: progress; }
.lbc-popup .lbc-popup-results:empty { display: none; }
.lbc-popup .lbc-popup-results .lbc-outcome { margin-top: 1.1rem; }
.lbc-popup .lbc-popup-results .lbc-outcome:focus { outline: none; }
.lbc-popup .lbc-app-popup .lbc-extract { padding: 1.3rem 1.3rem 1rem; }
.lbc-popup .lbc-app-popup .lbc-statement { font-size: 1.15rem; }
.lbc-popup .lbc-popup-portal { margin: 1rem 0 1.1rem; text-align: center; font-size: .93rem; }

/* tablet / phone */
@media (max-width: 600px) {
  dialog.lbc-popup { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 8px; }
  .lbc-popup .lbc-app.lbc-app-popup { padding: 18px 16px 4px; }
  .lbc-popup .lbc-popup-head { padding: 10px 52px; min-height: 54px; }
  .lbc-popup .lbc-popup-head h2 { font-size: 1.05rem; }
}
