@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap');

:root {
    --hub-navy: #1F3A6D;
    --hub-navy-deep: #163056;
    --hub-blue: #2E6DA4;
    --hub-orange: #F28C28;
    --hub-orange-dark: #e07a18;
    --hub-text: #1a1d21;
    --hub-muted: #5c636a;
    --hub-radius: 16px;
    --hub-shadow: 0 10px 28px rgba(31,58,109,0.10);
}

body.hub-public {
    background: #fff;
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    color: var(--hub-text);
    padding-top: 0 !important;
}
body.hub-public > .navbar { display: none !important; }
body.hub-public main.hub-main,
body.hub-public main {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.hub-public .sidebar,
body.hub-public .sidebar-overlay { display: none !important; }
body.hub-public footer.site-footer {
    margin-top: 0 !important;
    padding: 0.75rem 0 !important;
    background: #1a202c !important;
}
body.hub-public footer .alert { display: none !important; }

.hub-topbar {
    position: sticky; top: 0; z-index: 1040;
    background: #fff; border-bottom: 1px solid rgba(31,58,109,0.08);
}
.hub-topbar-inner {
    max-width: 1140px; margin: 0 auto; padding: 0.65rem 1.15rem;
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.hub-brand {
    display: inline-flex; align-items: center; gap: 0.5rem;
    text-decoration: none; color: var(--hub-navy); font-weight: 800; font-size: 1rem; flex-shrink: 0;
}
.hub-brand img { height: 38px; width: auto; display: block; }
.hub-nav { display: none; align-items: center; gap: 0.95rem; flex: 1; justify-content: center; }
.hub-nav a {
    color: var(--hub-navy); text-decoration: none; font-weight: 600; font-size: 0.86rem; white-space: nowrap;
}
.hub-nav a:hover,
.hub-nav a.is-active { color: var(--hub-blue); }
.hub-top-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.hub-btn-login {
    display: inline-flex; align-items: center; gap: 0.3rem;
    color: var(--hub-navy) !important; text-decoration: none; font-weight: 700; font-size: 0.84rem;
    padding: 0.5rem 0.8rem; border-radius: 10px; border: 1px solid rgba(31,58,109,0.18); background: #fff;
}
.hub-btn-reg {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--hub-orange); color: #fff !important; font-weight: 700; font-size: 0.84rem;
    text-decoration: none; padding: 0.5rem 0.95rem; border-radius: 10px;
    box-shadow: 0 4px 12px rgba(242,140,40,0.35);
}
.hub-btn-reg:hover { background: var(--hub-orange-dark); color: #fff !important; }
.hub-burger {
    display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
    border: 1px solid rgba(31,58,109,0.15); border-radius: 10px; background: #fff; cursor: pointer; font-size: 1.2rem;
}
@media (min-width: 992px) {
    .hub-nav { display: flex; }
    .hub-burger { display: none; }
}
.hub-nav-mobile { display: none; background: #fff; padding: 0.4rem 1.15rem 0.9rem; border-bottom: 1px solid rgba(31,58,109,0.08); }
.hub-nav-mobile.is-open { display: block; }
.hub-nav-mobile a {
    display: block; padding: 0.55rem 0.25rem; color: var(--hub-navy); text-decoration: none;
    font-weight: 600; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.92rem;
}

.hub-wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.15rem; position: relative; z-index: 1; }
.hub-page { padding: 2rem 0 2.5rem; }
.hub-page h1 {
    font-size: clamp(1.45rem, 2.8vw, 1.9rem); font-weight: 800; color: var(--hub-navy);
    margin: 0 0 0.75rem; letter-spacing: -0.02em;
}
.hub-panel {
    background: #fff; border-radius: var(--hub-radius); border: 1px solid rgba(31,58,109,0.08);
    box-shadow: var(--hub-shadow); padding: 1.75rem 1.5rem; max-width: 560px; margin: 0 auto;
}
.hub-btn-primary {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: var(--hub-orange); color: #fff !important; font-weight: 700;
    text-decoration: none; padding: 0.85rem 1.25rem; border-radius: 12px; font-size: 0.92rem;
    box-shadow: 0 8px 20px rgba(242,140,40,0.4); border: none; cursor: pointer;
}
.hub-btn-primary:hover { background: var(--hub-orange-dark); color: #fff !important; }
.hub-btn-blue {
    display: inline-block; background: var(--hub-navy); color: #fff !important; font-weight: 700;
    text-decoration: none; padding: 0.75rem 1.25rem; border-radius: 10px; border: none; cursor: pointer;
}
.hub-btn-blue:hover { background: var(--hub-blue); color: #fff !important; }
.hub-form .form-label { font-weight: 600; color: var(--hub-navy); font-size: 0.9rem; }

.hub-mini-footer {
    background: #f7f8fa; border-top: 1px solid rgba(31,58,109,0.08);
    padding: 0.85rem 1.15rem; text-align: center;
}
.hub-mini-footer a {
    color: var(--hub-blue); font-weight: 600; text-decoration: none;
    font-size: 0.82rem; margin: 0 0.45rem; white-space: nowrap;
}
.hub-mini-footer a:hover { text-decoration: underline; }

/* ===== HOME hero ===== */
.hub-hero {
    background: linear-gradient(135deg, #1F3A6D 0%, #163056 50%, #245a8f 100%);
    color: #fff; padding: 2.4rem 0 2.2rem; position: relative; overflow: hidden;
}
.hub-hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse 55% 70% at 88% 42%, rgba(46,109,164,0.5), transparent 70%);
    pointer-events: none;
}
.hub-hero-grid { display: grid; gap: 1.25rem; align-items: center; }
@media (min-width: 992px) {
    .hub-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1rem 1.5rem; }
}
.hub-title-row { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.65rem; }
.hub-title-ico {
    width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
    background: rgba(242,140,40,0.2); color: #ffb35a;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.hub-hero h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.35rem); font-weight: 800; line-height: 1.1;
    letter-spacing: -0.03em; margin: 0;
}
.hub-hero h1 .accent { color: #ffb35a; }
.hub-hero .hub-sub {
    font-size: clamp(1rem, 1.8vw, 1.18rem); font-weight: 700; line-height: 1.35;
    margin: 0 0 0.55rem; max-width: 32rem;
}
.hub-hero .lead {
    font-size: 0.92rem; opacity: 0.92; max-width: 32rem; margin: 0 0 1.15rem; line-height: 1.5; font-weight: 500;
}
.hub-cta-row { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1.25rem; }
.hub-btn-ghost {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: transparent; color: #fff !important; font-weight: 650;
    text-decoration: none; padding: 0.85rem 1.1rem; border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,0.45); font-size: 0.92rem;
}
.hub-btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff !important; }
.hub-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
@media (min-width: 640px) { .hub-pills { grid-template-columns: repeat(4, 1fr); } }
.hub-pill { text-align: center; font-size: 0.72rem; font-weight: 650; line-height: 1.25; }
.hub-pill .pi {
    width: 40px; height: 40px; margin: 0 auto 0.35rem; border-radius: 11px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.16);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.hub-hero-visual {
    display: flex; justify-content: center; align-items: center;
    min-width: 0; overflow: visible;
}
.hub-hero-visual img {
    width: 100%; max-width: 580px; height: auto; max-height: 400px;
    object-fit: contain; display: block;
    filter: drop-shadow(0 22px 40px rgba(0,0,0,0.40));
}
@media (min-width: 992px) {
    .hub-hero-visual { justify-content: flex-end; }
    .hub-hero-visual img { max-width: 620px; max-height: 440px; }
}
@media (max-width: 767px) {
    /* Testo prima, mockup dopo: più chiaro su telefono */
    .hub-hero-visual { order: 0; }
    .hub-hero-visual img { max-width: 100%; max-height: 200px; }
}

.hub-section { padding: 2.4rem 0; }
.hub-section h2 {
    text-align: center; font-size: 1.45rem; font-weight: 800; color: var(--hub-navy);
    margin: 0 0 0.35rem; letter-spacing: -0.02em;
}
.hub-section .hub-intro {
    text-align: center; color: var(--hub-muted); max-width: 560px; margin: 0 auto 1.5rem;
    font-size: 0.92rem; font-weight: 500;
}
.hub-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .hub-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .hub-cards { grid-template-columns: repeat(4, 1fr); } }
.hub-card {
    background: #fff; border-radius: var(--hub-radius);
    padding: 1.25rem 1.1rem 1.15rem; box-shadow: var(--hub-shadow);
    border: 1px solid rgba(31,58,109,0.06);
    display: flex; flex-direction: column;
}
.hub-card .ico {
    width: 46px; height: 46px; border-radius: 12px; margin-bottom: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, var(--hub-navy), var(--hub-blue));
    color: #fff; font-size: 1.25rem;
}
.hub-card h3 { font-size: 0.98rem; font-weight: 750; color: var(--hub-navy); margin: 0 0 0.35rem; }
.hub-card p { font-size: 0.84rem; color: var(--hub-muted); margin: 0; line-height: 1.45; flex: 1; font-weight: 500; }
.hub-card .more {
    margin-top: 0.9rem; width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hub-orange); color: #fff !important; text-decoration: none; font-weight: 800;
}

