/* ==========================================================================
   Deduction site chrome (header / main navigation) — loaded ONLY by _LayoutDeduction.
   Every rule is scoped to body.ded-site-body, so no other Store page, the association website or
   the dashboard can be affected. Colors come from the per-tenant tokens emitted by DeductionBrandVC
   (--ded-primary / --ded-secondary ...); the literals after each var() are fallbacks only.
   Markup, links, scripts and auth behavior are untouched: this file only restyles existing elements.
   ========================================================================== */

body.ded-site-body {
    --ded-header-h: 76px;
    --ded-ink: #1f2937;
    --ded-line: #e5e7eb;
}

/* ---------- Header shell ---------- */
body.ded-site-body #navbar_top2 .navbar {
    min-height: var(--ded-header-h);
    padding-block: 0;
    padding-inline: clamp(1rem, 3vw, 2.5rem);
    background: #fff;
    border-top: 0;
    border-bottom: 1px solid var(--ded-line);
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.06);
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- Logo + QR ---------- */
body.ded-site-body #navbar_top2 .store-images-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: auto;
    margin: 0;
    margin-inline-end: clamp(1rem, 2.5vw, 2rem);
    padding-block: 8px;
}

body.ded-site-body #navbar_top2 .store-images-container .navbar-brand {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

body.ded-site-body #navbar_top2 .store-logo {
    max-height: 56px;
    max-width: 150px;
    width: auto;
    height: auto;
}

body.ded-site-body #navbar_top2 .store-qrcode {
    max-height: 52px;
    max-width: 52px;
    width: auto;
    height: auto;
}

/* thin divider between logo and QR (only when a QR link exists) */
body.ded-site-body #navbar_top2 .store-images-container .navbar-brand + .navbar-brand {
    padding-inline-start: 14px;
    border-inline-start: 1px solid var(--ded-line);
}

/* ---------- Main navigation (desktop) ---------- */
body.ded-site-body #navbar_top2 .navbar-collapse > .navbar-nav {
    flex: 1 1 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    overflow: visible; /* styleall clips with overflow-x:auto, which would cut the account dropdown */
    padding: 0;
    border: 0;
}

body.ded-site-body #navbar_top2 .navbar-nav > .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: var(--ded-header-h);
    margin: 0;
    padding: 0 0.9rem;
    color: var(--ded-ink);
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
    transition: color 0.2s ease;
}

body.ded-site-body #navbar_top2 .navbar-nav > .nav-link i {
    margin: 0 !important;
    color: var(--ded-primary-strong, #135898);
}

body.ded-site-body #navbar_top2 .navbar-nav > .nav-link::after {
    content: "";
    position: absolute;
    inset-inline: 0.9rem;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--ded-secondary, #c1b866);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

body.ded-site-body #navbar_top2 .navbar-nav > .nav-link:hover,
body.ded-site-body #navbar_top2 .navbar-nav > .nav-link:focus-visible,
body.ded-site-body #navbar_top2 .navbar-nav > .nav-link.active {
    color: var(--ded-primary-strong, #135898);
}

body.ded-site-body #navbar_top2 .navbar-nav > .nav-link:hover::after,
body.ded-site-body #navbar_top2 .navbar-nav > .nav-link:focus-visible::after,
body.ded-site-body #navbar_top2 .navbar-nav > .nav-link.active::after {
    transform: scaleX(1);
}

body.ded-site-body #navbar_top2 .navbar-nav > .nav-link:focus-visible {
    outline: 2px solid var(--ded-primary-strong, #135898);
    outline-offset: -4px;
    border-radius: 6px;
}

/* ---------- Account actions (anonymous: login / register, signed-in: user dropdown) ---------- */
body.ded-site-body #navbar_top2 #loginStoreContainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
    flex: 0 0 auto;
}

