/*
 * ZOSCLIENT 1.0.2 — structural correction layer for WHMCS 7.6.0
 * Loaded after 1.0.1. It fixes horizontal offsets, contextual sidebars,
 * authenticated cart width, login composition and public footer layout.
 */

/* -------------------------------------------------------------------------
   1. CLIENT AREA: TRUE FULL-WIDTH CONTENT, LEFT ALIGNED
   ------------------------------------------------------------------------- */
body.wilo-authenticated section#main-body.wilo-main-body {
    width: 100%;
    padding: 22px 24px 32px !important;
}

body.wilo-authenticated .wilo-content-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.wilo-authenticated .wilo-content-container > .row {
    width: 100%;
    margin: 0 !important;
}

body.wilo-authenticated .wilo-content-container > .row > [class*="col-"] {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

body.wilo-authenticated .main-content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

body.wilo-authenticated .wilo-page-heading {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 20px !important;
    float: none !important;
}

/* WHMCS pages with primary/secondary sidebars used to push the useful
   content ~300px to the right. In 1.0.2 the page content comes first and
   always uses the complete available width. Context actions move below it. */
@media (min-width: 992px) {
    body.wilo-authenticated .wilo-content-container > .row.wilo-has-context-menu {
        display: grid !important;
        width: 100%;
        margin: 0 !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas:
            "heading"
            "main"
            "menu" !important;
        align-items: start;
        gap: 0;
    }

    body.wilo-authenticated .wilo-has-context-menu > .wilo-page-heading {
        position: static !important;
        width: 100% !important;
        grid-area: heading !important;
    }

    body.wilo-authenticated .wilo-has-context-menu > .main-content {
        position: static !important;
        width: 100% !important;
        min-width: 0;
        grid-area: main !important;
    }

    body.wilo-authenticated .wilo-has-context-menu > .wilo-context-menu {
        position: static !important;
        width: 100% !important;
        min-width: 0;
        margin: 24px 0 0 !important;
        grid-area: menu !important;
        float: none !important;
    }

    body.wilo-authenticated .wilo-has-context-menu > .clearfix {
        display: none !important;
    }

    body.wilo-authenticated .wilo-context-menu .wilo-context-menu-content {
        display: block !important;
        width: 100%;
    }

    body.wilo-authenticated .wilo-context-menu .wilo-context-menu-label {
        display: flex !important;
        width: 100%;
        min-height: 52px;
        margin: 0 0 12px;
        padding: 10px 14px;
    }

    body.wilo-authenticated .wilo-context-menu .wilo-context-primary,
    body.wilo-authenticated .wilo-context-menu .wilo-context-secondary {
        display: grid !important;
        width: 100% !important;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 12px;
    }

    body.wilo-authenticated .wilo-context-menu .wilo-context-secondary {
        margin-top: 12px;
    }

    body.wilo-authenticated .wilo-context-menu .panel {
        width: 100% !important;
        min-width: 0;
        margin: 0 !important;
    }
}

/* Never center authenticated knowledgebase content in a narrow 1120px box. */
body.wilo-authenticated .wilo-knowledgebase,
body.wilo-authenticated .wilo-knowledgebase-category,
body.wilo-authenticated .wilo-knowledgebase-article {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

/* Native tables/cards should occupy the same left edge as the heading. */
body.wilo-authenticated .table-container,
body.wilo-authenticated .dataTables_wrapper,
body.wilo-authenticated .panel,
body.wilo-authenticated .card {
    max-width: none;
}

body.wilo-authenticated .table-container {
    width: 100% !important;
}

/* -------------------------------------------------------------------------
   2. ORDER / CONTRACT SERVICES: FULL AVAILABLE WIDTH
   ------------------------------------------------------------------------- */
body.wilo-authenticated .wilo-shopping-cart {
    width: 100% !important;
    max-width: none !important;
    padding: 22px 24px 34px !important;
}

body.wilo-authenticated .wilo-shopping-cart .wilo-content-container,
body.wilo-authenticated .wilo-shopping-cart .main-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.wilo-authenticated .wilo-shopping-cart .wilo-purchase-progress,
body.wilo-authenticated .wilo-shopping-cart #order-standard_cart,
body.wilo-authenticated #order-standard_cart.wilo-products-layout {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

body.wilo-authenticated #order-standard_cart.wilo-products-layout .wilo-products-main,
body.wilo-authenticated #order-standard_cart.wilo-products-layout .products {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

body.wilo-authenticated #order-standard_cart .products > .row {
    width: calc(100% + 16px) !important;
}

/* Logged-in application screens intentionally have no website footer.
   The template also suppresses it structurally in 1.0.2; this is a fallback. */
body.wilo-authenticated .wilo-site-footer,
body.wilo-authenticated .wilo-site-footer-authenticated {
    display: none !important;
}

/* -------------------------------------------------------------------------
   3. LOGIN: SELF-CONTAINED, BALANCED, NO CRAMPED SINGLE COLUMN
   ------------------------------------------------------------------------- */
body.wilo-template-login .wilo-public-header {
    display: none !important;
}

body.wilo-template-login section#main-body.wilo-main-body {
    min-height: auto !important;
    padding: 52px 32px 60px !important;
}

