/* Curricolo Verticale SSAS — nuova identità didattica 2026 */

:root {
    color-scheme: light;
    --paper: #f6f2e9;
    --paper-deep: #ece6da;
    --surface: #fffdf8;
    --surface-muted: #f1eee6;
    --ink: #17313a;
    --ink-soft: #52656b;
    --teal: #0b5f5a;
    --teal-dark: #074943;
    --teal-soft: #d9ece8;
    --coral: #df6b4f;
    --coral-soft: #f8dfd7;
    --sun: #e7aa34;
    --blue: #457b9d;
    --line: #d8d4ca;
    --shadow: 0 24px 70px -44px rgba(23, 49, 58, 0.55);
    --shadow-small: 0 12px 34px -26px rgba(23, 49, 58, 0.45);
    --radius-xl: 30px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --font-body: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Plus Jakarta Sans", var(--font-body);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
}

body {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(rgba(11, 95, 90, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 95, 90, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 8% 5%, rgba(223, 107, 79, 0.16), transparent 25rem),
        radial-gradient(circle at 92% 14%, rgba(69, 123, 157, 0.16), transparent 28rem),
        var(--paper);
    background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    height: 9px;
    background: linear-gradient(90deg, var(--teal) 0 42%, var(--coral) 42% 72%, var(--sun) 72% 100%);
}

button, input, select { font: inherit; }

.skip-link {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    padding: 10px 15px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--teal-dark);
    font-weight: 700;
    transform: translateY(-170%);
    box-shadow: var(--shadow-small);
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid var(--sun);
}

.container {
    width: min(1380px, 100%);
    margin: 0 auto;
    padding: clamp(18px, 3.2vw, 44px);
    padding-bottom: 72px;
}

/* Hero: guida visiva, non semplice intestazione */
.main-header {
    margin: 8px 0 26px;
    animation: rise 500ms cubic-bezier(.22, 1, .36, 1) both;
}

.hero-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: clamp(28px, 5vw, 74px);
    align-items: center;
    padding: clamp(28px, 5vw, 64px);
    overflow: hidden;
    border: 1px solid rgba(11, 95, 90, 0.13);
    border-radius: var(--radius-xl);
    background: rgba(255, 253, 248, 0.93);
    box-shadow: var(--shadow);
}

.hero-card::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -90px;
    bottom: -130px;
    border: 42px solid rgba(223, 107, 79, 0.10);
    border-radius: 50%;
    pointer-events: none;
}

.hero-copy { position: relative; z-index: 1; }

.hero-badge,
.section-kicker,
.route-label {
    color: var(--teal-dark);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

.hero-badge {
    display: inline-flex;
    padding: 7px 12px;
    border: 1px solid rgba(11, 95, 90, 0.14);
    border-radius: 999px;
    background: var(--teal-soft);
}

.hero-kicker {
    margin: clamp(26px, 4vw, 42px) 0 8px;
    color: var(--coral);
    font-family: var(--font-display);
    font-size: clamp(0.88rem, 1.4vw, 1rem);
    font-weight: 800;
}

.main-header h1 {
    max-width: 760px;
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5.6vw, 5.3rem);
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 0.98;
}

.main-header h1 span { color: var(--teal); }

.hero-subtitle {
    max-width: 720px;
    margin: 24px 0 0;
    color: var(--ink-soft);
    font-size: clamp(1rem, 1.7vw, 1.17rem);
    line-height: 1.55;
}

.hero-guide {
    max-width: 660px;
    margin: 22px 0 0;
    padding-left: 16px;
    border-left: 4px solid var(--coral);
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.5;
}

.hero-guide strong { color: var(--ink); }

.hero-route {
    position: relative;
    z-index: 1;
    padding: 24px;
    border: 1px solid rgba(11, 95, 90, 0.13);
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
}

.route-heading { display: grid; gap: 6px; }

.route-heading strong {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.route-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 26px 0 18px;
    padding: 0;
    list-style: none;
}

.route-steps::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--blue), var(--coral), var(--sun));
    transform: translateY(-50%);
}

.route-steps li { position: relative; display: grid; place-items: center; }

.route-steps span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 4px solid var(--surface-muted);
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.83rem;
    font-weight: 800;
}

.route-steps li:nth-child(3) span { background: var(--blue); }
.route-steps li:nth-child(4) span { background: var(--coral); }
.route-steps li:nth-child(5) span { background: #b57910; }

.hero-route > p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.91rem;
    line-height: 1.45;
}