body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link {
    height: 42px;
    margin: 0;
    padding: 0 1.1rem;
    border-radius: 999px;
    border: 2px solid var(--ded-primary-strong, #135898);
    color: var(--ded-primary-strong, #135898);
    background: transparent;
    gap: 0.45rem;
    justify-content: center;
}

body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link i {
    color: inherit;
}

body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link::after {
    display: none;
}

body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link:hover,
body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link:focus-visible {
    background: var(--ded-primary, #135898);
    border-color: var(--ded-primary, #135898);
    color: var(--ded-on-primary, #fff);
}

/* register = primary action (filled) */
body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link[href*="tapId=2"] {
    background: var(--ded-primary, #135898);
    border-color: var(--ded-primary, #135898);
    color: var(--ded-on-primary, #fff);
}

body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link[href*="tapId=2"]:hover,
body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link[href*="tapId=2"]:focus-visible {
    background: var(--ded-primary-hover, #0f4a80);
    border-color: var(--ded-primary-hover, #0f4a80);
}

/* signed-in dropdown */
body.ded-site-body #navbar_top2 .logoutdiv > .nav-link {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 1rem;
    border-radius: 999px;
    border: 2px solid var(--ded-primary-strong, #135898);
    color: var(--ded-primary-strong, #135898);
    font-weight: 600;
    text-transform: none;
}

body.ded-site-body #navbar_top2 .logoutdiv > .nav-link i {
    font-size: 18px !important;
    font-style: normal;
}

body.ded-site-body #navbar_top2 .logoutdiv > .nav-link:hover {
    background: var(--ded-primary, #135898);
    color: var(--ded-on-primary, #fff);
}

body.ded-site-body #navbar_top2 .logoutdiv .dropdown-menu {
    background: #fff;
    border: 1px solid var(--ded-line);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.12);
    padding: 0.4rem;
    min-width: 11rem;
}

body.ded-site-body #navbar_top2 .logoutdiv .dropdown-menu .dropdown-item {
    color: var(--ded-ink);
    border-radius: 8px;
    font-weight: 600;
}

body.ded-site-body #navbar_top2 .logoutdiv .dropdown-menu .dropdown-item:hover,
body.ded-site-body #navbar_top2 .logoutdiv .dropdown-menu .dropdown-item:focus {
    background: var(--ded-primary-soft, rgba(19, 88, 152, 0.1));
    color: var(--ded-primary-strong, #135898);
}

/* ---------- Mobile / tablet toggler ---------- */
body.ded-site-body #navbar_top2 .navbar-toggler {
    margin-inline-start: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--ded-primary-strong, #135898);
    border-radius: 10px;
}

body.ded-site-body #navbar_top2 .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem var(--ded-primary-ring, rgba(19, 88, 152, 0.35));
}

/* ---------- Below the lg breakpoint: compact bar + stacked menu ---------- */
@media (max-width: 991.98px) {
    body.ded-site-body {
        --ded-header-h: 64px;
    }

    body.ded-site-body #navbar_top2 .navbar {
        min-height: var(--ded-header-h);
        padding-inline: 1rem !important; /* beats the px-4 utility */
    }

    body.ded-site-body #navbar_top2 .store-images-container {
        margin-inline-end: 0.75rem;
        padding-block: 6px;
        gap: 10px;
    }

    body.ded-site-body #navbar_top2 .store-logo {
        max-height: 46px;
        max-width: 120px;
    }

    body.ded-site-body #navbar_top2 .store-qrcode {
        max-height: 44px;
        max-width: 44px;
    }

    body.ded-site-body #navbar_top2 .store-images-container .navbar-brand + .navbar-brand {
        padding-inline-start: 10px;
    }

    body.ded-site-body #navbar_top2 .navbar-collapse {
        flex-basis: 100%;
        border-top: 1px solid var(--ded-line);
        margin-inline: 0;
        padding: 0.5rem 0 1rem;
        background: #fff;
    }

    body.ded-site-body #navbar_top2 .navbar-collapse > .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 !important;
    }

    body.ded-site-body #navbar_top2 .navbar-nav > .nav-link {
        height: auto;
        min-height: 48px;
        padding: 0.7rem 0.5rem;
        border-bottom: 1px solid var(--ded-line);
        font-size: 16px;
    }

    body.ded-site-body #navbar_top2 .navbar-nav > .nav-link::after {
        inset-inline: 0;
        height: 2px;
        border-radius: 0;
    }

    body.ded-site-body #navbar_top2 #loginStoreContainer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        margin: 0.9rem 0 0;
        padding: 0 !important;
    }

    body.ded-site-body #navbar_top2 #loginStoreContainer > .nav-link {
        height: 48px;
        border-bottom-width: 2px;
        font-size: 16px;
    }

    body.ded-site-body #navbar_top2 .logoutdiv {
        width: 100%;
    }

    body.ded-site-body #navbar_top2 .logoutdiv > .nav-link {
        width: 100%;
        height: 48px;
        justify-content: center;
    }

    body.ded-site-body #navbar_top2 .logoutdiv .dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 0.4rem !important;
        box-shadow: none;
    }
}

@media (max-width: 400px) {
    body.ded-site-body #navbar_top2 .store-logo {
        max-width: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ded-site-body #navbar_top2 .navbar-nav > .nav-link,
    body.ded-site-body #navbar_top2 .navbar-nav > .nav-link::after {
        transition: none;
    }
}

/* ---------- Footer colors only (structure untouched): follow the tenant primary with readable text ---------- */
body.ded-site-body footer .footer.bgc-primary {
    background-color: var(--ded-primary, #135898);
}

body.ded-site-body footer .footer.bgc-primary .text-white,
body.ded-site-body footer .footer.bgc-primary address,
body.ded-site-body footer .footer.bgc-primary p {
    color: var(--ded-on-primary, #fff) !important;
}

body.ded-site-body footer .footer.bgc-primary .alink-color {
    color: var(--ded-on-primary, #fff);
}

/* toggler is only shown below lg by Bootstrap; center its icon when it is */
@media (max-width: 991.98px) {
    body.ded-site-body #navbar_top2 .navbar-toggler {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ---------- Full-bleed header: no outer gutters; inner content aligns with the page container ---------- */
body.ded-site-body #navDiv {
    margin: 0;
    padding: 0;
    --bs-gutter-x: 0;
}

body.ded-site-body #navDiv > [class*="col-"] {
    padding-inline: 0;
}

body.ded-site-body #navbar_top2 {
    width: 100%;
    margin: 0;
    padding: 0;
}

body.ded-site-body #navbar_top2 .navbar {
    width: 100%;
    margin: 0;
    border-radius: 0;
    /* inner content lines up with the page container below; tighter breakpoints keep a simple gutter so the row never squeezes */
    padding-inline: 1.25rem !important;
}

