html,
body,
html * {
    font-family: Arial, ArialMT, 'Helvetica Neue', Helvetica, sans-serif !important;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--slate-400) transparent;
    scrollbar-gutter: stable;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--slate-300);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--slate-500);
}

:root {
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #252525;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #002db3;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

  .filter-row {
    gap: 16px;
    display: flex;
}

.sitemap-wrapper {
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 20px;
    color: var(--slate-800);
}

.title-center {
    text-align: center;
    margin-bottom: 24px;
}

.title-main {
    color: var(--slate-900);
    text-align: center;
    margin: 26px 0px;
}

.breadcrumb-nav {
    margin: 0px 0px 10px 14px;
    border-radius: 12px;
}

.filter-pill:hover {
    background-color: #e5e5e5;
    color: rgb(47, 47, 47);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 700;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-700);
}

.breadcrumb-link {
    color: var(--blue-700);
    text-decoration: none;
}

.breadcrumb-sep {
    color: var(--slate-400);
}

.master-card {
    background: white;
    border: 1px solid var(--slate-300);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 22px;
    position: relative;
}

.hero-section {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    background: white;
    z-index: 20;
    position: relative;
}

.hero-content {
    display: grid;
    height: 65px;
    justify-items: start;
}

.hero-content h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--slate-900);
    margin: 0;
}

.hero-content p {
    font-size: 0.875rem;
    color: var(--slate-600);
    margin: 0;
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-outline {
    background: var(--slate-50);
    border-color: var(--slate-300);
    color: var(--slate-700);
}

.btn-dark {
    background: var(--slate-900);
    color: white;
}

#chevron-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

#toggle_search,
.logic-filter {
    display: none !important;
}

#expandable_area {
    max-height: 0;
    overflow: hidden;
    background: var(--slate-50);
    transition: max-height 0.4s ease-in-out;
}

#toggle_search:checked~#expandable_area {
    max-height: 260px;
    border-top: 1px solid var(--slate-200);
}

#toggle_search:checked~.hero-section #chevron-icon {
    transform: rotate(180deg);
    color: var(--blue-600);
}

.step-tipologia,
.step-risultato {
    display: none !important;
}

.filter-row:has(#contract_0:checked)~.step-tipologia-0,
.filter-row:has(#contract_1:checked)~.step-tipologia-1,
.filter-row:has(#contract_2:checked)~.step-tipologia-2,
.filter-row:has(#contract_3:checked)~.step-tipologia-3,
.filter-row:has(#contract_4:checked)~.step-tipologia-4,
.filter-row:has(#contract_5:checked)~.step-tipologia-5 {
    display: block !important;
    opacity: 1;
}

.step-tipologia:has(#type_0_0:checked)~.result-0-0,
.step-tipologia:has(#type_0_1:checked)~.result-0-1,
.step-tipologia:has(#type_0_2:checked)~.result-0-2,
.step-tipologia:has(#type_0_3:checked)~.result-0-3,
.step-tipologia:has(#type_0_4:checked)~.result-0-4,
.step-tipologia:has(#type_1_0:checked)~.result-1-0,
.step-tipologia:has(#type_1_1:checked)~.result-1-1,
.step-tipologia:has(#type_1_2:checked)~.result-1-2,
.step-tipologia:has(#type_1_3:checked)~.result-1-3,
.step-tipologia:has(#type_1_4:checked)~.result-1-4,
.step-tipologia:has(#type_2_0:checked)~.result-2-0,
.step-tipologia:has(#type_2_1:checked)~.result-2-1,
.step-tipologia:has(#type_2_2:checked)~.result-2-2 {
    display: flex !important;
    opacity: 1;
}

.logic-wrapper {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-pill {
    display: inline-flex;
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--slate-300);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-700);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    justify-content: center;
    min-width: 126px;
    align-items: center;
    text-align: center;
}

.logic-filter:checked+.filter-pill {
    border-color: var(--slate-900) !important;
    background: var(--slate-900) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.typology-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.result-card {
    background: white;
    border: 1px solid var(--slate-300);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.result-bar {
    width: 6px;
    height: 40px;
    background: var(--blue-500);
    border-radius: 99px;
    margin-right: 20px;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: block;
    margin: 26px 0px 10px 14px;
}

.grid-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.link-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid var(--slate-300);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.link-item:hover {
    border-color: var(--blue-500);
}

.link-icon {
    width: 32px;
    height: 32px;
    background: var(--slate-100);
    border-radius: 8px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-500);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    padding: 40px 0 80px;
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--slate-700);
}

.page-link.active {
    background: var(--slate-800);
    border-color: var(--slate-800);
    color: white;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 160px;
    }
}

@media (max-width: 425px) {
    .hero-section {
        min-height: 250px;
    }
    .typology-grid {
        grid-template-columns: auto; 
    }
    .filter-row {
        display: grid !important;
        /* grid-template-columns: 1fr 1fr !important; */
        gap: 10px !important;
    }
}

@media (max-width: 320px) {
    .hero-section {
        min-height: 280px !important;
    }
}

@media (max-width: 639px) {
    .result-bar {
        display: none;
    }
}

@media (min-width: 640px) {
    .grid-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .hero-section {
        flex-direction: row;
    }

    .typology-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
    }
}

@media (min-width: 1024px) {
    .typology-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .grid-links {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    #toggle_search:checked ~ #expandable_area {
        max-height: fit-content;
    }
}

@media (max-width: 425px) {
    .hero-section > div[style] {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-section > div[style] .btn {
        width: 80%;
    }
}