.hub-steps {
    display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 0.25rem 0;
}
.hub-step {
    flex: 1 1 200px; max-width: 260px; text-align: center; padding: 0.75rem 0.5rem; position: relative;
}
.hub-step .si {
    width: 64px; height: 64px; margin: 0 auto 0.55rem; border-radius: 50%;
    background: #eef3f9; color: var(--hub-navy);
    display: flex; align-items: center; justify-content: center; font-size: 1.65rem;
    border: 2px solid rgba(31,58,109,0.08); position: relative;
}
.hub-step .num {
    position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--hub-orange); color: #fff; font-size: 0.72rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.hub-step h3 { font-size: 0.9rem; font-weight: 750; color: var(--hub-navy); margin: 0; line-height: 1.35; }
.hub-step-arrow {
    display: none; align-self: center; color: var(--hub-orange); font-size: 1.45rem; font-weight: 800; margin-top: -1.2rem;
}
@media (min-width: 900px) { .hub-step-arrow { display: block; } }

.hub-cta-bleed {
    position: relative; color: #fff; padding: 3.5rem 1.15rem;
    min-height: 260px;
    background-color: var(--hub-navy);
    background-size: cover;
    background-position: 70% center; /* mette in vista tecnico + BTS */
    background-repeat: no-repeat;
}
.hub-cta-bleed::before {
    content: ''; position: absolute; inset: 0;
    /* sinistra leggibile, destra quasi libera per tecnico/BTS */
    background: linear-gradient(92deg,
        rgba(22,48,86,0.90) 0%,
        rgba(22,48,86,0.72) 38%,
        rgba(22,48,86,0.35) 62%,
        rgba(22,48,86,0.12) 100%);
}
.hub-cta-inner {
    position: relative; z-index: 1; max-width: 1140px; margin: 0 auto;
    display: grid; gap: 1.25rem; align-items: center;
}
@media (min-width: 900px) {
    .hub-cta-inner { grid-template-columns: 1.2fr 1fr auto; gap: 1.5rem; }
    .hub-cta-bleed { min-height: 260px; padding: 3.5rem 1.5rem; }
}
.hub-cta-bleed h2 {
    color: #fff; font-size: clamp(1.2rem, 2.2vw, 1.55rem); margin: 0;
    display: flex; align-items: center; gap: 0.55rem; text-align: left;
}
.hub-cta-bleed ul {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem;
}
.hub-cta-bleed li { font-weight: 650; font-size: 0.88rem; }
.hub-cta-bleed li::before { content: '✓ '; color: #fdba74; font-weight: 800; }
.hub-cta-actions { text-align: center; }
.hub-cta-actions .sublink { display: block; margin-top: 0.65rem; font-size: 0.82rem; }
.hub-cta-actions .sublink a { color: rgba(255,255,255,0.9); font-weight: 600; }

/* Prezzi */
.prezzi-hero {
    background: linear-gradient(145deg, var(--hub-navy), var(--hub-blue));
    color: #fff; padding: 2.75rem 0 2.5rem; text-align: center;
}
.prezzi-hero h1 { font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.5rem; color: #fff; }
.prezzi-hero p { opacity: 0.92; max-width: 560px; margin: 0 auto; }
.prezzi-wrap { max-width: 860px; margin: -1.5rem auto 2.5rem; padding: 0 1rem; }
.prezzi-card {
    background: #fff; border-radius: 14px; border: 1px solid rgba(31,58,109,0.08);
    box-shadow: 0 10px 30px rgba(31,58,109,0.10); padding: 2rem 1.5rem; text-align: center;
}
.prezzi-amount { font-size: 2.6rem; font-weight: 800; color: var(--hub-navy); line-height: 1; }
.prezzi-amount small { font-size: 1rem; font-weight: 600; color: #64748b; }
.prezzi-list { text-align: left; max-width: 420px; margin: 1.5rem auto; padding: 0; list-style: none; }
.prezzi-list li { padding: 0.45rem 0; color: #334155; font-weight: 500; }
.prezzi-list li::before { content: '✓ '; color: var(--hub-orange); font-weight: 800; }
.btn-prezzi {
    display: inline-block; background: var(--hub-orange); color: #fff !important; font-weight: 700;
    text-decoration: none; padding: 0.9rem 1.5rem; border-radius: 10px; margin: 0.35rem;
}
.btn-prezzi-outline {
    display: inline-block; background: #fff; color: var(--hub-navy) !important; font-weight: 700;
    text-decoration: none; padding: 0.9rem 1.5rem; border-radius: 10px; border: 1px solid rgba(31,58,109,0.2); margin: 0.35rem;
}
.prezzi-note { color: #64748b; font-size: 0.92rem; margin-top: 1.25rem; }

/* ===== MOBILE: home/pubbliche leggibili ===== */
@media (max-width: 767.98px) {
    html:has(body.hub-public),
    body.hub-public {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    body.hub-public main.hub-main,
    body.hub-public main {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    .hub-topbar-inner {
        padding: 0.5rem 0.75rem;
        gap: 0.4rem;
    }
    .hub-brand img { height: 32px; }
    .hub-btn-reg {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }
    .hub-wrap { padding: 0 0.85rem; }
    .hub-hero {
        padding: 1.35rem 0 1.5rem;
    }
    .hub-hero h1 { font-size: 1.45rem; }
    .hub-hero .hub-sub { font-size: 0.98rem; }
    .hub-hero .lead { font-size: 0.88rem; margin-bottom: 0.9rem; }
    .hub-cta-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    .hub-cta-row .hub-btn-primary,
    .hub-cta-row .hub-btn-ghost {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 0.8rem 1rem;
        font-size: 0.88rem;
        box-sizing: border-box;
    }
    .hub-pills {
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }
    .hub-pill { font-size: 0.68rem; }
    .hub-pill .pi { width: 36px; height: 36px; font-size: 1rem; }
    .hub-section { padding: 1.75rem 0; }
    .hub-section h2 { font-size: 1.25rem; padding: 0 0.25rem; }
    .hub-section .hub-intro { font-size: 0.88rem; margin-bottom: 1.15rem; }
    .hub-steps { flex-direction: column; align-items: center; }
    .hub-step { max-width: 100%; flex: 1 1 auto; }
    .hub-cta-bleed {
        min-height: 0 !important;
        padding: 2rem 0.85rem !important;
        background-position: 80% center;
    }
    .hub-cta-inner {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 1rem !important;
    }
    .hub-cta-bleed h2 {
        justify-content: center;
        text-align: center;
        font-size: 1.15rem;
        flex-wrap: wrap;
    }
    .hub-cta-bleed ul {
        grid-template-columns: 1fr !important;
        justify-items: center;
        text-align: left;
        margin: 0 auto;
        max-width: 260px;
    }
    .hub-cta-actions .hub-btn-primary {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
    .hub-mini-footer {
        padding: 0.85rem 0.5rem;
        line-height: 1.9;
    }
    .hub-mini-footer a {
        white-space: normal;
        margin: 0 0.35rem;
        font-size: 0.8rem;
    }
    .hub-page { padding: 1.25rem 0 2rem; }
    .hub-panel {
        margin: 0 0.15rem;
        padding: 1.25rem 1rem;
        max-width: none;
    }
    .prezzi-hero { padding: 1.75rem 0 2rem; }
    .prezzi-amount { font-size: 2rem; }
    .btn-prezzi, .btn-prezzi-outline {
        display: block;
        margin: 0.45rem 0;
        text-align: center;
    }
}
