/*
 * Modern WHMCS home services section
 * Desktop layout: left intro panel + 3 columns x 2 rows.
 * No JavaScript required.
 */

.whmcs-services-modern {
    --hs-bg: #f7f9fc;
    --hs-panel: rgba(255, 255, 255, 0.88);
    --hs-card: rgba(255, 255, 255, 0.92);
    --hs-text: #0b1c33;
    --hs-muted: #64748b;
    --hs-border: rgba(15, 23, 42, 0.10);
    --hs-accent: #08b7a6;
    --hs-accent-strong: #009f91;
    --hs-glow: rgba(8, 183, 166, 0.18);
    --hs-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(42px, 5vw, 76px) 0;
    color: var(--hs-text);
    background:
        radial-gradient(circle at 84% 8%, rgba(59, 130, 246, 0.10), transparent 28%),
        radial-gradient(circle at 10% 90%, rgba(8, 183, 166, 0.08), transparent 28%),
        var(--hs-bg);
}

/* Explicit dark-mode selectors commonly used by custom WHMCS themes / Bootstrap. */
html[data-snetti-theme="dark"] .whmcs-services-modern,
html[data-theme="dark"] .whmcs-services-modern,
html[data-bs-theme="dark"] .whmcs-services-modern,
html.dark .whmcs-services-modern,
body.dark .whmcs-services-modern,
body.dark-mode .whmcs-services-modern,
body.theme-dark .whmcs-services-modern {
    --hs-bg: #06111d;
    --hs-panel: rgba(7, 21, 35, 0.88);
    --hs-card: rgba(8, 24, 39, 0.88);
    --hs-text: #f7fbff;
    --hs-muted: #a7b5c7;
    --hs-border: rgba(127, 155, 181, 0.22);
    --hs-accent: #20d9c4;
    --hs-accent-strong: #31ead5;
    --hs-glow: rgba(32, 217, 196, 0.22);
    --hs-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
    background:
        radial-gradient(circle at 82% 4%, rgba(0, 206, 190, 0.10), transparent 30%),
        radial-gradient(circle at 15% 95%, rgba(0, 126, 255, 0.08), transparent 28%),
        #06111d;
}

/* System fallback when the site itself does not expose an explicit theme marker. */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-bs-theme="light"]):not([data-snetti-theme="light"]):not(.light):not(.theme-light) .whmcs-services-modern {
        --hs-bg: #06111d;
        --hs-panel: rgba(7, 21, 35, 0.88);
        --hs-card: rgba(8, 24, 39, 0.88);
        --hs-text: #f7fbff;
        --hs-muted: #a7b5c7;
        --hs-border: rgba(127, 155, 181, 0.22);
        --hs-accent: #20d9c4;
        --hs-accent-strong: #31ead5;
        --hs-glow: rgba(32, 217, 196, 0.22);
        --hs-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
        background:
            radial-gradient(circle at 82% 4%, rgba(0, 206, 190, 0.10), transparent 30%),
            radial-gradient(circle at 15% 95%, rgba(0, 126, 255, 0.08), transparent 28%),
            #06111d;
    }
}

.whmcs-services-modern::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.45;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(127, 155, 181, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 155, 181, 0.025) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.whmcs-services-modern__container {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Match the .snetti-container side padding so the band equals the hero and offer sections. */
@media (min-width: 768px) {
    .whmcs-services-modern__container {
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .whmcs-services-modern__container {
        padding-right: 2rem;
        padding-left: 2rem;
    }
}

.whmcs-services-modern__layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 2.78fr);
    gap: clamp(18px, 2vw, 30px);
    align-items: stretch;
}

.whmcs-services-modern__intro {
    position: relative;
    min-height: 610px;
    display: flex;
    flex-direction: column;
    padding: clamp(8px, 1vw, 16px) clamp(4px, 1vw, 14px);
}

.whmcs-services-modern__eyebrow {
    margin: 0 0 14px;
    color: var(--hs-accent);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.whmcs-services-modern__title {
    max-width: 560px;
    margin: 0;
    color: var(--hs-text);
    font-size: clamp(2.2rem, 3.1vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
    font-weight: 800;
}

.whmcs-services-modern__rule {
    width: 42px;
    height: 3px;
    margin: 25px 0 22px;
    border-radius: 999px;
    background: var(--hs-accent);
    box-shadow: 0 0 18px var(--hs-glow);
}

.whmcs-services-modern__intro-copy {
    max-width: 390px;
    margin: 0;
    color: var(--hs-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.whmcs-services-modern__intro-art {
    position: relative;
    margin-top: auto;
    min-height: 230px;
    display: flex;
    align-items: flex-end;
}

.whmcs-services-modern__intro-art::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 4%;
    bottom: 12%;
    height: 36%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, var(--hs-glow), transparent 68%);
    filter: blur(22px);
    pointer-events: none;
}

.whmcs-services-modern__intro-art img {
    width: min(100%, 410px);
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 24px 26px rgba(0, 0, 0, 0.18));
}

.whmcs-services-modern__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 1.4vw, 20px);
}