@media (max-width: 991.98px) {
    body.ded-site-body #navbar_top2 .navbar {
        padding-inline: 1rem !important;
    }
}

@media (min-width: 1200px) {
    body.ded-site-body #navbar_top2 .navbar {
        padding-inline: calc((100% - 1140px) / 2 + 0.75rem) !important;
    }
}

@media (min-width: 1400px) {
    body.ded-site-body #navbar_top2 .navbar {
        padding-inline: calc((100% - 1320px) / 2 + 0.75rem) !important;
    }
}

/* ==========================================================================
   Hero / slider (shared HeaderCarousel markup, restyled here only)
   Banners keep their natural aspect ratio so association artwork is never side-cropped and no blank
   band appears under short images; the height cap only trims unusually tall uploads.
   ========================================================================== */
body.ded-site-body .ded-site .wow:has(#header-carousel),
body.ded-site-body .ded-site #header-carousel {
    visibility: visible !important;
    animation: none !important;
}

body.ded-site-body .ded-site #header-carousel .carousel-inner {
    background-color: var(--ded-primary-soft, rgba(19, 88, 152, 0.10));
}

body.ded-site-body .ded-site #header-carousel .carousel-item {
    min-height: 0 !important;
}

body.ded-site-body .ded-site #header-carousel .carousel-item img {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: clamp(220px, 38vw, 560px) !important;
    object-fit: cover;
    object-position: center;
}

body.ded-site-body .ded-site #header-carousel .carousel-control-prev,
body.ded-site-body .ded-site #header-carousel .carousel-control-next {
    width: 42px;
    height: 42px;
    opacity: 0.6;
    background-color: rgba(0, 0, 0, 0.28);
}

body.ded-site-body .ded-site #header-carousel .carousel-indicators {
    margin-bottom: 0.6rem;
}

body.ded-site-body .ded-site #header-carousel .carousel-indicators button {
    width: 9px;
    height: 9px;
    border-width: 1px;
}

@media (max-width: 767.98px) {
    body.ded-site-body .ded-site #header-carousel .carousel-control-prev,
    body.ded-site-body .ded-site #header-carousel .carousel-control-next {
        width: 32px;
        height: 32px;
    }

    body.ded-site-body .ded-site #header-carousel .carousel-indicators {
        margin-bottom: 0.25rem;
    }

    body.ded-site-body .ded-site #header-carousel .carousel-indicators button {
        width: 7px;
        height: 7px;
        margin-inline: 2px;
    }
}

/* ---------- Breadcrumb strip: hidden when it has no items, otherwise a slim divider row ---------- */
body.ded-site-body .ded-site .breadcrumbs {
    background: transparent;
    box-shadow: none;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--ded-line);
}

body.ded-site-body .ded-site .breadcrumbs .breadcrumb {
    margin-bottom: 0;
}

body.ded-site-body .ded-site .breadcrumbs:not(:has(li)) {
    display: none;
}

/* ==========================================================================
   Footer layout (shared StoreFooterVC markup, restyled here only; hidden columns stay hidden)
   ========================================================================== */
body.ded-site-body footer.footer {
    border-top: 0 !important;
}

body.ded-site-body footer > .footer.bgc-primary {
    margin-top: clamp(0.5rem, 1.5vw, 1rem) !important;
    padding-block: clamp(2rem, 4vw, 2.75rem) !important;
    box-shadow: none !important;
    border-top: 0 !important;
    visibility: visible !important;
    animation: none !important;
}

body.ded-site-body footer > .footer.bgc-primary > .container {
    padding-block: 0 !important;
}

body.ded-site-body footer > .footer.bgc-primary .row {
    justify-content: space-between;
    row-gap: 1.75rem;
}

body.ded-site-body footer > .footer.bgc-primary h4 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 0.85rem !important;
}

body.ded-site-body footer > .footer.bgc-primary h4:not(:has(.alink-color))::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 0.55rem;
    margin-inline-end: auto;
    border-radius: 2px;
    background: var(--ded-secondary, #c1b866);
}

body.ded-site-body footer > .footer.bgc-primary .alink-color {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

body.ded-site-body footer > .footer.bgc-primary .alink-color::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ded-secondary, #c1b866);
}

body.ded-site-body footer > .footer.bgc-primary .alink-color:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 5px;
}

body.ded-site-body footer > .footer.bgc-primary address,
body.ded-site-body footer > .footer.bgc-primary p {
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 0.5rem !important;
}

body.ded-site-body footer > .footer.bgc-primary address i,
body.ded-site-body footer > .footer.bgc-primary p > i {
    width: 1rem;
    margin-inline-end: 0.6rem !important;
    margin-inline-start: 0 !important;
    text-align: center;
    opacity: 0.85;
}

body.ded-site-body footer > .footer.bgc-primary .d-flex.pt-3 {
    gap: 0.5rem;
    padding-top: 0.75rem !important;
}

