/* Showcase — sistema visivo unificato, coerente con il resto del sito
   (stessa palette/font di theme.css, stesse convenzioni di site.css/assertion.css:
   card bianche, radius 10px sugli elementi interni, ombra leggera, bottoni navy). */

/* Il "navy" segue l'accento del tenant (theme.css); #0a2463 resta solo come ripiego
   per i tenant che non definiscono --tenant-accent. */
:root {
    --sc-navy: var(--tenant-accent-strong, var(--tenant-accent, #0a2463));
    --sc-navy-hover: color-mix(in srgb, var(--sc-navy) 80%, #fff);
    /* Fondo di righe link e card badge: --background-grey ha alpha al 41% in tutti i
       tenant e sul bianco della card risultava quasi invisibile. */
    --sc-surface: #f4f5fa;
}

.btn-navy {
    background: var(--sc-navy) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

    .btn-navy:hover,
    .btn-navy:focus {
        background: var(--sc-navy-hover) !important;
        color: #fff !important;
    }

    .btn-navy:disabled {
        background: var(--medium-grey, #9da2c5) !important;
        box-shadow: none;
    }

body.sc-page {
    background: var(--background-grey, #eff1f7);
    min-height: 100vh;
    margin: 0;
    padding: 0.85rem 1rem 2.5rem;
    display: flex;
    flex-direction: column;
}

.sc-shell {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== Card ===== */

.sc-card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    box-shadow: rgba(0, 0, 0, 0.16) 0 1px 4px;
    overflow: hidden;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sc-tenant-logo {
    padding: 0.85rem 0 0.6rem;
    text-align: center;
}

    .sc-tenant-logo img {
        height: 22px;
        object-fit: contain;
    }

.sc-banner {
    height: 96px;
    background: linear-gradient(135deg, var(--iqcblue, #354F9A), var(--hoverblue, #4f6da3));
    background-size: cover;
    background-position: center;
    position: relative;
}

    .sc-banner::after {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
        background-size: 16px 16px;
    }

/* Varianti di accento per i 4 template (stessa palette del brand, solo tono diverso) */
.sc-card.accent-1 .sc-banner { background: linear-gradient(135deg, var(--iqcblue, #354F9A), var(--hoverblue, #4f6da3)); }
.sc-card.accent-2 .sc-banner { background: linear-gradient(135deg, var(--sc-navy), var(--sc-navy-hover)); }
.sc-card.accent-3 .sc-banner { background: linear-gradient(135deg, var(--contrast, #ffb044), color-mix(in srgb, var(--contrast, #ffb044) 85%, #000)); }
.sc-card.accent-4 .sc-banner { background: linear-gradient(135deg, var(--ultra-dark-blue, #051d32), var(--dark-blue, #143e62)); }

/* Stesse varianti riusate come swatch nel selettore banner (ChooseTemplate / Edit) */
.banner-swatch.accent-1, .layout-swatch.accent-1 { background: linear-gradient(135deg, var(--iqcblue, #354F9A), var(--hoverblue, #4f6da3)); }
.banner-swatch.accent-2, .layout-swatch.accent-2 { background: linear-gradient(135deg, var(--sc-navy), var(--sc-navy-hover)); }
.banner-swatch.accent-3, .layout-swatch.accent-3 { background: linear-gradient(135deg, var(--contrast, #ffb044), color-mix(in srgb, var(--contrast, #ffb044) 85%, #000)); }
.banner-swatch.accent-4, .layout-swatch.accent-4 { background: linear-gradient(135deg, var(--ultra-dark-blue, #051d32), var(--dark-blue, #143e62)); }

.sc-avatar-wrap {
    position: relative;
    z-index: 1;
    margin-top: -44px;
    display: flex;
    justify-content: center;
}

.sc-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: rgba(0, 0, 0, 0.16) 0 1px 4px;
    background: #fff;
}

.sc-body {
    padding: 0.75rem 1.75rem 2rem;
}

.sc-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.5rem 0 0.15rem;
    color: var(--ultra-dark-grey, #414b56);
}

.sc-desc {
    color: #595959;
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
    white-space: pre-line;
}

/* ===== Social row ===== */

.sc-social-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.sc-social-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ultra-light-grey, #e2e8f1);
    color: var(--iqcblue, #354F9A);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

    .sc-social-icon svg {
        width: 19px;
        height: 19px;
        stroke: currentColor;
        fill: none;
    }

    .sc-social-icon:hover {
        background: var(--sc-navy);
        color: #fff;
        transform: translateY(-2px);
    }

/* Con tutte e 7 le icone attive (sito, social, telefono, email) lo spazio in una riga
   sui 42px stretti; le rimpiccioliamo leggermente cosi' restano tutte allineate. */
.sc-social-row-compact {
    gap: 0.45rem;
}

    .sc-social-row-compact .sc-social-icon {
        width: 37px;
        height: 37px;
    }

        .sc-social-row-compact .sc-social-icon svg {
            width: 17px;
            height: 17px;
        }

/* ===== Buttons ===== */

.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1.25rem;
    margin-bottom: 0.6rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.sc-btn-primary {
    background: var(--sc-navy);
    color: #fff;
}

    .sc-btn-primary:hover {
        background: var(--sc-navy-hover);
        color: #fff;
    }

.sc-btn:active {
    transform: scale(0.98);
}

/* ===== Sezioni link personalizzati ===== */

.sc-links {
    margin-top: 1.5rem;
    text-align: left;
}

.sc-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ultra-dark-grey, #414b56);
    margin: 1.5rem 0 0.4rem;
}

.sc-divider {
    width: 40px;
    height: 3px;
    border: none;
    border-radius: 2px;
    background: var(--contrast, #ffb044);
    opacity: 1; /* <hr> eredita opacity: .25 da Bootstrap */
    margin: 0 0 0.75rem;
}

.sc-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sc-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--sc-surface);
    border-radius: 10px;
    color: var(--ultra-dark-grey, #414b56);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid var(--iqcblue, #354F9A);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .sc-link-item:hover {
        transform: translateX(3px);
        box-shadow: rgba(0, 0, 0, 0.1) 0 2px 6px;
        color: var(--sc-navy);
    }

    .sc-link-item .sc-link-arrow {
        opacity: 0.5;
    }

/* ===== Badge grid ===== */

.sc-badges {
    margin-top: 1.75rem;
}

.sc-badges-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
}

.sc-badge-item img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.sc-badge-item:hover img {
    transform: translateY(-3px) scale(1.04);
}

.sc-badges-placeholder .sc-badge-item img {
    opacity: 0.6;
}

/* Stile Badge 2: elenco orizzontale con nome/issuer */
.sc-badge-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sc-badge-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem 0.85rem;
    background: var(--sc-surface);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .sc-badge-row:hover {
        transform: translateX(3px);
        box-shadow: rgba(0, 0, 0, 0.1) 0 2px 6px;
        color: inherit;
    }

    .sc-badge-row img {
        width: 48px;
        height: 48px;
        object-fit: contain;
        border-radius: 8px;
        flex-shrink: 0;
    }

.sc-badge-row-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
}

.sc-badge-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ultra-dark-grey, #414b56);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-badge-issuer {
    font-size: 0.8rem;
    color: #8a8f9c;
}

.sc-badges-placeholder .sc-badge-row,
.sc-badges-placeholder .sc-badge-card {
    opacity: 0.6;
}

/* Stile Badge 3: card con didascalia */
.sc-badge-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

.sc-badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 96px;
    padding: 0.75rem 0.5rem;
    background: var(--sc-surface);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .sc-badge-card:hover {
        transform: translateY(-3px);
        box-shadow: rgba(0, 0, 0, 0.1) 0 2px 6px;
        color: inherit;
    }

    .sc-badge-card img {
        width: 56px;
        height: 56px;
        object-fit: contain;
        border-radius: 10px;
    }

    .sc-badge-card .sc-badge-name {
        font-size: 0.78rem;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    .sc-badge-card .sc-badge-issuer {
        font-size: 0.7rem;
        text-align: center;
    }

/* ===== Footer brand (loghi) ===== */

.sc-brand-footer {
    max-width: 560px;
    margin: 1.5rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #8a8f9c;
    font-size: 0.75rem;
}

    .sc-brand-footer img {
        height: 18px;
        object-fit: contain;
    }

@media (max-width: 480px) {
    .sc-body {
        padding: 0.75rem 1.25rem 1.75rem;
    }

    .sc-btn {
        font-size: 0.9rem;
    }
}

/* ===== Banner post-salvataggio (arrivo da Edit dopo "Salva Modifiche") =====
   Sono chrome fissa sopra la pagina (z-index alto), ma non devono mai coprire
   contenuto vero dello showcase: quando presenti, riservano spazio reale in
   testa/coda alla pagina (padding su body) cosi' che tutto resti visibile e
   lo showcase sottostante resta cliccabile ovunque non ci sia il banner. */

.sc-saved-toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2.5rem;
    background: #1e7e34;
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

    .sc-saved-toast .material-symbols-outlined {
        font-size: 1.2rem;
    }

.sc-saved-toast-close {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

body.has-saved-toast {
    padding-top: calc(0.85rem + 52px);
}

.sc-share-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    padding: 0.65rem 2.25rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
}

.sc-share-bar-close {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #8a8f9c;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

.sc-share-bar-actions {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.sc-share-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    background: none;
    border: none;
    color: var(--ultra-dark-grey, #414b56);
    font-size: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    min-width: 56px;
}

    .sc-share-action .material-symbols-outlined,
    .sc-share-action .fa {
        font-size: 1.4rem;
        color: var(--sc-navy, #0a2463);
    }

.sc-share-action-edit .material-symbols-outlined {
    color: var(--contrast, #ffb044);
}

body.has-share-bar {
    padding-bottom: calc(2.5rem + 72px + env(safe-area-inset-bottom, 0px));
}

.sc-share-email-form {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

    .sc-share-email-form.show {
        display: flex;
    }

    .sc-share-email-form input[type="email"] {
        max-width: 260px;
    }

/* Banner promozionale mostrato a chi visualizza uno showcase non proprio (es. link girato
   da qualcun altro): stessa cornice del banner di condivisione, contenuto diverso. */
.sc-promo-bar-link {
    display: block;
    text-align: center;
    color: var(--ultra-dark-grey, #414b56);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0 1.5rem;
}

.sc-promo-cta {
    color: var(--sc-navy, #0a2463);
    font-weight: 600;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .sc-saved-toast {
        padding: 0.75rem 2.25rem;
        font-size: 0.85rem;
    }

    /* Fino a 6 azioni su una riga sola: colonne elastiche al posto della larghezza minima fissa */
    .sc-share-bar {
        padding-left: 0.5rem;
        padding-right: 2rem;
    }

    .sc-share-bar-actions {
        gap: 0.25rem;
        flex-wrap: nowrap;
    }

    .sc-share-action {
        flex: 1 1 0;
        min-width: 0;
        font-size: 0.65rem;
        line-height: 1.15;
        text-align: center;
    }

    .sc-promo-bar-link {
        font-size: 0.8rem;
    }
}