body.wilo-template-login .wilo-content-container,
body.wilo-template-login .wilo-content-container > .row,
body.wilo-template-login .main-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.wilo-template-login .main-content {
    display: block !important;
    min-height: 0 !important;
}

body.wilo-template-login .logincontainer.zos-login-v102 {
    display: grid !important;
    overflow: hidden;
    width: min(1180px, 100%) !important;
    max-width: 1180px !important;
    min-height: 620px;
    margin: 0 auto !important;
    padding: 0 !important;
    grid-template-columns: minmax(0, 1.08fr) minmax(430px, .92fr) !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 22px !important;
    background: #242424 !important;
    box-shadow: 0 30px 86px rgba(0, 0, 0, .34) !important;
}

body.wilo-template-login .zos-login-v102__story,
body.wilo-template-login .zos-login-v102__access {
    min-width: 0;
}

body.wilo-template-login .zos-login-v102__story {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: 52px 50px 38px;
    flex-direction: column;
    justify-content: space-between;
    color: #f7f4fa;
    border-right: 1px solid rgba(255, 255, 255, .10);
    background:
        radial-gradient(circle at 82% 15%, rgba(138, 44, 246, .34), transparent 31%),
        linear-gradient(145deg, #242424 0%, #191919 100%);
}

body.wilo-template-login .zos-login-v102__story::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 40px 40px;
    content: "";
    mask-image: linear-gradient(135deg, #000, transparent 78%);
    -webkit-mask-image: linear-gradient(135deg, #000, transparent 78%);
}

body.wilo-template-login .zos-login-v102__story-top,
body.wilo-template-login .zos-login-v102__secure {
    position: relative;
    z-index: 1;
}

body.wilo-template-login .zos-login-v102__brand {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    margin-bottom: 54px;
    align-items: center;
    gap: 14px;
    color: #fff !important;
}

body.wilo-template-login .zos-login-v102__brand img {
    display: block;
    width: 205px;
    max-width: 70%;
    height: auto;
}

body.wilo-template-login .zos-login-v102__brand span {
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,.16);
    color: #aaa6b2;
    font-size: 11px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

body.wilo-template-login .zos-login-v102__eyebrow {
    display: inline-flex;
    margin-bottom: 15px;
    align-items: center;
    gap: 8px;
    color: #c7c2cd;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.wilo-template-login .zos-login-v102__eyebrow i {
    color: #8a2cf6;
    font-size: 7px;
}

body.wilo-template-login .zos-login-v102__story h1 {
    max-width: 500px;
    margin: 0;
    color: #fff !important;
    font-size: clamp(34px, 3vw, 48px) !important;
    line-height: 1.06;
    letter-spacing: -.055em;
}

body.wilo-template-login .zos-login-v102__story p {
    max-width: 520px;
    margin: 20px 0 0;
    color: #b7b2be;
    font-size: 14px;
    line-height: 1.65;
}

body.wilo-template-login .zos-login-v102__benefits {
    display: grid;
    margin: 32px 0 0;
    padding: 0;
    gap: 14px;
    list-style: none;
}

body.wilo-template-login .zos-login-v102__benefits li {
    display: grid;
    grid-template-columns: 30px minmax(0,1fr);
    align-items: center;
    gap: 11px;
    color: #e4e0e8;
    font-size: 13px;
    line-height: 1.4;
}

body.wilo-template-login .zos-login-v102__benefits i {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #b76fff;
    background: rgba(138,44,246,.14);
}

body.wilo-template-login .zos-login-v102__secure {
    display: flex;
    margin-top: 42px;
    align-items: center;
    gap: 9px;
    color: #87818d;
    font-size: 11px;
}

body.wilo-template-login .zos-login-v102__secure i {
    color: #8a2cf6;
}

body.wilo-template-login .zos-login-v102__access {
    display: flex;
    padding: 54px 52px;
    align-items: center;
    background: #262626;
}

body.wilo-template-login .zos-login-v102__access-inner {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
}

body.wilo-template-login .zos-login-v102__heading {
    display: grid;
    margin-bottom: 32px;
    grid-template-columns: 48px minmax(0,1fr);
    align-items: center;
    gap: 14px;
}

body.wilo-template-login .zos-login-v102__heading-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #a854ff;
    background: rgba(138,44,246,.14);
    font-size: 15px;
}

body.wilo-template-login .zos-login-v102__heading-kicker {
    display: block;
    margin-bottom: 4px;
    color: #8b8591;
    font-size: 9px;
    letter-spacing: .1em;
}

body.wilo-template-login .zos-login-v102__heading h2 {
    margin: 0 !important;
    color: #f7f5fa !important;
    font-size: 27px !important;
    line-height: 1.15;
}

body.wilo-template-login .zos-login-v102__heading p {
    margin: 6px 0 0 !important;
    color: #aaa6b2 !important;
    font-size: 12px;
    line-height: 1.4;
}

body.wilo-template-login .zos-login-v102__form .form-group {
    margin-bottom: 20px;
}

body.wilo-template-login .zos-login-v102__form label,
body.wilo-template-login .zos-login-v102__password-label label {
    margin: 0 0 8px;
    color: #e9e5ed;
    font-size: 12px;
}

body.wilo-template-login .zos-login-v102__password-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.wilo-template-login .zos-login-v102__password-label a {
    margin-bottom: 8px;
    font-size: 11px;
    white-space: nowrap;
}

body.wilo-template-login .zos-login-v102__field {
    position: relative;
    display: flex;
    min-height: 52px;
    align-items: center;
}

body.wilo-template-login .zos-login-v102__field > i {
    position: absolute;
    z-index: 2;
    left: 16px;
    width: 18px;
    color: #817b87;
    text-align: center;
}

body.wilo-template-login .zos-login-v102__field .form-control {
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 12px 15px 12px 46px !important;
    border: 1px solid rgba(255,255,255,.11) !important;
    border-radius: 10px !important;
    color: #f5f3f8 !important;
    background: #202020 !important;
    box-shadow: none !important;
    font-size: 13px;
}

body.wilo-template-login .zos-login-v102__field:focus-within > i {
    color: #a854ff;
}

body.wilo-template-login .zos-login-v102__field .form-control:focus {
    border-color: rgba(168,84,255,.72) !important;
    box-shadow: 0 0 0 3px rgba(138,44,246,.12) !important;
}

body.wilo-template-login .zos-login-v102__remember {
    display: inline-flex;
    margin: 0 0 20px;
    align-items: center;
    gap: 8px;
    color: #aaa6b2;
    font-size: 11px;
    cursor: pointer;
}

body.wilo-template-login .zos-login-v102__remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #8a2cf6;
}

