:root {
    --mcc-navy: #12253f;
    --mcc-blue: #0f63b6;
    --mcc-blue-dark: #123f73;
    --mcc-blue-bright: #1677ca;
    --mcc-aqua: #198aa6;
    --mcc-border: rgba(18, 37, 63, .16);
    --mcc-page-width: min(1280px, 92vw);
}

body.customer-portal-page,
body.store-body {
    min-height: 100vh;
    background-color: #edf2f6;
    background-image:
        linear-gradient(rgba(244, 248, 251, .56), rgba(244, 248, 251, .56)),
        url('/assets/images/site/apier.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.customer-site-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    margin: 0;
    background: linear-gradient(110deg, #12355c, var(--mcc-blue) 62%, var(--mcc-aqua));
    color: #fff;
    box-shadow: 0 2px 10px rgba(18, 37, 63, .18);
}

.customer-site-header__brand-row {
    width: var(--mcc-page-width);
    min-height: 84px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .55rem 0;
}

.customer-site-brand {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    flex: 0 0 auto;
}

.customer-site-brand:hover,
.customer-site-brand:focus { color: #fff; }

.customer-site-brand img {
    width: 52px;
    height: 64px;
    object-fit: contain;
}

.customer-site-brand__text { line-height: 1.08; }
.customer-site-brand__text strong { display: block; font-size: 1.28rem; font-weight: 700; }
.customer-site-brand__text small { display: block; margin-top: .24rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }

.customer-site-header__tagline {
    margin-left: auto;
    font-size: .98rem;
    opacity: .92;
    text-align: right;
}

.customer-main-nav { background: linear-gradient(90deg, #102943, #154d7f); border-top: 1px solid rgba(255,255,255,.14); }
.customer-main-nav__inner {
    width: var(--mcc-page-width);
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    min-height: 46px;
}

.customer-nav-link,
.customer-nav-dropdown {
    min-height: 46px;
    padding: .72rem .95rem;
    border: 0;
    background: transparent;
    color: #fff;
    text-decoration: none;
    font: inherit;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    white-space: nowrap;
}

.customer-nav-link:hover,
.customer-nav-link:focus,
.customer-nav-dropdown:hover,
.customer-nav-dropdown:focus,
.customer-nav-group.is-open > .customer-nav-dropdown,
.customer-nav-group.is-active > .customer-nav-dropdown,
.customer-nav-link.is-active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.customer-nav-group { position: relative; }
.customer-nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 235px;
    padding: .4rem;
    border-radius: 0 0 .55rem .55rem;
    background: #fff;
    box-shadow: 0 .8rem 1.6rem rgba(18, 37, 63, .22);
    display: none;
}
.customer-nav-group.is-open .customer-nav-menu { display: block; }
.customer-nav-menu a {
    display: block;
    padding: .72rem .8rem;
    border-radius: .35rem;
    color: #26384c;
    text-decoration: none;
}
.customer-nav-menu a:hover,
.customer-nav-menu a:focus { background: #eef4fa; color: var(--mcc-blue-dark); }

.customer-nav-spacer { flex: 1 1 auto; }
.customer-cart-link span {
    display: inline-grid;
    place-items: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #fff;
    color: var(--mcc-navy);
    font-size: .78rem;
    font-weight: 700;
}
.customer-nav-login { font-weight: 700; }
.customer-menu-toggle { display: none; }

.customer-page-shell {
    width: var(--mcc-page-width);
    margin: 1.5rem auto 2.5rem;
}
.customer-surface {
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 1rem;
    box-shadow: 0 .55rem 1.8rem rgba(18, 37, 63, .11);
    backdrop-filter: blur(3px);
}
.customer-site-footer {
    width: var(--mcc-page-width);
    margin: 1.5rem auto 2rem;
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #516173;
    font-size: .9rem;
}
.customer-site-footer a { color: var(--mcc-blue-dark); }

/* Let existing service and store content sit naturally inside the new shell. */
.customer-page-shell > .services-home,
.customer-page-shell > .store-shell,
.customer-page-shell > main.store-shell {
    margin-top: 0;
}

@media (min-width: 901px) {
    .customer-nav-group:hover .customer-nav-menu { display: block; }
}

@media (max-width: 900px) {
    body.customer-portal-page,
    body.store-body { background-attachment: scroll; }
    .customer-site-header__brand-row { width: 100%; padding: .5rem .8rem; min-height: 72px; }
    .customer-site-brand img { width: 44px; height: 54px; }
    .customer-site-brand__text strong { font-size: 1.08rem; }
    .customer-site-brand__text small { font-size: .68rem; }
    .customer-site-header__tagline { display: none; }
    .customer-menu-toggle {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        border: 1px solid rgba(255,255,255,.5);
        border-radius: .45rem;
        padding: .55rem .7rem;
        background: transparent;
        color: #fff;
        font: inherit;
        cursor: pointer;
    }
    .customer-main-nav { display: none; }
    .customer-site-header.is-menu-open .customer-main-nav { display: block; }
    .customer-main-nav__inner { width: 100%; display: block; padding: .35rem .55rem .7rem; }
    .customer-nav-link,
    .customer-nav-dropdown { width: 100%; justify-content: space-between; min-height: 44px; padding: .72rem .65rem; }
    .customer-nav-group { width: 100%; }
    .customer-nav-menu {
        position: static;
        min-width: 0;
        margin: 0 .25rem .35rem;
        border-radius: .45rem;
        box-shadow: none;
    }
    .customer-nav-spacer { display: none; }
    .customer-page-shell { width: min(100% - 1rem, 1280px); margin: .75rem auto 1.5rem; }
    .customer-site-footer { width: calc(100% - 1.5rem); display: block; text-align: center; }
    .customer-site-footer > * + * { margin-top: .35rem; }
}


/* Build 0028B - public/customer visual refinement */
.customer-main-nav { box-shadow: 0 3px 10px rgba(18,37,63,.16); }
.customer-nav-link,
.customer-nav-dropdown { border-bottom: 3px solid transparent; }
.customer-nav-link:hover,
.customer-nav-link:focus,
.customer-nav-dropdown:hover,
.customer-nav-dropdown:focus,
.customer-nav-group.is-open > .customer-nav-dropdown,
.customer-nav-group.is-active > .customer-nav-dropdown,
.customer-nav-link.is-active {
    background: rgba(255,255,255,.10);
    border-bottom-color: #55b8d1;
}
.customer-nav-menu { border-top: 3px solid var(--mcc-blue-bright); }
.customer-nav-menu a:hover,
.customer-nav-menu a:focus { background: #e8f3fc; color: var(--mcc-blue-dark); }

/* Reusable secondary page heading beneath the global banner. */
.customer-page-heading,
.page-heading,
.store-page-heading {
    margin: 0 0 1rem;
    padding: 1.15rem 1.35rem;
    border: 1px solid rgba(18,63,115,.14);
    border-left: 5px solid var(--mcc-blue-bright);
    border-radius: .8rem;
    background: rgba(255,255,255,.88);
    box-shadow: 0 .35rem 1rem rgba(18,37,63,.08);
    backdrop-filter: blur(3px);
}
.customer-page-heading h1,
.page-heading h1,
.store-page-heading h1 {
    margin: .15rem 0 .4rem;
    color: var(--mcc-navy);
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    line-height: 1.08;
    font-weight: 750;
}
.customer-page-heading p:last-child,
.page-heading p:last-child,
.store-page-heading p:last-child {
    max-width: 780px;
    margin: 0;
    color: #42566a;
    line-height: 1.55;
}
.customer-page-heading .eyebrow,
.page-heading .eyebrow,
.store-page-heading .eyebrow {
    color: var(--mcc-blue);
}

.customer-surface {
    border-color: rgba(18,63,115,.12);
    box-shadow: 0 .55rem 1.8rem rgba(18,37,63,.13);
}
.customer-site-footer {
    color: #314a62;
    text-shadow: 0 1px 0 rgba(255,255,255,.75);
}
.customer-site-footer a { color: #0b579d; font-weight: 650; }

@media (max-width: 900px) {
    body.customer-portal-page,
    body.store-body {
        background-image:
            linear-gradient(rgba(244,248,251,.64), rgba(244,248,251,.64)),
            url('/assets/images/site/apier.jpg');
    }
    .customer-page-heading,
    .page-heading,
    .store-page-heading { padding: 1rem; border-left-width: 4px; }
}


/* Build 0028E - customer experience standard */
.customer-site-header__brand-row {
    justify-content: space-between;
}
.customer-site-account {
    margin-left: auto;
    flex: 0 0 auto;
    position: relative;
}
.customer-auth-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
}
.customer-auth-button {
    min-height: 40px;
    padding: .55rem .9rem;
    border-radius: .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    text-decoration: none;
    transition: transform .12s ease, background .16s ease, border-color .16s ease;
}
.customer-auth-button:hover,
.customer-auth-button:focus {
    transform: translateY(-1px);
}
.customer-auth-button--primary {
    background: #fff;
    border: 1px solid #fff;
    color: var(--mcc-blue-dark);
}
.customer-auth-button--primary:hover,
.customer-auth-button--primary:focus {
    background: #f0f7ff;
    color: var(--mcc-blue-dark);
}
.customer-auth-button--secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,.78);
    color: #fff;
}
.customer-auth-button--secondary:hover,
.customer-auth-button--secondary:focus {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.customer-account-menu { position: relative; }
.customer-account-menu > summary { list-style: none; }
.customer-account-menu > summary::-webkit-details-marker { display: none; }
.customer-account-trigger {
    min-height: 42px;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: .52rem;
    padding: .3rem .7rem .3rem .35rem;
    font-weight: 750;
    cursor: pointer;
}
.customer-account-trigger:hover,
.customer-account-trigger:focus,
.customer-account-menu[open] > .customer-account-trigger {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.7);
}
.customer-account-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #fff;
    color: var(--mcc-blue-dark);
    font-size: .86rem;
    font-weight: 850;
    flex: 0 0 auto;
}
.customer-account-avatar--large { width: 44px; height: 44px; font-size: 1rem; background: #ddecfb; }
.customer-account-trigger__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-account-trigger__chevron { font-size: .72rem; opacity: .9; }
.customer-account-panel {
    position: absolute;
    top: calc(100% + .55rem);
    right: 0;
    width: min(320px, calc(100vw - 1.5rem));
    border: 1px solid rgba(18,37,63,.16);
    border-radius: .8rem;
    background: #fff;
    color: #18283a;
    box-shadow: 0 1rem 2.4rem rgba(18,37,63,.24);
    overflow: hidden;
    z-index: 1200;
}
.customer-account-identity { display: flex; gap: .75rem; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid #e5ebf1; }
.customer-account-identity strong,
.customer-account-identity small { display: block; }
.customer-account-identity strong { color: var(--mcc-navy); font-size: 1rem; }
.customer-account-identity small { margin-top: .16rem; color: #5d6d7e; font-size: .86rem; overflow-wrap: anywhere; }
.customer-account-panel__links { padding: .4rem; }
.customer-account-panel__links a,
.customer-account-logout button {
    width: 100%; min-height: 42px; display: flex; align-items: center; gap: .65rem;
    padding: .65rem .75rem; border: 0; border-radius: .45rem; background: transparent;
    color: #24384c; text-decoration: none; font: inherit; text-align: left; cursor: pointer;
}
.customer-account-panel__links a:hover,
.customer-account-panel__links a:focus,
.customer-account-logout button:hover,
.customer-account-logout button:focus { background: #edf5fc; color: var(--mcc-blue-dark); }
.customer-account-logout { margin: 0; padding: .4rem; border-top: 1px solid #e5ebf1; }

/* Standard customer-facing information banner. */
.customer-page-heading,
.page-heading,
.store-page-heading {
    position: relative;
    overflow: hidden;
}
.customer-page-heading::after,
.page-heading::after,
.store-page-heading::after {
    content: '';
    position: absolute;
    inset: 0 0 auto auto;
    width: 7rem;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(22,119,202,.055));
    pointer-events: none;
}

/* Shared toast system. Success/info auto-dismiss; warning/error stay until closed. */
.portal-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: min(390px, calc(100vw - 2rem));
    display: grid;
    gap: .7rem;
    z-index: 2500;
    pointer-events: none;
}
.portal-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .75rem;
    align-items: start;
    padding: .9rem 1rem;
    border-radius: .7rem;
    border: 1px solid rgba(18,37,63,.12);
    box-shadow: 0 .8rem 2rem rgba(18,37,63,.22);
    color: #173047;
    background: #fff;
}
.portal-toast--success { border-left: 5px solid #1d8a4a; background: #f0fbf5; }
.portal-toast--info { border-left: 5px solid #1677ca; background: #f1f8fe; }
.portal-toast--warning { border-left: 5px solid #d89000; background: #fff9e8; }
.portal-toast--error { border-left: 5px solid #bd2e2e; background: #fff2f2; }
.portal-toast__body { line-height: 1.45; font-weight: 600; }
.portal-toast__close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    opacity: .72;
}
.portal-toast__close:hover,
.portal-toast__close:focus { background: rgba(18,37,63,.08); opacity: 1; }
.portal-toast.is-hiding { opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease; }

@media (max-width: 900px) {
    .customer-site-header__brand-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: .45rem;
    }
    .customer-site-brand { min-width: 0; }
    .customer-site-brand__text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .customer-site-account { margin-left: 0; }
    .customer-auth-actions { gap: .35rem; }
    .customer-auth-button { min-height: 36px; padding: .45rem .62rem; font-size: .88rem; }
    .customer-account-trigger { min-height: 38px; padding: .22rem .52rem .22rem .28rem; }
    .customer-account-avatar { width: 31px; height: 31px; }
    .customer-account-trigger__name { max-width: 92px; font-size: .88rem; }
    .customer-account-panel { position: fixed; top: 66px; right: .65rem; }
    .customer-menu-toggle { margin-left: 0; }
    .portal-toast-stack { top: .65rem; right: .65rem; width: calc(100vw - 1.3rem); }
}

@media (max-width: 560px) {
    .customer-site-header__brand-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            'brand account'
            'brand menu';
        align-items: center;
    }
    .customer-site-brand { grid-area: brand; }
    .customer-site-account { grid-area: account; justify-self: end; }
    .customer-menu-toggle { grid-area: menu; justify-self: end; }
    .customer-site-brand img { width: 39px; height: 48px; }
    .customer-site-brand__text strong { font-size: .98rem; }
    .customer-site-brand__text small { font-size: .6rem; letter-spacing: .05em; }
    .customer-account-trigger__name { max-width: 78px; }
}

/* Build 0028H - customer login page */
.portal-auth-shell {
    display: grid;
    place-items: start center;
    padding-top: 1.4rem;
}
.portal-auth-card {
    width: min(100%, 620px);
    padding: 0;
    overflow: hidden;
}
.portal-auth-card__heading {
    padding: 1.35rem 1.5rem 1.15rem;
    border-left: 5px solid var(--mcc-blue-bright);
    border-bottom: 1px solid rgba(18,37,63,.09);
    background: rgba(255,255,255,.82);
}
.portal-auth-card__heading .eyebrow {
    margin: 0 0 .45rem;
    color: var(--mcc-blue);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .14em;
}
.portal-auth-card__heading h1 {
    margin: 0;
    color: var(--mcc-navy);
    font-size: clamp(2rem, 4vw, 2.55rem);
    line-height: 1.05;
}
.portal-auth-card__heading p:last-child {
    margin: .6rem 0 0;
    color: #40566c;
    line-height: 1.55;
}
.portal-auth-form {
    display: grid;
    gap: 1rem;
    padding: 1.4rem 1.5rem 1.2rem;
}
.portal-auth-field {
    display: grid;
    gap: .42rem;
}
.portal-auth-field label {
    color: #21374c;
    font-weight: 750;
}
.portal-auth-field__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.portal-auth-field__label-row a,
.portal-auth-register a {
    color: var(--mcc-blue);
    text-decoration: none;
    font-weight: 650;
}
.portal-auth-field__label-row a:hover,
.portal-auth-field__label-row a:focus,
.portal-auth-register a:hover,
.portal-auth-register a:focus { text-decoration: underline; }
.portal-auth-field input {
    width: 100%;
    min-height: 48px;
    padding: .72rem .82rem;
    border: 1px solid #b9c7d4;
    border-radius: .55rem;
    background: rgba(255,255,255,.96);
    color: #16283b;
    font: inherit;
    outline: none;
}
.portal-auth-field input:focus {
    border-color: var(--mcc-blue-bright);
    box-shadow: 0 0 0 3px rgba(22,119,202,.14);
}
.portal-auth-submit {
    min-height: 50px;
    border: 0;
    border-radius: .58rem;
    background: linear-gradient(90deg, var(--mcc-blue-dark), var(--mcc-blue));
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.portal-auth-submit:hover,
.portal-auth-submit:focus { filter: brightness(1.05); }
.portal-auth-register {
    display: flex;
    justify-content: center;
    gap: .45rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid rgba(18,37,63,.09);
    color: #526477;
    text-align: center;
}
.portal-auth-inline {
    margin: 1rem 1.5rem 0;
    padding: .75rem .9rem;
    border-radius: .55rem;
    border-left: 4px solid;
    font-weight: 600;
}
.portal-auth-inline--success { border-left-color: #1d8a4a; background: #f0fbf5; color: #215e3c; }
.portal-auth-inline--warning { border-left-color: #d89000; background: #fff9e8; color: #715112; }
.portal-auth-inline--error { border-left-color: #bd2e2e; background: #fff2f2; color: #782626; }

@media (max-width: 560px) {
    .portal-auth-shell { padding-top: .75rem; }
    .portal-auth-card__heading,
    .portal-auth-form { padding-left: 1rem; padding-right: 1rem; }
    .portal-auth-register { padding-left: 1rem; padding-right: 1rem; }
    .portal-auth-inline { margin-left: 1rem; margin-right: 1rem; }
    .portal-auth-field__label-row { align-items: flex-start; }
}
