/* ==========================================================================
   Account popups — chrome and content for the language picker and the
   delete-account flow, per the Reply Timing handoff.
   --------------------------------------------------------------------------
   Loaded globally (not via .razor.css) because DxPopup teleports its body
   DOM outside the component's scope, so scoped CSS with ::deep never reaches
   it. Both popups extend the shared `icu-popup icu-popup--flush` chrome and
   then layer their own modifier classes on top:

     - `.lang-popup-modal`     — Change interface language picker
     - `.delete-account-popup` — Delete my account (3-step flow)

   Colors and radii all come from --icu-* design tokens so light/dark themes
   stay consistent.
   ========================================================================== */


/* =====================================================
   LANGUAGE PICKER — 480px, list of locales with search.
   ===================================================== */
.lang-popup-modal .dxbl-popup-window {
    max-width: 480px !important;
    border-radius: var(--icu-radius-lg) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
}

.lang-popup-modal .dxbl-popup-header {
    padding: 16px 20px 14px !important;
    background: var(--icu-surface) !important;
    border-bottom: 0 !important;
    align-items: flex-start !important;
}

.lang-popup-modal .dxbl-popup-header .dxbl-popup-header-text {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--icu-ink) !important;
    letter-spacing: -0.005em;
}

.lang-popup-modal .dxbl-popup-body,
.lang-popup-modal .dxbl-popup-content {
    padding: 0 !important;
    background: var(--icu-surface) !important;
}

.lang-popup-modal .dxbl-popup-footer {
    padding: 12px 18px !important;
    background: #FAFAFA !important;
    border-top: 1px solid var(--icu-line) !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
}

.lang-popup-modal .lang-popup-sub {
    padding: 0 20px 14px;
    font-size: 12px;
    color: var(--icu-ink-3);
    line-height: 1.5;
    margin: 0;
}

/* Search box */
.lang-popup-modal .lang-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px 12px;
    padding: 8px 11px;
    border: 1px solid var(--icu-line);
    border-radius: 8px;
    background: #fff;
    color: var(--icu-ink-3);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.lang-popup-modal .lang-search:focus-within {
    border-color: var(--icu-brand);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.12);
}

.lang-popup-modal .lang-search svg {
    flex-shrink: 0;
    color: var(--icu-ink-4);
    width: 14px;
    height: 14px;
}

.lang-popup-modal .lang-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--icu-ink);
}

.lang-popup-modal .lang-search input::placeholder {
    color: var(--icu-ink-4);
}

/* Language list */
.lang-popup-modal .lang-list {
    list-style: none;
    margin: 0;
    padding: 4px 12px 8px;
    max-height: 340px;
    overflow-y: auto;
    border-top: 1px solid var(--icu-line);
}

.lang-popup-modal .lang-list li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--icu-ink);
    position: relative;
}

.lang-popup-modal .lang-list li:hover {
    background: var(--icu-purple-25);
}

.lang-popup-modal .lang-list li.selected {
    background: var(--icu-purple-50);
}

.lang-popup-modal .lang-list li.selected .lang-name {
    color: var(--icu-brand-ink);
    font-weight: 600;
}

.lang-popup-modal .lang-list .lang-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #F2EEF8;
    box-shadow: 0 0 0 1px rgba(22, 20, 28, 0.04);
}

.lang-popup-modal .lang-list .lang-name {
    flex: 1;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-popup-modal .lang-list .lang-region {
    font-size: 11.5px;
    color: var(--icu-ink-3);
    font-family: var(--icu-font-mono);
    letter-spacing: 0.02em;
}

.lang-popup-modal .lang-list li.selected .lang-region {
    color: var(--icu-brand);
}

.lang-popup-modal .lang-list .lang-check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--icu-brand);
    opacity: 0;
}

.lang-popup-modal .lang-list li.selected .lang-check {
    opacity: 1;
}

/* Empty state when the search filter has zero matches */
.lang-popup-modal .lang-empty {
    padding: 28px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--icu-ink-3);
}

.lang-popup-modal .lang-empty b {
    color: var(--icu-ink-2);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

/* Bottom-of-modal info card — surfaces the "request a language" CTA */
.lang-popup-modal .lang-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 20px 16px;
    padding: 11px 12px;
    background: var(--icu-purple-25);
    border: 1px solid var(--icu-purple-50);
    border-radius: 8px;
    font-size: 12px;
    color: var(--icu-ink-2);
    line-height: 1.5;
}

.lang-popup-modal .lang-note svg {
    flex-shrink: 0;
    color: var(--icu-brand);
    margin-top: 1px;
    width: 14px;
    height: 14px;
}