.whmcs-services-modern__card {
    position: relative;
    min-width: 0;
    min-height: 292px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--hs-border);
    border-radius: 18px;
    padding: 16px 17px 15px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.035), transparent 40%),
        var(--hs-card);
    box-shadow: var(--hs-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.whmcs-services-modern__card::after {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    opacity: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px var(--hs-accent), 0 0 36px var(--hs-glow);
    transition: opacity 220ms ease;
}

.whmcs-services-modern__card:hover,
.whmcs-services-modern__card:focus-within {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--hs-accent) 55%, var(--hs-border));
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
}

.whmcs-services-modern__card:hover::after,
.whmcs-services-modern__card:focus-within::after {
    opacity: 0.55;
}

.whmcs-services-modern__visual {
    height: 122px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -2px 0 7px;
    overflow: hidden;
    border-radius: 14px;
}

.whmcs-services-modern__visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 260ms ease, filter 260ms ease;
}

.whmcs-services-modern__card:hover .whmcs-services-modern__visual img {
    transform: translateY(-3px) scale(1.025);
    filter: saturate(1.08);
}

.whmcs-services-modern__card h3 {
    margin: 0 0 7px;
    color: var(--hs-text);
    font-size: clamp(1.03rem, 1.15vw, 1.24rem);
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -0.015em;
}

.whmcs-services-modern__card p {
    margin: 0 0 14px;
    color: var(--hs-muted);
    font-size: 0.89rem;
    line-height: 1.48;
}

.whmcs-services-modern__cta {
    width: fit-content;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hs-accent-strong);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.whmcs-services-modern__cta::after {
    content: "→";
    font-size: 1.18em;
    line-height: 1;
    transition: transform 180ms ease;
}

.whmcs-services-modern__cta:hover,
.whmcs-services-modern__cta:focus {
    color: var(--hs-accent);
    text-decoration: none;
}

.whmcs-services-modern__cta:hover::after,
.whmcs-services-modern__cta:focus::after {
    transform: translateX(4px);
}

/* Theme-specific exact crops from the accepted concept. */
.whmcs-services-modern .hs-art--dark { display: none; }
.whmcs-services-modern .hs-art--light { display: block; }

html[data-snetti-theme="dark"] .whmcs-services-modern .hs-art--dark,
html[data-theme="dark"] .whmcs-services-modern .hs-art--dark,
html[data-bs-theme="dark"] .whmcs-services-modern .hs-art--dark,
html.dark .whmcs-services-modern .hs-art--dark,
body.dark .whmcs-services-modern .hs-art--dark,
body.dark-mode .whmcs-services-modern .hs-art--dark,
body.theme-dark .whmcs-services-modern .hs-art--dark { display: block; }

html[data-snetti-theme="dark"] .whmcs-services-modern .hs-art--light,
html[data-theme="dark"] .whmcs-services-modern .hs-art--light,
html[data-bs-theme="dark"] .whmcs-services-modern .hs-art--light,
html.dark .whmcs-services-modern .hs-art--light,
body.dark .whmcs-services-modern .hs-art--light,
body.dark-mode .whmcs-services-modern .hs-art--light,
body.theme-dark .whmcs-services-modern .hs-art--light { display: none; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-bs-theme="light"]):not([data-snetti-theme="light"]):not(.light):not(.theme-light) .whmcs-services-modern .hs-art--dark { display: block; }
    html:not([data-theme="light"]):not([data-bs-theme="light"]):not([data-snetti-theme="light"]):not(.light):not(.theme-light) .whmcs-services-modern .hs-art--light { display: none; }
}

/* Keep 3 x 2 on normal desktop. Collapse only when there is genuinely not enough room. */
@media (max-width: 1180px) {
    .whmcs-services-modern__layout {
        grid-template-columns: minmax(240px, 0.72fr) minmax(0, 2.4fr);
    }
    .whmcs-services-modern__card {
        padding-inline: 14px;
    }
}

@media (max-width: 980px) {
    .whmcs-services-modern__layout {
        grid-template-columns: 1fr;
    }
    .whmcs-services-modern__intro {
        min-height: auto;
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
        grid-template-areas:
            "eyebrow art"
            "title art"
            "rule art"
            "copy art";
        column-gap: 24px;
        align-items: start;
    }
    .whmcs-services-modern__eyebrow { grid-area: eyebrow; }
    .whmcs-services-modern__title { grid-area: title; }
    .whmcs-services-modern__rule { grid-area: rule; }
    .whmcs-services-modern__intro-copy { grid-area: copy; }
    .whmcs-services-modern__intro-art { grid-area: art; min-height: 0; align-self: center; }
    .whmcs-services-modern__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
}

@media (max-width: 680px) {
    .whmcs-services-modern { padding: 34px 0; }
    .whmcs-services-modern__container { width: 100%; }
    .whmcs-services-modern__intro {
        display: flex;
        padding-inline: 4px;
    }
    .whmcs-services-modern__intro-art { min-height: 190px; margin-top: 12px; }
    .whmcs-services-modern__grid { grid-template-columns: 1fr; }
    .whmcs-services-modern__card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .whmcs-services-modern__card,
    .whmcs-services-modern__card::after,
    .whmcs-services-modern__visual img,
    .whmcs-services-modern__cta::after {
        transition: none !important;
    }
    .whmcs-services-modern__card:hover,
    .whmcs-services-modern__card:focus-within,
    .whmcs-services-modern__card:hover .whmcs-services-modern__visual img {
        transform: none;
    }
}