body.ded-site-body footer > .footer.bgc-primary .btn-square.rounded-circle {
    width: 40px;
    height: 40px;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ded-on-primary, #fff);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body.ded-site-body footer > .footer.bgc-primary .btn-square.rounded-circle:hover,
body.ded-site-body footer > .footer.bgc-primary .btn-square.rounded-circle:focus-visible {
    color: var(--ded-on-secondary, #1f2937);
    background: var(--ded-secondary, #c1b866);
    border-color: var(--ded-secondary, #c1b866);
}

body.ded-site-body footer > .copyright {
    padding-block: 0.85rem !important;
    background: #111111;
    background: color-mix(in srgb, var(--ded-primary, #135898) 30%, #0b0f19);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.ded-site-body footer > .copyright [class*="col-"] {
    margin-bottom: 0 !important;
}

body.ded-site-body footer > .copyright img {
    height: 42px;
    width: auto;
}

@media (max-width: 767.98px) {
    body.ded-site-body footer > .footer.bgc-primary .row {
        row-gap: 0.75rem;
    }

    body.ded-site-body footer > .footer.bgc-primary .row > div {
        text-align: center;
    }

    body.ded-site-body footer > .footer.bgc-primary h4:not(:has(.alink-color))::after {
        margin-inline: auto;
    }

    body.ded-site-body footer > .footer.bgc-primary address > .d-flex,
    body.ded-site-body footer > .footer.bgc-primary .d-flex.pt-3 {
        justify-content: center;
    }

    body.ded-site-body footer > .footer.bgc-primary h4 {
        margin-bottom: 0.6rem !important;
    }
}

/* ==========================================================================
   Inner screens: history, verification result, cancel, re-subscription.
   Presentation only, scoped to body.ded-site-body (plus the shared #form-modal cancel popup while it is
   open on a deduction page). Status/tone classes are derived from server values in the views.
   ========================================================================== */

body.ded-site-body {
    --ded-success: #15803d;
    --ded-success-soft: #ecfdf3;
    --ded-danger: #b42318;
    --ded-danger-soft: #fef3f2;
    --ded-warning: #b54708;
    --ded-warning-soft: #fffaeb;
    --ded-info-ink: #175cd3;
    --ded-info-soft: #eff8ff;
    --ded-muted: #667085;
    --ded-card-radius: 16px;
    --ded-card-shadow: 0 6px 24px rgba(16, 24, 40, 0.06);
}

/* ---------- Shared: badges, muted text, mono refs ---------- */
body.ded-site-body .ded-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

body.ded-site-body .ded-badge::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

body.ded-site-body .ded-badge--success { color: var(--ded-success); background: var(--ded-success-soft); }
body.ded-site-body .ded-badge--danger { color: var(--ded-danger); background: var(--ded-danger-soft); }
body.ded-site-body .ded-badge--cancelled,
body.ded-site-body .ded-badge--inactive { color: var(--ded-muted); background: #f2f4f7; }

body.ded-site-body .ded-text-success { color: var(--ded-success) !important; }
body.ded-site-body .ded-text-danger { color: var(--ded-danger) !important; }
body.ded-site-body .ded-hist-muted { color: var(--ded-muted); font-size: 0.9rem; }

body.ded-site-body .ded-hist-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    direction: ltr;
    unicode-bidi: isolate;
    overflow-wrap: anywhere;
}

/* ---------- History: one card per subscription ---------- */
body.ded-site-body .ded-hist {
    padding-inline: 0.25rem;
}

body.ded-site-body .ded-hist-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.9rem;
}

body.ded-site-body .ded-hist-card {
    background: #fff;
    border: 1px solid var(--ded-line);
    border-inline-start: 4px solid var(--ded-primary, #0d6efd);
    border-radius: var(--ded-card-radius);
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
    padding: 1rem 1.1rem;
    min-width: 0;
}

body.ded-site-body .ded-hist-card[data-status="cancelled"],
body.ded-site-body .ded-hist-card[data-status="inactive"] {
    border-inline-start-color: #d0d5dd;
}

body.ded-site-body .ded-empty--error .ded-empty__icon {
    color: var(--ded-danger);
    background: var(--ded-danger-soft);
}

body.ded-site-body .ded-hist-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

body.ded-site-body .ded-hist-card__index {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--ded-primary-strong, #0d6efd);
    background: var(--ded-primary-soft, rgba(13, 110, 253, 0.1));
}

body.ded-site-body .ded-hist-card__title {
    flex: 1 1 auto;
    min-width: 0;
}

body.ded-site-body .ded-hist-card__title h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ded-ink);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

body.ded-site-body .ded-hist-card__ref {
    display: block;
    color: var(--ded-muted);
    font-size: 0.8rem;
}

body.ded-site-body .ded-hist-facts {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.9rem 0 0;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 12px;
}

body.ded-site-body .ded-hist-fact {
    min-width: 0;
}

body.ded-site-body .ded-hist-fact dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ded-muted);
    margin-bottom: 0.15rem;
}

body.ded-site-body .ded-hist-fact dd {
    margin: 0;
    font-weight: 700;
    color: var(--ded-ink);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

body.ded-site-body .ded-hist-fact dd[dir="ltr"] {
    text-align: right;
}

body.ded-site-body .ded-hist-fact--amount dd {
    color: var(--ded-primary-strong, #0d6efd);
    font-size: 1.1rem;
}

body.ded-site-body .ded-hist-fact dd small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ded-muted);
}

body.ded-site-body .ded-hist-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.85rem;
}

body.ded-site-body .ded-hist-actions .btn {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.45rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

body.ded-site-body .ded-hist-toggle__count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding-inline: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.8rem;
}

body.ded-site-body .ded-hist-cancel {
    margin-inline-start: auto;
}

body.ded-site-body .ded-hist-trans {
    margin-top: 0.85rem;
}

body.ded-site-body .ded-hist .ded-hist-table {
    margin: 0;
    border: 1px solid var(--ded-line);
    border-radius: 12px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    text-align: center;
}

body.ded-site-body .ded-hist .ded-hist-table thead th {
    background: var(--ded-primary-soft, #eef2ff) !important;
    color: var(--ded-ink) !important;
    font-size: 0.8rem;
    font-weight: 700;
    border: 0;
}

body.ded-site-body .ded-hist .ded-hist-table td {
    vertical-align: middle;
    font-size: 0.9rem;
    border-top: 1px solid var(--ded-line);
    border-bottom: 0;
}

/* ---------- Empty state ---------- */
body.ded-site-body .ded-empty {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    max-width: 460px;
    margin: 0 auto;
}

body.ded-site-body .ded-empty__icon {
    display: inline-grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--ded-primary-strong, #0d6efd);
    background: var(--ded-primary-soft, rgba(13, 110, 253, 0.1));
    margin-bottom: 0.85rem;
}

body.ded-site-body .ded-empty h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ded-ink);
}

body.ded-site-body .ded-empty p {
    color: var(--ded-muted);
    margin-bottom: 1rem;
}

body.ded-site-body .ded-empty .btn {
    border-radius: 999px;
    padding-inline: 1.5rem;
    font-weight: 700;
}

/* ---------- Result card (verification / cancel / re-subscription) ---------- */
body.ded-site-body .ded-result-wrap {
    padding: 2rem 1rem 2.5rem;
    background: transparent;
}

body.ded-site-body .ded-result {
    /* Neutral/info tone follows the association's own color; success/danger/warning stay semantic. */
    --ded-tone: var(--ded-primary-strong, #175cd3);
    --ded-tone-soft: var(--ded-primary-soft, #eff8ff);
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--ded-line);
    border-top: 5px solid var(--ded-tone);
    border-radius: 20px;
    box-shadow: var(--ded-card-shadow);
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
}

body.ded-site-body .ded-result--success { --ded-tone: var(--ded-success); --ded-tone-soft: var(--ded-success-soft); }
body.ded-site-body .ded-result--danger { --ded-tone: var(--ded-danger); --ded-tone-soft: var(--ded-danger-soft); }
body.ded-site-body .ded-result--warning { --ded-tone: var(--ded-warning); --ded-tone-soft: var(--ded-warning-soft); }
body.ded-site-body .ded-result--pending { --ded-tone: var(--ded-primary-strong, #175cd3); --ded-tone-soft: var(--ded-primary-soft, #eff8ff); }

body.ded-site-body .ded-result__icon {
    display: inline-grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    font-size: 1.6rem;
    color: var(--ded-tone);
    background: var(--ded-tone-soft);
    margin-bottom: 1rem;
}

body.ded-site-body .ded-result__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ded-muted);
}

body.ded-site-body .ded-result__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.3rem, 2.6vw, 1.65rem);
    font-weight: 800;
    color: var(--ded-ink);
}

