/* ===============================
   C.E.S.I - Dettaglio corso
   =============================== */

.cesi-corso-page,
.cesi-corso-page * { box-sizing: border-box; }

.cesi-corso-page {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #111;
    padding: 40px 20px 80px;
    min-height: calc(100vh - 200px);
}

.cesi-corso {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ---------- BACK ---------- */
.cesi-corso__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1a8fcc;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    align-self: flex-start;
    transition: gap .2s ease;
}

.cesi-corso__back:hover { gap: 12px; }

/* ---------- TITOLO + CONDIVIDI ---------- */
.cesi-corso__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cesi-corso__title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    color: #000000;
    line-height: 1.15;
    letter-spacing: -.3px;
    flex: 1;
    min-width: 0;
}

.cesi-corso__share {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: #f4f6f8;
    color: #0d0d0d;
    border: 1px solid #e3e6ea;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
    flex-shrink: 0;
}

.cesi-corso__share i {
    color: #3ab2f3;
    font-size: 1rem;
}

.cesi-corso__share:hover,
.cesi-corso__share:focus-visible {
    background: #eaf6fd;
    border-color: #3ab2f3;
    color: #0d6fa3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 178, 243, .18);
    outline: none;
}

/* =========================================================
   BLOCCO UNICO
   ========================================================= */
/* =========================================================
   BLOCCO UNICO (con ombra per risaltare)
   ========================================================= */
.cesi-corso__box {
    border: 1px solid #e3e6ea;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .04),
        0 4px 12px rgba(0, 0, 0, .06),
        0 12px 32px rgba(58, 178, 243, .08);
    transition: box-shadow .25s ease, transform .25s ease;
}

.cesi-corso__box:hover {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .05),
        0 6px 18px rgba(0, 0, 0, .08),
        0 16px 40px rgba(58, 178, 243, .12);
}

/* ---------- META ROW ---------- */
.cesi-corso__meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    border-bottom: 1px solid #e3e6ea;
    background: #ffffff;
}

.cesi-corso__meta-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    border-right: 1px solid #e3e6ea;
    min-width: 0;
    transition: background .2s ease, box-shadow .2s ease;
}

.cesi-corso__meta-item:last-child {
    border-right: none;
}

.cesi-corso__meta-item:hover {
    background: #f7fbfd;
    box-shadow: inset 0 -3px 0 #3ab2f3;
}

.cesi-corso__meta-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(58, 178, 243, .12);
    color: #3ab2f3;
    font-size: 1.15rem;
}

.cesi-corso__meta-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cesi-corso__meta-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6c7684;
    font-weight: 600;
}

.cesi-corso__meta-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: -.2px;
}

/* =========================================================
   INFO ROW (3 colonne): fornitore, validità, gruppo
   SOTTILE, sfondo colorato, hover leggero
   ========================================================= */
.cesi-corso__info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #e3e6ea;
    background: #ffffff;
}

.cesi-corso__info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    min-width: 0;
    border-right: 1px solid rgba(0, 0, 0, .05);
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
    cursor: default;
}

.cesi-corso__info-item:last-child {
    border-right: none;
}

.cesi-corso__info-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, .06);
    transform: translateY(-1px);
    z-index: 2;
    position: relative;
}

.cesi-corso__info-ico {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, .06);
    color: inherit;
}

.cesi-corso__info-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: .75;
    white-space: nowrap;
}