.lang-popup-modal .lang-note a {
    color: var(--icu-brand);
    font-weight: 600;
    text-decoration: none;
}

.lang-popup-modal .lang-note a:hover {
    text-decoration: underline;
}


/* =====================================================
   DELETE ACCOUNT — 520px, 3-step warn → confirm → done.
   ===================================================== */
.delete-account-popup .dxbl-popup-window {
    max-width: 520px !important;
    border-radius: var(--icu-radius-lg) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
}

/* Header uses the cool-grey treatment from the design to signal a
   destructive context without being alarming. */
.delete-account-popup .dxbl-popup-header {
    padding: 14px 18px !important;
    background: #F5F5F7 !important;
    border-bottom: 1px solid var(--icu-line) !important;
}

.delete-account-popup .dxbl-popup-header .dxbl-popup-header-text {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--icu-ink) !important;
    letter-spacing: -0.005em;
}

.delete-account-popup .dxbl-popup-body,
.delete-account-popup .dxbl-popup-content {
    padding: 18px !important;
    background: var(--icu-surface) !important;
}

/* Reversed flex order puts the destructive button on the far right with
   Cancel to its left — matches the Reply Timing handoff. */
.delete-account-popup .dxbl-popup-footer {
    padding: 12px 18px !important;
    background: #FAFAFA !important;
    border-top: 1px solid var(--icu-line) !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: flex-start !important;
    gap: 8px !important;
}

.delete-account-popup .dxbl-popup-footer .dxbl-btn {
    min-width: 0;
}

/* Step 1 lede paragraph */
.delete-account-popup .del-lede {
    font-size: 13.5px;
    color: var(--icu-ink-2);
    line-height: 1.55;
    margin: 0 0 14px;
}

/* Yellow caution box (step 1) */
.delete-account-popup .del-warn {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    background: #FDF6DF;
    border: 1px solid #F0D98B;
    border-radius: 6px;
    font-size: 13px;
    color: #6A4B00;
    line-height: 1.5;
    margin: 0;
}

.delete-account-popup .del-warn svg {
    flex-shrink: 0;
    color: #B07B1D;
    margin-top: 1px;
    width: 16px;
    height: 16px;
}

/* Step 2: section blocks */
.delete-account-popup .del-section + .del-section {
    margin-top: 16px;
}

.delete-account-popup .del-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--icu-ink);
    margin: 0 0 8px;
    letter-spacing: -0.005em;
}

/* Red "final confirmation" warning */
.delete-account-popup .del-warn-red {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    background: #E5635A;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.delete-account-popup .del-warn-red svg {
    flex-shrink: 0;
    color: #fff;
    margin-top: 1px;
    width: 16px;
    height: 16px;
}

.delete-account-popup .del-sub-body {
    font-size: 13px;
    color: var(--icu-ink-2);
    line-height: 1.55;
    margin: 0;
}

.delete-account-popup .del-field-label {
    display: block;
    font-size: 13px;
    color: var(--icu-ink-2);
    margin: 0 0 6px;
}

.delete-account-popup .del-input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--icu-line);
    border-radius: 5px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    color: var(--icu-ink);
    outline: none;
    font-family: var(--icu-font-mono);
}

.delete-account-popup .del-input:focus {
    border-color: var(--icu-brand);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.10);
}

.delete-account-popup .del-input.error {
    border-color: var(--icu-bad);
    box-shadow: 0 0 0 3px rgba(200, 74, 59, 0.10);
}

.delete-account-popup .del-input-hint {
    font-size: 11.5px;
    color: var(--icu-ink-3);
    margin: 5px 0 0;
    font-family: var(--icu-font-mono);
}

.delete-account-popup .del-input-hint.error {
    color: var(--icu-bad);
}

/* Custom checkbox — red fill when checked to underscore the destructive
   nature of the acknowledgement. */
.delete-account-popup .del-confirm {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--icu-ink-2);
    cursor: pointer;
    user-select: none;
}

.delete-account-popup .del-confirm input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.delete-account-popup .del-confirm .box {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--icu-line-strong);
    border-radius: 3px;
    background: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
}

.delete-account-popup .del-confirm .box svg {
    width: 11px;
    height: 11px;
    color: #fff;
    opacity: 0;
}

.delete-account-popup .del-confirm input:checked + .box {
    background: var(--icu-bad);
    border-color: var(--icu-bad);
}

.delete-account-popup .del-confirm input:checked + .box svg {
    opacity: 1;
}

/* Step 3 done state */
.delete-account-popup .del-done {
    text-align: center;
    padding: 22px 18px 14px;
}