body.wilo-template-login .zos-login-v102__submit {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 52px;
    padding: 0 20px !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #8a2cf6 !important;
    border-radius: 10px !important;
    color: #fff !important;
    background: #8a2cf6 !important;
    box-shadow: 0 12px 28px rgba(138,44,246,.22);
    font-size: 12px;
}

body.wilo-template-login .zos-login-v102__submit:hover,
body.wilo-template-login .zos-login-v102__submit:focus {
    border-color: #9f4cff !important;
    background: #9f4cff !important;
}

body.wilo-template-login .zos-login-v102__divider {
    display: flex;
    margin: 24px 0 18px;
    align-items: center;
    gap: 12px;
    color: #7f7985;
    font-size: 10px;
    text-align: center;
}

body.wilo-template-login .zos-login-v102__divider::before,
body.wilo-template-login .zos-login-v102__divider::after {
    height: 1px;
    flex: 1;
    background: rgba(255,255,255,.09);
    content: "";
}

body.wilo-template-login .zos-login-v102__bottom {
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid rgba(255,255,255,.09);
    text-align: center;
}

body.wilo-template-login .zos-login-v102__bottom p {
    margin: 0;
    color: #918b97;
    font-size: 11px;
    line-height: 1.5;
}

body.wilo-template-login .zos-login-v102__bottom .zos-login-v102__support {
    margin-top: 8px;
}