body.ded-site-body .ded-result__message {
    margin: 0 auto;
    max-width: 30rem;
    color: #344054;
    font-size: 1rem;
    line-height: 1.8;
}

body.ded-site-body .ded-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    text-align: start;
    margin: 1.25rem 0 0;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #344054;
    background: #f2f4f7;
}

body.ded-site-body .ded-callout > i { margin-top: 0.3rem; }
body.ded-site-body .ded-callout--success { background: var(--ded-success-soft); color: #05603a; }
body.ded-site-body .ded-callout--info { background: var(--ded-primary-soft, #eff8ff); color: var(--ded-primary-strong, #194185); }
body.ded-site-body .ded-callout--warning { background: var(--ded-warning-soft); color: #93370d; }

body.ded-site-body .ded-result__details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 1.25rem 0 0;
    padding: 0.9rem;
    border-radius: 14px;
    background: #f8fafc;
    text-align: start;
}

body.ded-site-body .ded-result__details > div { min-width: 0; }

body.ded-site-body .ded-result__details dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ded-muted);
    margin-bottom: 0.15rem;
}

body.ded-site-body .ded-result__details dd {
    margin: 0;
    font-weight: 700;
    color: var(--ded-ink);
    overflow-wrap: anywhere;
}

body.ded-site-body .ded-result__details dd[dir="ltr"] { text-align: right; }

body.ded-site-body .ded-result__details dd small {
    font-size: 0.75rem;
    color: var(--ded-muted);
}

body.ded-site-body .ded-result__note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--ded-muted);
    line-height: 1.7;
}

