/* Home "Funcționalități și module integrate": compact tile grid + details panel (<dialog>). */
.site-modern .home-modules {
    clear: both;
    display: flow-root;
    padding: 80px 24px;
    background: #fff;
}
.site-modern .home-modules__inner { max-width: 1160px; margin: 0 auto; }

.site-modern .home-modules__header { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.site-modern .home-modules__eyebrow {
    margin: 0 0 10px;
    color: var(--site-blue);
    font-family: var(--site-font-body);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.site-modern .home-modules__header h2 {
    float: none;
    width: auto;
    margin: 0;
    color: var(--site-ink);
    font-size: clamp(26px, 2.6vw, 36px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.02em;
    text-align: center;
}
.site-modern .home-modules__header h2 span { color: var(--site-blue); }
.site-modern .home-modules__lead {
    margin: 12px 0 0;
    color: var(--site-muted);
    font-family: var(--site-font-body);
    font-size: 16px;
    line-height: 1.6;
}

/* Grid of tiles */
.site-modern .home-modules__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-modern .home-module__tile {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    height: 100%;
    padding: 18px 20px;
    border: 1px solid var(--site-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(31, 59, 99, .04);
    color: var(--site-ink);
    font: 600 17px/1.35 var(--site-font-body);
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
@media (hover: hover) {
    .site-modern .home-module__tile:hover {
        transform: translateY(-3px);
        border-color: #c1d5f6;
        box-shadow: 0 12px 26px rgba(31, 59, 99, .1);
    }
    .site-modern .home-module__tile:hover .home-module__name { color: var(--site-blue); }
}
.site-modern .home-module__tile:focus-visible { outline: 3px solid var(--site-blue); outline-offset: 3px; }
/* White icon on a blue tile (the PNGs are white glyphs on transparent). */
.site-modern .home-module__icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: linear-gradient(180deg, #2c6de5 0%, #2165e8 48%, #1d57c8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px rgba(33, 101, 232, .2);
}
.site-modern .home-module__icon img { display: block; width: 26px; height: 26px; object-fit: contain; }
/* Larger icon on the tiles (3 per row on desktop); the dialog header keeps the 48px one. */
.site-modern .home-module__tile .home-module__icon { flex-basis: 68px; width: 68px; height: 68px; border-radius: 18px; }
.site-modern .home-module__tile .home-module__icon img { width: 38px; height: 38px; }
.site-modern .home-module__name { flex: 1 1 auto; min-width: 0; transition: color .2s ease; }
/* Double chevron = "opens details"; same mark as the integrations cards. */
.site-modern .home-module__arrow {
    flex: 0 0 auto;
    margin-left: auto;
    color: #9db7e6;
    line-height: 0;
    transition: color .2s ease, transform .25s ease;
}
.site-modern .home-module__arrow svg { display: block; }
@media (hover: hover) {
    .site-modern .home-module__tile:hover .home-module__arrow { color: var(--site-blue); transform: translateX(3px); }
}

/* Without JS every description stays visible under its tile; with JS they live in the panel. */
.site-modern .home-module__content { margin-top: 10px; padding: 0 4px; }
.site-modern .home-modules.is-enhanced .home-module__content { display: none; }
.site-modern .home-module__content-title { display: none; }

/* Details window: centred panel and a uniform, inexpensive backdrop. */
.site-modern .home-modules__panel {
    position: fixed;
    inset: 0;
    width: min(640px, calc(100% - 32px));
    max-width: none;
    height: fit-content;
    max-height: min(80vh, 720px);
    max-height: min(80dvh, 720px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #fff;
    color: var(--site-ink);
    box-shadow: 0 30px 80px rgba(23, 38, 61, .28);
    overflow: hidden;
}
.site-modern .home-modules__panel[open] { display: flex; flex-direction: column; }
.site-modern .home-modules__panel::backdrop {
    background: rgba(23, 38, 61, .35);
}
.site-modern .home-modules__panel-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 72px 20px 24px; /* right padding keeps the title clear of the X */
    border-bottom: 1px solid var(--site-line);
}
.site-modern .home-modules__panel-head h3 {
    flex: 1 1 auto;
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    border-left: 0;
    color: var(--site-ink);
    font-family: var(--site-font-heading);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
}
.site-modern .home-modules__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--site-line);
    border-radius: 50%;
    background: #fff;
    color: var(--site-ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}
.site-modern .home-modules__close:hover { background: #f1f6ff; border-color: #c1d5f6; }
.site-modern .home-modules__close:focus-visible { outline: 3px solid var(--site-blue); outline-offset: 2px; }
.site-modern .home-modules__panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 22px 24px 28px;
    overscroll-behavior: contain;
}

/* Description text (panel + no-JS fallback); neutralizes legacy global p / .text_ingrosat rules. */
.site-modern :is(.home-modules__panel-body, .home-module__content) p {
    margin: 0 0 14px;
    color: #3f4d61;
    font-family: var(--site-font-body);
    font-size: 16px;
    line-height: 1.7;
}
.site-modern :is(.home-modules__panel-body, .home-module__content) p:first-of-type { color: var(--site-ink); }
.site-modern :is(.home-modules__panel-body, .home-module__content) .text_ingrosat {
    float: none;
    width: auto;
    color: inherit;
    font-weight: 600;
}


@media (max-width: 1000px) {
    .site-modern .home-module__tile { gap: 14px; padding: 16px; font-size: 16px; }
    .site-modern .home-module__tile .home-module__icon { flex-basis: 56px; width: 56px; height: 56px; border-radius: 15px; }
    .site-modern .home-module__tile .home-module__icon img { width: 31px; height: 31px; }
}
@media (max-width: 760px) {
    .site-modern .home-modules { padding: 56px 16px; }
    .site-modern .home-modules__header { margin-bottom: 28px; }
    .site-modern .home-modules__eyebrow { font-size: 12px; }
    .site-modern .home-modules__header h2 { font-size: clamp(22px, 6vw, 28px); }
    .site-modern .home-modules__lead { font-size: 15px; }
    .site-modern .home-modules__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .site-modern .home-module__tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; font-size: 14px; }
    .site-modern .home-module__tile .home-module__icon { flex-basis: 48px; width: 48px; height: 48px; border-radius: 13px; }
    .site-modern .home-module__tile .home-module__icon img { width: 26px; height: 26px; }
    .site-modern .home-module__tile { position: relative; padding-right: 34px; }
    .site-modern .home-module__arrow { position: absolute; right: 10px; bottom: 12px; }
    .site-modern .home-module__arrow svg { width: 16px; height: 16px; }
    /* Window stays centred on mobile too, just with tighter spacing. */
    .site-modern .home-modules__panel { width: calc(100% - 24px); max-height: 82vh; border-radius: 18px; }
    .site-modern .home-modules__panel-head { padding: 18px 62px 16px 18px; }
    .site-modern .home-modules__close { top: 12px; right: 12px; width: 38px; height: 38px; flex-basis: 38px; }
    .site-modern .home-modules__panel-head h3 { font-size: 18px; }
    .site-modern .home-modules__panel-body { padding: 18px 18px 22px; }
    .site-modern :is(.home-modules__panel-body, .home-module__content) p { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .site-modern .home-module__tile { transition: none; }
    .site-modern .home-module__tile:hover { transform: none; }
}