.delete-account-popup .del-done .ic {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--icu-ok-bg);
    color: var(--icu-ok);
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
}

.delete-account-popup .del-done h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -0.005em;
}

.delete-account-popup .del-done p {
    font-size: 13px;
    color: var(--icu-ink-3);
    margin: 0;
    line-height: 1.55;
}

/* Spinner used during the actual delete network call. Replaces the
   in-flight body so the user can't double-submit. */
.delete-account-popup .del-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 26px 0;
    color: var(--icu-bad);
    font-size: 13px;
}

.delete-account-popup .del-spinner .ring {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(200, 74, 59, 0.18);
    border-top-color: var(--icu-bad);
    animation: delSpin 0.9s linear infinite;
}

@keyframes delSpin {
    to { transform: rotate(360deg); }
}

/* Danger DxButton — overrides DevExpress's default red so we land on the
   token-driven --icu-bad value used elsewhere. */
.delete-account-popup .dxbl-popup-footer .dxbl-btn-danger {
    background: var(--icu-bad);
    border-color: var(--icu-bad);
    color: #fff;
}

.delete-account-popup .dxbl-popup-footer .dxbl-btn-danger:hover:not(:disabled) {
    background: #A93B2E;
    border-color: #A93B2E;
}

.delete-account-popup .dxbl-popup-footer .dxbl-btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* =====================================================
   DOWNLOAD INFORMATION — built on the shared `.abl-modal-*` chrome in
   site.css. The chrome already handles the dark blurred scrim, the
   max-height: 85vh flex column, the scrollable body (with the WebKit
   `min-height: 0` trick) and the pinned header / footer — we only add a
   width modifier here.

   We restate the layout rules (display: flex column, max-height: 85vh,
   overflow: hidden) with !important because some pages in the app load
   stylesheets that override .abl-modal's geometry and break the scroll
   chain. The defensive restatement keeps the body scrolling and the
   footer pinned regardless. */
.abl-modal.download-info-popup {
    max-width: 520px !important;
    max-height: 85vh !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.abl-modal.download-info-popup .abl-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

.abl-modal.download-info-popup .abl-modal-head,
.abl-modal.download-info-popup .abl-modal-foot {
    flex-shrink: 0 !important;
}

/* Subtitle sits inside .abl-modal-body and scrolls with the rest of
   the content — short copy, low cost, and saves a layer of flex wrapping. */
.abl-modal.download-info-popup .di-sub {
    font-size: 12px;
    color: var(--icu-ink-3);
    line-height: 1.5;
    margin: 0 0 14px;
}

/* Category list — sits directly inside .abl-modal-body so it inherits
   the chrome's 18px padding and the scrollable region. */
.download-info-popup .di-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Each row is a labelled clickable card — the entire surface toggles
   the underlying checkbox via the `.di-item` label-for. */
.download-info-popup .di-item {
    display: grid;
    grid-template-columns: 18px 36px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--icu-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}

.download-info-popup .di-item:hover {
    border-color: var(--icu-purple-200);
}

.download-info-popup .di-item.checked {
    border-color: var(--icu-purple-300);
    background: var(--icu-purple-25);
}

.download-info-popup .di-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.download-info-popup .di-check {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--icu-line-strong);
    background: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    transition: background 0.12s, border-color 0.12s;
}

.download-info-popup .di-check svg {
    opacity: 0;
    width: 12px;
    height: 12px;
}

.download-info-popup .di-item.checked .di-check {
    background: var(--icu-brand);
    border-color: var(--icu-brand);
}

.download-info-popup .di-item.checked .di-check svg {
    opacity: 1;
}

.download-info-popup .di-ic {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--icu-purple-25);
    color: var(--icu-brand);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.download-info-popup .di-ic svg {
    width: 18px;
    height: 18px;
}

.download-info-popup .di-it-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.download-info-popup .di-it-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--icu-ink);
}

.download-info-popup .di-it-desc {
    font-size: 11.5px;
    color: var(--icu-ink-3);
    margin-top: 2px;
    line-height: 1.4;
}

/* Summary row + "Select all" toggle. */
.download-info-popup .di-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--icu-bg);
    border-radius: 8px;
    font-size: 12px;
    color: var(--icu-ink-3);
}

.download-info-popup .di-summary b {
    color: var(--icu-ink);
    font-weight: 600;
}

.download-info-popup .di-toggle-all {
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--icu-brand);
    cursor: pointer;
    padding: 0;
}

.download-info-popup .di-toggle-all:hover {
    text-decoration: underline;
}
