/* Site dialog (site_dialog.js, admin and public pages): our own "are you sure?", question and pick-one boxes, in place of the
   browser's alert / confirm / prompt. Same look as the Redirects delete box. */
.adlg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: adlg-fade 0.15s ease;
}
@keyframes adlg-fade { from { opacity: 0; } }

.adlg {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: calc(100% - 40px);
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    color: #101828;
    animation: adlg-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.adlg--wide { max-width: 520px; }
@keyframes adlg-pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } }

.adlg__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.adlg__icon {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef7e6;
    color: #0c2e16;
}
.adlg__icon svg { width: 20px; height: 20px; }
.adlg--danger .adlg__icon { background: #fef3f2; color: #d92d20; }
.adlg--error .adlg__icon { background: #fef3f2; color: #d92d20; }
.adlg__title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; color: #101828; }
.adlg__msg { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: #475467; white-space: pre-line; }

.adlg__field { margin: 0 0 14px; }
.adlg__label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #344054; }
.adlg__hint { display: block; margin: -2px 0 6px; font-size: 12px; color: #667085; font-weight: 400; }
.adlg__input,
.adlg__select,
.adlg__textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #101828;
    background: #fff;
}
.adlg__textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.adlg__input:focus,
.adlg__select:focus,
.adlg__textarea:focus { outline: none; border-color: #5aa02c; box-shadow: 0 0 0 3px rgba(90, 160, 44, 0.18); }
.adlg__field.is-invalid .adlg__input,
.adlg__field.is-invalid .adlg__select,
.adlg__field.is-invalid .adlg__textarea { border-color: #d92d20; }
.adlg__error { display: none; margin-top: 5px; font-size: 12px; color: #d92d20; }
.adlg__field.is-invalid .adlg__error { display: block; }

/* pick one from a short list (people): a column of choice buttons */
.adlg__choices { display: flex; flex-direction: column; gap: 6px; }
.adlg__choice {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fff;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #101828;
    cursor: pointer;
}
.adlg__choice:hover { background: #f6faf0; }
.adlg__choice[aria-checked="true"] { border-color: #5aa02c; background: #f3f9ec; box-shadow: 0 0 0 1px #5aa02c inset; }
.adlg__choice-dot {
    flex: 0 0 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #c4c9d2;
    box-sizing: border-box;
}
.adlg__choice[aria-checked="true"] .adlg__choice-dot { border: 5px solid #5aa02c; }
.adlg__choice-hint { margin-left: auto; font-size: 12px; color: #667085; }

.adlg__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.adlg__btn {
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #344054;
    min-width: 88px;
}
.adlg__btn:hover { background: #f9fafb; }
.adlg__btn--ok { background: #0c2e16; border-color: #0c2e16; color: #fff; }
.adlg__btn--ok:hover { background: #164a24; }
.adlg--danger .adlg__btn--ok { background: #d92d20; border-color: #d92d20; }
.adlg--danger .adlg__btn--ok:hover { background: #b42318; }
.adlg__btn:focus-visible { outline: 2px solid #5aa02c; outline-offset: 2px; }

/* copy box (recovery codes, links) */
.adlg__copy { display: flex; gap: 8px; }
.adlg__copy .adlg__input,
.adlg__copy .adlg__textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: #f9fafb; }
.adlg__copybtn {
    flex: 0 0 auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #0c2e16;
    border-radius: 8px;
    background: #cfff7f;
    color: #0c2e16;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.adlg__copybtn svg { width: 16px; height: 16px; }
.adlg__copybtn:hover { background: #bdf25c; }
.adlg__copybtn:focus-visible { outline: 2px solid #5aa02c; outline-offset: 2px; }
.adlg__copybtn.is-done { background: #0c2e16; color: #fff; }

/* toasts (SiteDialog.toast): notices that need no answer, top right, 10 s with a close button */
.stoast-stack {
    position: fixed;
    top: 84px; /* below the site and admin headers */
    right: 20px;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 380px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.stoast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 40px 16px 14px;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-left: 4px solid #5aa02c;
    border-radius: 10px;
    box-shadow: 0 12px 24px -6px rgba(16, 24, 40, 0.18), 0 4px 8px -4px rgba(16, 24, 40, 0.08);
    font-family: inherit;
    color: #101828;
    overflow: hidden;
    pointer-events: auto;
    animation: stoast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.stoast.is-leaving { animation: stoast-out 0.22s ease forwards; }
@keyframes stoast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes stoast-out { to { opacity: 0; transform: translateX(24px); } }
.stoast__icon {
    flex: 0 0 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef7e6;
    color: #3f7a1c;
}
.stoast__icon svg { width: 18px; height: 18px; }
.stoast__body { flex: 1; min-width: 0; padding-top: 1px; }
.stoast__title { font-size: 14.5px; font-weight: 700; line-height: 1.3; margin-bottom: 2px; color: #0c2e16; }
.stoast__msg { font-size: 13.5px; line-height: 1.45; color: #475467; white-space: pre-line; overflow-wrap: anywhere; }
.stoast__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #98a2b3;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.stoast__close svg { width: 15px; height: 15px; }
.stoast__close:hover { background: #f2f4f7; color: #344054; }
.stoast__close:focus-visible { outline: 2px solid #5aa02c; outline-offset: 1px; }
.stoast__bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    color: #5aa02c;
    opacity: 0.55;
    transform-origin: left;
    animation-name: stoast-bar;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}
.stoast.is-paused .stoast__bar { animation-play-state: paused; }
@keyframes stoast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.stoast--success { border-left-color: #5aa02c; }
.stoast--info { border-left-color: #2e90fa; }
.stoast--info .stoast__icon { background: #eff8ff; color: #1570ef; }
.stoast--info .stoast__bar { color: #2e90fa; }
.stoast--warning { border-left-color: #f79009; }
.stoast--warning .stoast__icon { background: #fffaeb; color: #dc6803; }
.stoast--warning .stoast__bar { color: #f79009; }
.stoast--error { border-left-color: #d92d20; }
.stoast--error .stoast__icon { background: #fef3f2; color: #d92d20; }
.stoast--error .stoast__bar { color: #d92d20; }

@media (max-width: 600px) {
    .stoast-stack { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; max-width: none; }
    @keyframes stoast-in { from { opacity: 0; transform: translateY(16px); } }
}

@media (prefers-reduced-motion: reduce) {
    .adlg-overlay, .adlg, .stoast, .stoast.is-leaving { animation: none; }
    .stoast__bar { display: none; }
}