body.ded-site-body .ded-result__note > i { color: var(--ded-primary-strong, #0d6efd); margin-inline-end: 0.25rem; }

body.ded-site-body .ded-result__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

body.ded-site-body .ded-result__actions .btn {
    min-width: 11rem;
    border-radius: 999px;
    font-weight: 700;
    padding: 0.6rem 1.4rem;
}

body.ded-site-body .ded-result__feedback:not(:empty) {
    margin: 1rem 0 0;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: #f2f4f7;
    color: #344054;
    font-weight: 600;
}

/* Brand buttons for result pages that do not load deduction.css (cancel / re-subscription). */
body.ded-site-body .ded-result .btn.btn-primary {
    background-color: var(--ded-primary, #0d6efd);
    border-color: var(--ded-primary, #0d6efd);
    color: var(--ded-on-primary, #fff);
}

body.ded-site-body .ded-result .btn.btn-primary:hover,
body.ded-site-body .ded-result .btn.btn-primary:focus-visible {
    background-color: var(--ded-primary-hover, #0b5ed7);
    border-color: var(--ded-primary-hover, #0b5ed7);
    color: var(--ded-on-primary, #fff);
}

body.ded-site-body .ded-result .btn.btn-outline-primary {
    color: var(--ded-primary-strong, #0d6efd);
    border-color: var(--ded-primary-strong, #0d6efd);
    background: transparent;
}

body.ded-site-body .ded-result .btn.btn-outline-primary:hover,
body.ded-site-body .ded-result .btn.btn-outline-primary:focus-visible {
    background-color: var(--ded-primary-strong, #0d6efd);
    color: #fff;
}

body.ded-site-body .ded-result .btn:focus-visible,
body.ded-site-body .ded-hist .btn:focus-visible {
    outline: 3px solid var(--ded-primary-ring, rgba(13, 110, 253, 0.35));
    outline-offset: 2px;
    box-shadow: none;
}

/* ---------- Cancel-reason popup (shared #form-modal, deduction pages only) ---------- */
body.ded-site-body #form-modal .modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.18);
}

body.ded-site-body #form-modal .modal-header {
    background: var(--ded-primary, #0d6efd) !important;
    color: var(--ded-on-primary, #fff) !important;
    border: 0;
}

body.ded-site-body #form-modal .modal-body {
    padding: 1.25rem 1.5rem 1rem;
}

body.ded-site-body .ded-cancel-popup__lead {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: var(--ded-danger-soft);
    color: var(--ded-danger);
    font-size: 0.92rem;
    line-height: 1.7;
}

body.ded-site-body .ded-cancel-popup__lead > i { margin-top: 0.3rem; }

body.ded-site-body .ded-cancel-popup .form-label {
    font-weight: 700;
    color: var(--ded-ink);
}

body.ded-site-body .ded-cancel-popup .form-control {
    border-radius: 12px;
}

body.ded-site-body .ded-cancel-popup .form-control:focus {
    border-color: var(--ded-primary, #0d6efd);
    box-shadow: 0 0 0 0.2rem var(--ded-primary-ring, rgba(13, 110, 253, 0.25));
}

body.ded-site-body .ded-cancel-popup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body.ded-site-body .ded-cancel-popup__actions .btn {
    border-radius: 999px;
    font-weight: 700;
    padding-inline: 1.4rem;
}

/* ---------- Empty required fields are not errors yet ----------
   The shared site.css paints every input:invalid red, so empty required fields were red before the donor typed anything.
   On deduction pages only: neutral until the donor has typed (placeholder gone) or focuses the field; real invalid
   values keep the red border. Validation itself is unchanged. */
body.ded-site-body .ded-site input.form-control:invalid:placeholder-shown:not(:focus) {
    border-color: #d0d5dd;
}

/* ---------- Login / create account (Store/Login in deduction chrome) ----------
   Same markup, ids, tabs script and validation; only the store's generic look (square navy tabs, grey boxes) is
   aligned with the deduction wizard. Store/Login outside deductions does not have body.ded-site-body. */
body.ded-site-body .service-tab-section .col-lg-8 > .tabs.bg-body-tertiary {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 1rem !important;
}

body.ded-site-body .service-tab-section #aboutTab.nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    max-width: 420px;
    margin: 0 auto;
    padding: 0.3rem;
    background: #fff;
    border: 1px solid var(--ded-line) !important;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
}

body.ded-site-body .service-tab-section #aboutTab .nav-item {
    flex: 1 1 0;
    min-width: 0;
    margin: 0 !important;
}

body.ded-site-body .service-tab-section #aboutTab .nav-link {
    width: 100%;
    margin: 0 !important;
    padding: 0.55rem 0.75rem;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--ded-primary-strong, #135898) !important;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.ded-site-body .service-tab-section #aboutTab .nav-link:hover:not(.active),
body.ded-site-body .service-tab-section #aboutTab .nav-link:focus-visible:not(.active) {
    background: var(--ded-primary-soft, rgba(19, 88, 152, 0.1)) !important;
}

body.ded-site-body .service-tab-section #aboutTab .nav-link.active {
    background: var(--ded-primary, #135898) !important;
    color: var(--ded-on-primary, #fff) !important;
    box-shadow: 0 6px 16px var(--ded-primary-ring, rgba(19, 88, 152, 0.28));
}

/* The form card */
body.ded-site-body .service-tab-section .tab-pane .tabs.bg-body-tertiary {
    background: #fff !important;
    border: 1px solid var(--ded-line);
    border-radius: var(--ded-card-radius) !important;
    box-shadow: var(--ded-card-shadow);
    padding: 1.5rem 1.5rem 1rem !important;
}

body.ded-site-body .service-tab-section .col-form-label {
    font-weight: 600;
    color: var(--ded-ink);
}

body.ded-site-body .service-tab-section .form-control {
    min-height: 44px;
    border-radius: 10px;
    border-color: #d0d5dd;
}

/* Password fields: the input joins the eye toggle (whose inline style rounds its outer corners). */
body.ded-site-body .service-tab-section .input-group > .form-control {
    border-start-start-radius: 10px;
    border-end-start-radius: 10px;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

body.ded-site-body .service-tab-section .form-control:focus {
    border-color: var(--ded-primary, #135898);
    box-shadow: 0 0 0 0.2rem var(--ded-primary-ring, rgba(19, 88, 152, 0.25));
}

body.ded-site-body .service-tab-section .input-group-text {
    border-color: #d0d5dd;
    background: #f8fafc;
    color: var(--ded-muted);
    cursor: pointer;
}

body.ded-site-body .service-tab-section #loginButton,
body.ded-site-body .service-tab-section #registerButton,
body.ded-site-body .service-tab-section #visitorButton {
    min-height: 44px;
    border-radius: 999px;
    font-weight: 700;
    background-color: var(--ded-primary, #135898);
    border-color: var(--ded-primary, #135898);
    color: var(--ded-on-primary, #fff);
}

body.ded-site-body .service-tab-section #loginButton:hover,
body.ded-site-body .service-tab-section #registerButton:hover,
body.ded-site-body .service-tab-section #visitorButton:hover,
body.ded-site-body .service-tab-section #loginButton:focus-visible,
body.ded-site-body .service-tab-section #registerButton:focus-visible,
body.ded-site-body .service-tab-section #visitorButton:focus-visible {
    background-color: var(--ded-primary-hover, #0f4a80);
    border-color: var(--ded-primary-hover, #0f4a80);
    box-shadow: 0 0 0 3px var(--ded-primary-ring, rgba(19, 88, 152, 0.28));
}

/* ---------- Inner screens: responsive ---------- */
@media (max-width: 991.98px) {
    body.ded-site-body .ded-hist-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    body.ded-site-body .ded-hist-card {
        padding: 0.85rem 0.8rem;
    }

    body.ded-site-body .ded-hist-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0.65rem;
    }

    body.ded-site-body .ded-hist-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    body.ded-site-body .ded-hist-cancel {
        margin-inline-start: 0;
    }

    /* Transactions table becomes stacked label/value rows */
    body.ded-site-body .ded-hist .ded-hist-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    body.ded-site-body .ded-hist .ded-hist-table,
    body.ded-site-body .ded-hist .ded-hist-table tbody,
    body.ded-site-body .ded-hist .ded-hist-table tr,
    body.ded-site-body .ded-hist .ded-hist-table td {
        display: block;
        width: 100%;
    }

    body.ded-site-body .ded-hist .ded-hist-table tr {
        padding: 0.4rem 0.75rem;
        border-top: 1px solid var(--ded-line);
    }

    body.ded-site-body .ded-hist .ded-hist-table tr:first-child {
        border-top: 0;
    }

    body.ded-site-body .ded-hist .ded-hist-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        border: 0;
        padding: 0.3rem 0;
        text-align: start;
    }

    body.ded-site-body .ded-hist .ded-hist-table td::before {
        content: attr(data-label);
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--ded-muted);
    }

    body.ded-site-body .ded-result-wrap {
        padding: 1.25rem 0.75rem 1.75rem;
    }

    body.ded-site-body .ded-result {
        padding: 1.5rem 1rem 1.25rem;
        border-radius: 16px;
    }

    body.ded-site-body .ded-result__details {
        grid-template-columns: minmax(0, 1fr);
    }

    body.ded-site-body .ded-result__actions .btn {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* ---------- Password recovery (forgot / reset) ---------- */
body.ded-site-body .ded-auth {
    --ded-tone: var(--ded-primary-strong, #175cd3);
    --ded-tone-soft: var(--ded-primary-soft, #eff8ff);
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--ded-line);
    border-top: 5px solid var(--ded-tone);
    border-radius: 20px;
    box-shadow: var(--ded-card-shadow);
    padding: 2rem 1.75rem 1.75rem;
}

body.ded-site-body .ded-auth--success { --ded-tone: var(--ded-success); --ded-tone-soft: var(--ded-success-soft); }
body.ded-site-body .ded-auth--danger { --ded-tone: var(--ded-danger); --ded-tone-soft: var(--ded-danger-soft); }

body.ded-site-body .ded-auth__head { text-align: center; margin-bottom: 1.25rem; }

body.ded-site-body .ded-auth__icon {
    display: inline-grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    font-size: 1.6rem;
    color: var(--ded-tone);
    background: var(--ded-tone-soft);
    margin-bottom: 1rem;
}

body.ded-site-body .ded-auth__form { display: grid; gap: 1rem; }
body.ded-site-body .ded-field { min-width: 0; }

body.ded-site-body .ded-field__label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ded-ink);
}

body.ded-site-body .ded-auth .form-control {
    min-height: 48px;
    border-radius: 12px;
}

body.ded-site-body .ded-auth .form-control:focus {
    border-color: var(--ded-primary, #0d6efd);
    box-shadow: 0 0 0 3px var(--ded-primary-ring, rgba(13, 110, 253, 0.25));
}

body.ded-site-body .ded-auth .input-group .btn { min-width: 48px; border-radius: 12px 0 0 12px; }
html[dir="rtl"] body.ded-site-body .ded-auth .input-group > .form-control { border-radius: 0 12px 12px 0; }
html[dir="rtl"] body.ded-site-body .ded-auth .input-group .btn { border-radius: 12px 0 0 12px; }

body.ded-site-body .ded-field__error { display: block; margin-top: 0.3rem; font-size: 0.85rem; color: var(--ded-danger); }
body.ded-site-body .ded-field__hint { display: block; margin-top: 0.3rem; font-size: 0.82rem; color: var(--ded-muted); }

body.ded-site-body .ded-auth .ded-callout { margin-top: 0; }
body.ded-site-body .ded-auth .ded-result__actions { margin-top: 1.25rem; }

@media (max-width: 575.98px) {
    body.ded-site-body .ded-auth { padding: 1.5rem 1.1rem 1.25rem; border-radius: 16px; }
    body.ded-site-body .ded-auth .ded-result__actions .btn { width: 100%; }
}

body.ded-site-body .ded-forgot-link {
    display: inline-block;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ded-primary-strong, #0d6efd);
    text-decoration: none;
    padding: 0.25rem 0;
}

body.ded-site-body .ded-forgot-link:hover,
body.ded-site-body .ded-forgot-link:focus-visible { text-decoration: underline; }

body.ded-site-body .ded-channel { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; min-width: 0; }
body.ded-site-body .ded-channel .ded-field__label { padding: 0; margin-bottom: 0.1rem; float: none; width: auto; }
body.ded-site-body .ded-channel__option { display: flex; align-items: flex-start; gap: 0.7rem; margin: 0; cursor: pointer; padding: 0.8rem 1rem; border: 1px solid var(--ded-line); border-radius: 12px; background: #fff; }
body.ded-site-body .ded-channel__option:has(input:checked) { border-color: var(--ded-primary, #0d6efd); background: var(--ded-primary-soft, #eff8ff); }
body.ded-site-body .ded-channel__option input { margin-top: 0.35rem; accent-color: var(--ded-primary, #0d6efd); }
body.ded-site-body .ded-channel__option small { display: block; color: var(--ded-muted); font-size: 0.82rem; margin-top: 0.1rem; font-weight: 400; }
body.ded-site-body .ded-channel__option span { font-weight: 700; min-width: 0; }
body.ded-site-body .ded-code-input { text-align: center; letter-spacing: 0.5rem; font-size: 1.3rem; font-weight: 800; }

body.ded-site-body .ded-forgot-row { margin: -0.35rem 0 0.25rem; }
body.ded-site-body .ded-forgot-row .ded-forgot-link { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; }
body.ded-site-body .ded-forgot-row .ded-forgot-link i { font-size: 0.8rem; opacity: 0.85; }

/* Password fields (wizard login/register, store login): the input and the eye toggle read as ONE control.
   The toggle sits in a Bootstrap-4 style .input-group-append wrapper, so Bootstrap's joined-corner rules do not reach it;
   logical radii keep the outer corners rounded and the joint square in RTL and LTR. */
body.ded-site-body .service-tab-section .input-group { flex-wrap: nowrap; align-items: stretch; }
body.ded-site-body .service-tab-section .input-group > .form-control {
    border-start-start-radius: 10px !important;
    border-end-start-radius: 10px !important;
    border-start-end-radius: 0 !important;
    border-end-end-radius: 0 !important;
    min-height: 44px;
}
body.ded-site-body .service-tab-section .input-group > .input-group-append { display: flex; margin-inline-start: -1px; }
body.ded-site-body .service-tab-section .input-group-append > .input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 44px;
    padding: 0 0.85rem !important;
    border: 1px solid #d0d5dd;
    border-radius: 0 !important;
    border-start-end-radius: 10px !important;
    border-end-end-radius: 10px !important;
    background: #f8fafc;
    color: var(--ded-muted);
}
body.ded-site-body .service-tab-section .input-group-append > .input-group-text:hover { color: var(--ded-primary-strong, #135898); background: var(--ded-primary-soft, #eef4fb); }
body.ded-site-body .service-tab-section .input-group:focus-within > .form-control { position: relative; z-index: 2; }