.cesi-corso__info-value {
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: -.1px;
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* --- Varianti colore (sfondo tenue + testo colorato) --- */

/* Fornitore — giallo/ambra */
.cesi-corso__info-item.is-fornitore {
    background: #fff8e1;
    color: #8a6300;
}
.cesi-corso__info-item.is-fornitore:hover {
    background: #fff3c4;
    box-shadow: 0 4px 10px rgba(245, 165, 36, .18);
}
.cesi-corso__info-item.is-fornitore .cesi-corso__info-ico {
    background: rgba(245, 165, 36, .22);
    color: #b87400;
}

/* Validità — verde */
.cesi-corso__info-item.is-validita {
    background: #eafaf0;
    color: #1a7a3e;
}
.cesi-corso__info-item.is-validita:hover {
    background: #d6f5e1;
    box-shadow: 0 4px 10px rgba(34, 163, 85, .18);
}
.cesi-corso__info-item.is-validita .cesi-corso__info-ico {
    background: rgba(34, 163, 85, .18);
    color: #1a7a3e;
}

/* Gruppo A — rosso */
.cesi-corso__info-item.is-gruppo-a {
    background: #fdeaea;
    color: #a11f1f;
}
.cesi-corso__info-item.is-gruppo-a:hover {
    background: #fbd5d5;
    box-shadow: 0 4px 10px rgba(230, 57, 70, .18);
}
.cesi-corso__info-item.is-gruppo-a .cesi-corso__info-ico {
    background: rgba(230, 57, 70, .18);
    color: #a11f1f;
}

/* Gruppo B — arancio */
.cesi-corso__info-item.is-gruppo-b {
    background: #fff4e0;
    color: #b87400;
}
.cesi-corso__info-item.is-gruppo-b:hover {
    background: #ffe9c2;
    box-shadow: 0 4px 10px rgba(245, 165, 36, .18);
}
.cesi-corso__info-item.is-gruppo-b .cesi-corso__info-ico {
    background: rgba(245, 165, 36, .22);
    color: #b87400;
}

/* Gruppo C — verde */
.cesi-corso__info-item.is-gruppo-c {
    background: #eafaf0;
    color: #1a7a3e;
}
.cesi-corso__info-item.is-gruppo-c:hover {
    background: #d6f5e1;
    box-shadow: 0 4px 10px rgba(34, 163, 85, .18);
}
.cesi-corso__info-item.is-gruppo-c .cesi-corso__info-ico {
    background: rgba(34, 163, 85, .18);
    color: #1a7a3e;
}

/* =========================================================
   BODY: 2 colonne
   ========================================================= */
.cesi-corso__body {
    display: grid;
    grid-template-columns: 380px 1fr;
    align-items: stretch;
}

/* ---------- COLONNA SINISTRA ---------- */
.cesi-corso__col-left {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e3e6ea;
}

.cesi-corso__poster {
    background: #eef2f6;
    overflow: hidden;
}

.cesi-corso__poster img {
    width: 100%;
    height: auto;
    display: block;
}

.cesi-corso__poster-noimg {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c4cf;
    font-size: 2.5rem;
    background: #eef2f6;
}

/* ---------- DESCRIZIONE ---------- */
.cesi-corso__desc-box {
    padding: 18px 16px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.cesi-corso__desc-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: #c8ced4 #f4f6f8;
}

.cesi-corso__desc-scroll::-webkit-scrollbar { width: 8px; }
.cesi-corso__desc-scroll::-webkit-scrollbar-track { background: #f4f6f8; }
.cesi-corso__desc-scroll::-webkit-scrollbar-thumb {
    background: #c8ced4;
    border-radius: 4px;
}
.cesi-corso__desc-scroll::-webkit-scrollbar-thumb:hover { background: #3ab2f3; }

.cesi-corso__desc {
    font-size: 1rem;
    line-height: 1.65;
    color: #2a2f37;
    white-space: pre-line;
    margin: 0;
    padding: 0;
    text-align: left;
    text-indent: 0;
}

/* ---------- COLONNA DESTRA ---------- */
.cesi-corso__col-right {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.cesi-corso__section-title {
    margin: 0 0 14px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cesi-corso__section-title i { color: #3ab2f3; }

.cesi-corso__dove-box {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cesi-corso__dove-head {
    padding: 22px 26px 0;
}

.cesi-corso__dove-body {
    padding: 0 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cesi-corso__map {
    width: 100%;
    height: 280px;
    border: 1px solid #e3e6ea;
}

.cesi-corso__address {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    background: #f4f6f8;
    border: 1px solid #e3e6ea;
    color: #1a8fcc;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .3px;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
    word-break: break-word;
}

.cesi-corso__address i {
    color: #3ab2f3;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.cesi-corso__address:hover,
.cesi-corso__address:focus-visible {
    background: #eaf6fd;
    border-color: #3ab2f3;
    color: #0d6fa3;
    box-shadow: 0 4px 12px rgba(58, 178, 243, .15);
    outline: none;
}

/* ---------- BOTTONE REGISTRATI ---------- */
.cesi-corso__register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    background: #3ab2f3;
    color: #ffffff;
    border: none;
    border-top: 1px solid #e3e6ea;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s ease, box-shadow .18s ease;
    margin-top: auto;
}

.cesi-corso__register:hover,
.cesi-corso__register:focus-visible {
    background: #1a8fcc;
    box-shadow: 0 6px 16px rgba(58, 178, 243, .3);
    outline: none;
}

.cesi-corso__register--login {
    background: #0d0d0d;
}

.cesi-corso__register--login:hover {
    background: #1a8fcc;
}

/* ---------- BOTTONE GENERICO (404) ---------- */
.cesi-corso-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    background: #0d0d0d;
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s ease;
}

.cesi-corso-btn:hover,
.cesi-corso-btn:focus-visible {
    background: #3ab2f3;
    outline: none;
}

/* ---------- 404 ---------- */
.cesi-corso-404 {
    max-width: 520px;
    margin: 80px auto;
    text-align: center;
    padding: 40px 24px;
}

.cesi-corso-404 i {
    font-size: 3rem;
    color: #e63946;
    margin-bottom: 14px;
    display: block;
}

.cesi-corso-404 h1 {
    margin: 0 0 10px;
    color: #000000;
    font-size: 1.5rem;
}

.cesi-corso-404 p {
    color: #5c6470;
    margin: 0 0 24px;
    font-size: .95rem;
}

/* =========================================================
   MODALE CONDIVIDI
   ========================================================= */
.cesi-share-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cesi-share-modal.is-open {
    display: flex;
    animation: cesiShareFade .2s ease;
}

@keyframes cesiShareFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cesi-share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cesi-share-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border: 1px solid #e3e6ea;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
    animation: cesiSharePop .25s cubic-bezier(.2,.8,.3,1);
    display: flex;
    flex-direction: column;
}

@keyframes cesiSharePop {
    from { transform: translateY(20px) scale(.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.cesi-share-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid #e3e6ea;
}

.cesi-share-modal__head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cesi-share-modal__head h3 i { color: #3ab2f3; }

.cesi-share-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #6c7684;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.cesi-share-modal__close:hover {
    background: #f4f6f8;
    color: #000000;
}

.cesi-share-modal__body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cesi-share__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cesi-share__field label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6c7684;
    font-weight: 600;
}

.cesi-share__input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid #e3e6ea;
    background: #f4f6f8;
}

.cesi-share__input-wrap input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: .9rem;
    color: #2a2f37;
    outline: none;
}

.cesi-share__copy {
    flex-shrink: 0;
    padding: 0 18px;
    background: #3ab2f3;
    color: #ffffff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background .18s ease;
}

.cesi-share__copy:hover,
.cesi-share__copy:focus-visible {
    background: #1a8fcc;
    outline: none;
}

.cesi-share__feedback {
    font-size: .8rem;
    color: #1a7a3e;
    min-height: 16px;
}

.cesi-share__actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.cesi-share__btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #e3e6ea;
    background: #f4f6f8;
    color: #2a2f37;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
    text-align: center;
}

.cesi-share__btn i { font-size: 1.3rem; }

.cesi-share__btn:hover,
.cesi-share__btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .08);
    outline: none;
}

.cesi-share__btn--wa { color: #128c7e; }
.cesi-share__btn--wa:hover,
.cesi-share__btn--wa:focus-visible {
    background: #25d366;
    color: #ffffff;
    border-color: #25d366;
}

.cesi-share__btn--mail { color: #1a8fcc; }
.cesi-share__btn--mail:hover,
.cesi-share__btn--mail:focus-visible {
    background: #3ab2f3;
    color: #ffffff;
    border-color: #3ab2f3;
}

.cesi-share__btn--native { color: #6c7684; }
.cesi-share__btn--native:hover,
.cesi-share__btn--native:focus-visible {
    background: #0d0d0d;
    color: #ffffff;
    border-color: #0d0d0d;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .cesi-corso__body {
        grid-template-columns: 1fr;
    }

    .cesi-corso__col-left {
        border-right: none;
        border-bottom: 1px solid #e3e6ea;
    }

    .cesi-corso__title-row { gap: 14px; }

    .cesi-corso__title { font-size: 1.75rem; }

    .cesi-corso__meta-item {
        border-right: none;
        border-bottom: 1px solid #e3e6ea;
    }

    .cesi-corso__meta-item:last-child { border-bottom: none; }

    /* Info row → 1 colonna su tablet */
    .cesi-corso__info-row {
        grid-template-columns: 1fr;
    }

    .cesi-corso__info-item {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, .06);
    }

    .cesi-corso__info-item:last-child { border-bottom: none; }
}

@media (max-width: 620px) {
    .cesi-corso-page {
        padding: 24px 14px 60px;
    }

    .cesi-corso__title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cesi-corso__title { font-size: 1.45rem; }

    .cesi-corso__share { justify-content: center; }

    .cesi-corso__meta-row { grid-template-columns: 1fr; }

    .cesi-corso__meta-item { padding: 16px 18px; }

    .cesi-corso__meta-icon {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .cesi-corso__meta-value { font-size: .98rem; }

    .cesi-corso__info-item { padding: 10px 14px; }

    .cesi-corso__info-value { font-size: .88rem; }

    .cesi-corso__dove-head { padding: 18px 18px 0; }

    .cesi-corso__dove-body {
        padding: 0 18px 18px;
        gap: 14px;
    }

    .cesi-corso__section-title { font-size: 1.05rem; }

    .cesi-corso__map { height: 220px; }

    .cesi-corso__address {
        font-size: .92rem;
        padding: 14px 16px;
    }

    .cesi-corso__register {
        padding: 16px 20px;
        font-size: .95rem;
    }

    .cesi-corso__desc-box { padding: 18px 16px; }

    .cesi-corso__desc { font-size: .95rem; }

    .cesi-corso__desc-scroll { max-height: 240px; }

    .cesi-share__actions { grid-template-columns: 1fr; }

    .cesi-share-modal__dialog { max-width: 100%; }
}