body.wilo-template-login .zos-login-v102__bottom i {
    margin-right: 4px;
    color: #8a2cf6;
}

/* -------------------------------------------------------------------------
   4. PUBLIC FOOTER: REAL COLUMNS, NO GLUED OR CUT TEXT
   ------------------------------------------------------------------------- */
body.wilo-guest footer.zos-footer-v102 {
    display: block !important;
    width: 100%;
    margin: 0 !important;
    padding: 42px 32px 24px !important;
    border-top: 1px solid rgba(255,255,255,.09) !important;
    color: #a9a4ae;
    background: #181818 !important;
}

body.wilo-guest footer.zos-footer-v102 .wilo-site-footer-inner {
    width: 100% !important;
    max-width: 1360px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-grid {
    display: grid !important;
    width: 100%;
    grid-template-columns: minmax(280px, 1.3fr) repeat(3, minmax(150px, .7fr));
    align-items: start;
    gap: 34px 42px;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-brand,
body.wilo-guest footer.zos-footer-v102 .wilo-footer-column {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-logo {
    display: inline-block;
    width: auto;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-logo img {
    display: block;
    width: 190px !important;
    max-width: 100% !important;
    height: auto !important;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-brand p,
body.wilo-guest footer.zos-footer-v102 .wilo-footer-brand address {
    display: block;
    max-width: 390px;
    margin: 14px 0 0 !important;
    color: #918c98 !important;
    font-size: 12px !important;
    font-style: normal;
    line-height: 1.7 !important;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-brand address a {
    display: inline !important;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-column h3 {
    margin: 2px 0 14px !important;
    color: #f4f1f6 !important;
    font-size: 13px !important;
    line-height: 1.3;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-column > a {
    display: block !important;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 9px !important;
    color: #918c98 !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
    white-space: normal;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-column > a:hover,
body.wilo-guest footer.zos-footer-v102 .wilo-footer-column > a:focus {
    color: #c996ff !important;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-bottom {
    display: flex !important;
    width: 100%;
    margin: 32px 0 0 !important;
    padding: 18px 0 0 !important;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #76717b !important;
    font-size: 10px !important;
    text-align: left;
}

body.wilo-guest footer.zos-footer-v102 .wilo-footer-bottom p,
body.wilo-guest footer.zos-footer-v102 .wilo-footer-bottom nav {
    margin: 0 !important;
}

/* -------------------------------------------------------------------------
   5. RESPONSIVE SAFETY
   ------------------------------------------------------------------------- */
@media (max-width: 991px) {
    body.wilo-authenticated .wilo-content-container > .row.wilo-has-context-menu {
        display: grid !important;
        grid-template-columns: minmax(0,1fr) !important;
        grid-template-areas:
            "heading"
            "main"
            "menu" !important;
    }

    body.wilo-authenticated .wilo-has-context-menu > .wilo-page-heading { grid-area: heading !important; }
    body.wilo-authenticated .wilo-has-context-menu > .main-content { grid-area: main !important; }
    body.wilo-authenticated .wilo-has-context-menu > .wilo-context-menu {
        width: 100% !important;
        margin: 20px 0 0 !important;
        grid-area: menu !important;
    }

    body.wilo-template-login .logincontainer.zos-login-v102 {
        width: min(760px, 100%) !important;
        grid-template-columns: minmax(0,1fr) !important;
    }

    body.wilo-template-login .zos-login-v102__story {
        min-height: 360px;
        padding: 38px 38px 32px;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.10);
    }

    body.wilo-template-login .zos-login-v102__brand {
        margin-bottom: 34px;
    }

    body.wilo-template-login .zos-login-v102__access {
        padding: 42px 38px;
    }

    body.wilo-guest footer.zos-footer-v102 .wilo-footer-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    body.wilo-guest footer.zos-footer-v102 .wilo-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    body.wilo-authenticated section#main-body.wilo-main-body,
    body.wilo-authenticated .wilo-shopping-cart {
        padding: 16px 13px 24px !important;
    }

    body.wilo-template-login section#main-body.wilo-main-body {
        padding: 24px 13px 34px !important;
    }

    body.wilo-template-login .logincontainer.zos-login-v102 {
        min-height: 0;
        border-radius: 16px !important;
    }

    body.wilo-template-login .zos-login-v102__story {
        min-height: 0;
        padding: 28px 22px 26px;
    }

    body.wilo-template-login .zos-login-v102__brand {
        margin-bottom: 28px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    body.wilo-template-login .zos-login-v102__brand img {
        width: 175px;
        max-width: 100%;
    }

    body.wilo-template-login .zos-login-v102__brand span {
        padding-left: 0;
        border-left: 0;
    }

    body.wilo-template-login .zos-login-v102__story h1 {
        font-size: 31px !important;
    }

    body.wilo-template-login .zos-login-v102__benefits {
        margin-top: 25px;
    }

    body.wilo-template-login .zos-login-v102__secure {
        margin-top: 28px;
    }

    body.wilo-template-login .zos-login-v102__access {
        padding: 30px 22px 28px;
    }

    body.wilo-template-login .zos-login-v102__heading {
        margin-bottom: 26px;
        grid-template-columns: 42px minmax(0,1fr);
    }

    body.wilo-template-login .zos-login-v102__heading-icon {
        width: 42px;
        height: 42px;
    }

    body.wilo-template-login .zos-login-v102__heading h2 {
        font-size: 23px !important;
    }

    body.wilo-template-login .zos-login-v102__password-label {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    body.wilo-template-login .zos-login-v102__password-label a {
        margin: -2px 0 8px;
    }

    body.wilo-guest footer.zos-footer-v102 {
        padding: 34px 18px 22px !important;
    }

    body.wilo-guest footer.zos-footer-v102 .wilo-footer-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    body.wilo-guest footer.zos-footer-v102 .wilo-footer-brand {
        grid-column: auto;
    }

    body.wilo-guest footer.zos-footer-v102 .wilo-footer-column {
        padding-top: 18px !important;
        border-top: 1px solid rgba(255,255,255,.08);
    }

    body.wilo-guest footer.zos-footer-v102 .wilo-footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}