/* Navigazione principale del curricolo */
.tab-navigation {
    /* La barra rapida gestisce lo scorrimento senza coprire i moduli negli iframe. */
    position: relative;
    top: 12px;
    z-index: 100;
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid rgba(11, 95, 90, 0.12);
    border-radius: 22px;
    background: rgba(246, 242, 233, 0.94);
    box-shadow: var(--shadow-small);
    backdrop-filter: blur(14px);
}

.tab-intro { padding-left: 6px; }

.tab-intro h2 {
    margin: 4px 0 2px;
    font-family: var(--font-display);
    font-size: clamp(1.12rem, 2vw, 1.45rem);
    letter-spacing: -0.025em;
}

.tab-intro p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

.tab-buttons-wrapper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tab-button {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 74px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tab-button:hover {
    transform: translateY(-2px);
    border-color: rgba(11, 95, 90, 0.4);
    box-shadow: var(--shadow-small);
}

.tab-button:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.tab-button.active {
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
    box-shadow: 0 14px 34px -24px rgba(7, 73, 67, 0.9);
}

.tab-button.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 16px;
    height: 16px;
    border-radius: 0 0 4px 0;
    background: var(--teal);
    transform: translateX(-50%) rotate(45deg);
}

.tab-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
}

.tab-button.active .tab-icon { background: rgba(255,255,255,.16); color: #fff; }
.tab-copy { display: grid; min-width: 0; gap: 2px; }
.tab-label { font-family: var(--font-display); font-size: 0.9rem; font-weight: 800; line-height: 1.2; }
.tab-description { color: var(--ink-soft); font-size: 0.78rem; line-height: 1.2; }
.tab-button.active .tab-description { color: rgba(255,255,255,.78); }

.tab-button-featured {
    grid-column: 1 / -1;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 62px;
    border-color: rgba(223, 107, 79, 0.42);
    background: linear-gradient(110deg, var(--surface) 0 72%, var(--coral-soft) 100%);
}

.tab-button-featured::before {
    content: "Guida normativa";
    margin-right: 4px;
    color: var(--coral);
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tab-button-featured.active { background: var(--teal); }
.tab-button-featured.active::before { color: rgba(255,255,255,.82); }

.tab-button-reference {
    border-color: rgba(11, 95, 90, 0.34);
    background: linear-gradient(110deg, var(--surface) 0 72%, var(--teal-soft) 100%);
}

.tab-button-reference::before { content: "Mappa delle fonti"; color: var(--teal-dark); }
.tab-button-reference.active::before { color: rgba(255,255,255,.82); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 240ms ease both; }

.content-iframe {
    display: block;
    width: 100%;
    min-height: 70vh;
    border: 0;
    background: transparent;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid var(--paper); border-radius: 999px; background: rgba(11, 95, 90, 0.38); }
::-webkit-scrollbar-thumb:hover { background: rgba(11, 95, 90, 0.62); }

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

@media (max-width: 980px) {
    .hero-card { grid-template-columns: 1fr; gap: 30px; }
    .hero-route { max-width: 620px; }
    .tab-navigation { position: static; grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 680px) {
    .container { padding: 16px 12px 52px; }
    .main-header { margin-bottom: 18px; }
    .hero-card { gap: 18px; padding: 20px 18px; border-radius: 22px; }
    .main-header h1 { font-size: clamp(2.2rem, 12vw, 3rem); line-height: .94; }
    .hero-badge { padding: 6px 9px; font-size: 0.59rem; line-height: 1.3; }
    .hero-kicker { margin-top: 18px; font-size: .82rem; }
    .hero-subtitle { margin-top: 16px; font-size: .94rem; line-height: 1.4; }
    .hero-guide { margin-top: 14px; font-size: .9rem; line-height: 1.38; }
    .hero-route { padding: 14px; }
    .route-heading { gap: 3px; }
    .route-heading strong { font-size: 1rem; }
    .route-label { font-size: .62rem; }
    .route-steps { margin: 14px 0 9px; }
    .route-steps span { width: 34px; height: 34px; border-width: 3px; }
    .hero-route > p { font-size: .8rem; line-height: 1.35; }
    .tab-navigation { padding: 14px; border-radius: 18px; }
    .tab-buttons-wrapper { grid-template-columns: 1fr; }
    .tab-button { min-height: 62px; }
    .tab-button.active::after { display: none; }
    .tab-button-featured { grid-column: auto; grid-template-columns: 38px minmax(0, 1fr); }
    .tab-button-featured::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
