/* Shared modal geometry. Content is paged, never cropped to conceal overflow. */
:root { --popup-height: calc(100dvh - 32px); }
body.popup-open { overflow: hidden; }
html.midtrans-checkout-open, html.midtrans-checkout-open body { overflow: hidden !important; overscroll-behavior: none; }
body .participant-auth-overlay, body .confirm-dialog, body .visitor-promo {
  padding: 16px; overflow: auto; overscroll-behavior: contain;
  background: rgb(17 24 39 / 58%); backdrop-filter: blur(3px);
}
body .participant-auth-card, body .visitor-promo-card, body .confirm-card,
body .detail-dialog {
  box-sizing: border-box; max-height: var(--popup-height); margin-block: auto;
  border-radius: 8px; box-shadow: 0 20px 64px rgb(16 24 40 / 22%);
  overflow: auto; overflow-wrap: anywhere;
}
body .participant-auth-card, body .confirm-card { padding: 22px; width: min(480px, 100%); }
body .participant-auth-brand img { width: 44px; height: 44px; }
body .participant-auth-brand h2, body .confirm-card h2 { font-size: 21px; line-height: 1.25; margin-block: 3px 8px; }
body .participant-auth-copy { margin: 10px 0 16px; font-size: 14px; line-height: 1.45; }
body .participant-auth-card form { gap: 10px; }
body .participant-auth-card input:not([type=checkbox]) { font-size: 16px; min-height: 44px; }
body .participant-auth-status:empty { display: none; }
body .participant-auth-close, body .visitor-promo-close, body .dialog-heading button {
  width: 40px; height: 40px; min-width: 40px; border-radius: 6px;
}
body .visitor-promo-card { width: min(480px, 100%); padding: 22px; border: 1px solid #d7e0e8; border-top: 4px solid #0863ac; }
body .visitor-promo-brand { flex-direction: row; gap: 12px; padding-right: 38px; text-align: left; }
body .visitor-promo-brand img { width: 48px; height: 48px; }
body .visitor-promo-brand span { font-size: 11px; }
body .visitor-promo-copy { margin-top: 18px; text-align: left; }
body .visitor-promo-copy h2 { font-size: 24px; line-height: 1.2; letter-spacing: 0; }
body .visitor-promo-free { font-size: inherit; }
body .visitor-promo-copy > p:last-child { margin-top: 10px; font-size: 14px; line-height: 1.45; }
body .visitor-promo-tests { margin: 16px 0; gap: 8px; }
body .visitor-promo-test { min-height: 44px; font-size: 13px; padding: 8px; }
body .visitor-promo-action { min-height: 44px; font-size: 15px; padding: 11px 16px; }
body .visitor-promo-card > small { margin-top: 8px; }
body .dialog-heading { padding: 14px 18px; gap: 12px; }
body .dialog-heading h2 { font-size: 20px; }
body .detail-dialog { width: min(700px, calc(100% - 32px)); }
body #detail-content { padding: 6px 18px; }
body .detail-field { padding: 10px 0; }
body .dialog-actions { padding: 10px 18px; flex-wrap: wrap; }
body .dialog-actions:empty { display: none; }
body .payment-review-actions { grid-template-columns: 1fr 1fr; }
body .payment-review-actions input { grid-column: 1 / -1; }
body .payment-proof-panel { padding: 8px; margin: 8px 0; }
body .payment-proof-panel img { max-height: min(35dvh, 300px); }
body .certificate-modal { width: min(1000px, 100%, calc((100dvh - 136px) * 1.414)); }
body .certificate-modal-actions { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
body .certificate-preview-note { flex: 1 1 220px; font-size: 12px; }
body .certificate-modal-actions > button { width: auto; min-height: 44px; }
body .gallery-lightbox { max-height: var(--popup-height); padding: 12px; }
body .gallery-lightbox img { max-height: calc(100dvh - 140px); object-fit: contain; }
body .popup-page-hidden { display: none !important; }
body .popup-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0 0; margin-top: 10px; border-top: 1px solid #e4e9ef;
  color: #475467; font: 500 12px/1.3 Inter, system-ui, sans-serif;
}
body dialog > .popup-pagination { margin: 0 18px 14px; }
body .popup-pagination[hidden] { display: none; }
body .popup-pagination button {
  width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  background: #f1f6fa; color: #075baa; border: 1px solid #cbd8e4;
  border-radius: 6px; font: 600 22px/1 system-ui; cursor: pointer;
}
body .popup-pagination button:disabled { opacity: .4; cursor: default; }
body .popup-pagination button:focus-visible { outline: 2px solid #075baa; outline-offset: 2px; }
@media(max-width: 540px) {
  body .participant-auth-card, body .confirm-card, body .visitor-promo-card { padding: 18px; }
  body .detail-grid { grid-template-columns: 1fr; }
}
@media(max-height: 500px) {
  :root { --popup-height: calc(100dvh - 16px); }
  body .participant-auth-overlay, body .confirm-dialog, body .visitor-promo { padding: 8px; }
  body .participant-auth-card, body .confirm-card, body .visitor-promo-card { padding: 12px 18px; }
  body .participant-auth-copy { margin: 4px 0 8px; }
  body .popup-pagination { margin-top: 6px; padding-top: 6px; }
}
@media(prefers-reduced-motion: reduce) {
  body .visitor-promo-card { animation: none; }
}
