:root {
    --bg-color: #f5f5f5;
    --surface: #fdfdfd;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --accent: #111111;
    --border-color: #d9d9d9;
    --radius: 32px;
    --transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    --shadow: 0 34px 80px rgba(0,0,0,0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: radial-gradient(circle at top left, rgba(0,0,0,0.04), transparent 28%),
                radial-gradient(circle at bottom right, rgba(0,0,0,0.03), transparent 24%),
                var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
}

button, input, textarea {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

main, .container {
    width: min(1280px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 2px solid rgba(0,0,0,0.15);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(0,0,0,0.04);
}

.book-cover-fallback {
    height: 100%;
    width: 100%;
    display: grid;
    place-items: center;
    font-size: 2.4rem;
    color: rgba(0,0,0,0.28);
    letter-spacing: 0.08em;
    font-weight: 700;
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes floatSquircle {
    0%, 100% { transform: translateY(var(--squircle-drop, 0px)) rotate(0deg); }
    50% { transform: translateY(calc(var(--squircle-drop, 0px) + 10px)) rotate(20deg); }
}

.roll-in-element {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s ease, transform 0.75s ease;
    will-change: opacity, transform;
}

.roll-in-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-title { position: relative; display: inline-block; }

.squircle-dot {
    position: absolute;
    width: 26px;
    height: 26px;
    right: -18px;
    top: 8px;
    border-radius: 20px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), #111 68%);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 22px 36px rgba(0,0,0,0.14);
    z-index: 1;
    pointer-events: none;
    transform-origin: center;
    animation: floatSquircle 3.6s ease-in-out infinite alternate, squirclePulse 2.6s ease-in-out infinite;
}

@keyframes squirclePulse {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.06) rotate(8deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.section-note {
    color: var(--text-muted);
    margin-top: 0.6rem;
    line-height: 1.8;
}

.input-squircle {
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.95);
}

.btn-nav {
    border: 1px solid rgba(0,0,0,0.12);
    background: #fff;
    color: var(--text-main);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.btn-nav:hover:not(:disabled) {
    background: rgba(0,0,0,0.04);
}

.btn-nav:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
}

.upload-zone {
    background: linear-gradient(180deg, #ffffff 0%, #f9f9f9 100%);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.hero {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
    border-radius: calc(var(--radius) * 1.2);
    background: linear-gradient(180deg, #ffffff 0%, #f3f3f3 100%);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 4rem 3rem 5rem;
    display: grid;
    place-items: center;
    margin-bottom: 3rem;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 18%, rgba(0,0,0,0.03), transparent 22%),
                radial-gradient(circle at 82% 22%, rgba(0,0,0,0.02), transparent 16%);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 880px;
}

.eyebrow {
    display: inline-flex;
    font-size: 0.77rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.hero-title {
    margin: 0;
    font-size: clamp(4.5rem, 11vw, 8rem);
    line-height: 0.9;
    font-weight: 900;
    letter-spacing: -0.08em;
}

.hero-subtitle {
    margin: 1.5rem auto 0;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 760px;
    line-height: 1.9;
}

.hero-action {
    margin-top: 2.25rem;
    display: flex;
    justify-content: center;
}

.feature-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
    margin-bottom: 3rem;
}

.feature-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    will-change: transform;
}

.feature-image {
    position: relative;
    overflow: hidden;
    min-height: 240px;
    transition: transform 0.25s ease-out;
    border-radius: 24px;
    will-change: transform;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease-out;
    transform: scale(1.02);
    border-radius: 24px;
}

.feature-copy {
    padding: 1.75rem;
}

.feature-copy h2 {
    margin: 0.8rem 0 0.85rem;
    font-size: 1.7rem;
    line-height: 1.2;
}

.feature-copy p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
}

.search-section {
    background: rgba(255,255,255,0.95);
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 2.25rem;
}

.search-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.search-panel h2 {
    margin: 0;
    font-size: 2rem;
}

.search-control {
    flex: 1;
    min-width: 280px;
}

.search-input {
    width: 100%;
    padding: 18px 24px;
    font-size: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.14);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 6px rgba(0,0,0,0.05);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.book-card {
    min-height: 380px;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 22px 48px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f9f9f9 100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 32px 72px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.14);
}

.book-cover {
    height: 240px;
    border-radius: 28px;
    margin-bottom: 1.4rem;
    overflow: hidden;
    background: #e2e2e2;
    border: 1px solid rgba(0,0,0,0.06);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-details h3 {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
    line-height: 1.32;
}

.book-author {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.book-desc {
    margin: 0 0 1.5rem;
    color: #5e5e5e;
    line-height: 1.75;
    font-size: 0.95rem;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 0.8rem;
}

.icon-button {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    color: var(--text-main);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-decoration: none;
}

.icon-button:hover {
    transform: translateY(-2px);
    border-color: rgba(0,0,0,0.18);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    z-index: 2000;
    padding: 1.5rem;
}

.modal {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 40px 120px rgba(0,0,0,0.18);
    position: relative;
    max-height: min(88vh, 900px);
    overflow: hidden;
}

.modal-body {
    overflow-y: auto;
    max-height: calc(88vh - 170px);
    padding-right: 0.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-main);
}

.modal-body h3 {
    margin-top: 0;
    font-size: 1.75rem;
}

.modal-author {
    color: var(--text-muted);
    margin: 0.6rem 0 1.2rem;
}

.modal-description {
    color: #4c4c4c;
    line-height: 1.9;
}

.hidden {
    display: none !important;
}

.btn {
    border-radius: 999px;
    padding: 14px 24px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.nav-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(255,255,255,0.95);
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.07);
}

.nav-controls .btn {
    padding: 12px 18px;
    flex: 1 1 140px;
    min-width: 130px;
    max-width: 220px;
}

.page-info {
    font-size: 1rem;
    color: var(--text-muted);
    min-width: 100px;
    text-align: center;
    font-weight: 500;
}

.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 16px;
    z-index: 200;
    margin: 0 auto 1.5rem;
    width: min(100%, 1280px);
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.98);
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 18px 38px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
    transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
    pointer-events: none;
}

.page-toolbar.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: toolbarDrift 6s ease-in-out infinite alternate 0.35s;
}

@keyframes toolbarDrift {
    from {
        box-shadow: 0 18px 38px rgba(0,0,0,0.12);
        transform: translateY(0) scale(1);
    }
    to {
        box-shadow: 0 30px 52px rgba(0,0,0,0.16);
        transform: translateY(-3px) scale(1.005);
    }
}

.toolbar-brand {
    font-weight: 900;
    letter-spacing: -0.05em;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.toolbar-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.toolbar-nav a:hover {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .page-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

.loading-text {
    color: var(--text-muted);
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1rem;
    padding: 2rem 0;
}

.reader-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;
    border-radius: calc(var(--radius) * 0.9);
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.08);
}

.reader-hero .eyebrow {
    display: inline-flex;
    margin-bottom: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.reader-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.05;
}

.reader-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.reader-panel {
    background: rgba(255,255,255,0.96);
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.reader-panel-header,
.reader-meta {
    margin-top: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reader-actions {
    display: flex;
    gap: 1rem;
}

.platform-log-panel,
.comment-panel {
    margin-top: 1rem;
}

.platform-log {
    display: grid;
    gap: 0.9rem;
    background: #fafafa;
    border-radius: 24px;
    padding: 1rem;
    min-height: 180px;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.08);
}

.log-entry {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.06);
}

.log-entry--success { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.2); }
.log-entry--danger { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.18); }
.log-entry--info { background: rgba(15, 23, 42, 0.05); border-color: rgba(15, 23, 42, 0.08); }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-main);
    background: rgba(0,0,0,0.06);
}

@media (max-width: 1100px) {
    .reader-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .reader-panel {
        padding: 1.25rem;
    }

    .reader-viewer,
    .viewer-fallback {
        min-height: 320px;
    }
}

.dashboard-login {
    max-width: 400px;
    margin: 10vh auto;
    text-align: center;
}

.hidden { display: none; }

@media (max-width: 940px) {
    .feature-section {
        grid-template-columns: 1fr;
    }
    .hero {
        padding: 3rem 2rem 4rem;
    }
}

@media (max-width: 680px) {
    .hero-title {
        font-size: clamp(3rem, 18vw, 5rem);
    }
    .search-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* --- Reader Layout Updates --- */
.reader-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    margin-bottom: 1rem;
}

.reader-header-panel {
    background: rgba(255,255,255,0.98);
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.reader-meta-info h1 {
    margin: 0.5rem 0 0.25rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

.reader-actions-bar {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
}

.btn-text:hover {
    color: var(--text-main);
}

/* --- Gatekeeper Overlay --- */
.gatekeeper-overlay {
    position: fixed;
    inset: 0;
    background: #f5f5f5;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.gatekeeper-card {
    background: #fff;
    padding: 3rem;
    border-radius: 40px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.1);
    max-width: 480px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.squircle-icon {
    width: 60px;
    height: 60px;
    background: #111;
    border-radius: 20px;
    margin: 0 auto 1.5rem;
    z-index: 1;
    animation: floatSquircle 3s ease-in-out infinite;
}

.gate-input-group {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.challenge-display {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5rem 0;
    color: var(--text-main);
}

/* --- Footer --- */
.site-footer {
    margin-top: 4rem;
    padding: 3rem 0;
    border-top: 1px solid rgba(0,0,0,0.06);
    text-align: center;
}

.brand-footer {
    font-weight: 900;
    letter-spacing: -0.05em;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .reader-header-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gatekeeper-card {
        padding: 2rem 1.5rem;
        border-radius: 32px;
    }
}

/* nel toolbar */
/* --- Language Selector Custom --- */
.toolbar-lang {
    margin-left: auto;
    position: relative;
}

.lang-selector {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.95);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.25s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    min-width: 120px;
    justify-content: space-between;
}

.lang-toggle:hover {
    background: #ffffff;
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.lang-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lang-current {
    white-space: nowrap;
}

.lang-arrow {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.lang-selector.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1000;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.98);
}

.lang-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background 0.2s ease, transform 0.15s ease;
    font-family: inherit;
    text-align: left;
}

.lang-option:hover {
    background: rgba(0,0,0,0.05);
    transform: translateX(4px);
}

.lang-option:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.lang-option.active {
    background: rgba(0,0,0,0.06);
    font-weight: 600;
}

/* Scrollbar personalizzata per il dropdown */
.lang-dropdown::-webkit-scrollbar {
    width: 4px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 999px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

/* Responsive */
@media (max-width: 720px) {
    .toolbar-lang {
        margin-left: 0;
        width: 100%;
    }
    
    .lang-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .lang-dropdown {
        right: auto;
        left: 0;
        width: 100%;
        min-width: unset;
    }
}
.toolbar-lang select {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: white;
    font-weight: 500;
    cursor: pointer;
}

@keyframes langPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.lang-toggle:active {
    animation: langPulse 0.3s ease;
}

/* nuova sezione capitoli */
.chapters-section {
    margin-top: 3rem;
    padding: 2rem 0;
}
.chapters-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.chapters-header h2 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.8rem;
}

/* card capitolo, simile a feature-card ma più piccola */
.chapter-card {
    position: relative;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: var(--shadow);
    padding: 1.8rem 1.5rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    text-align: center;
    will-change: transform;
}
.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 72px rgba(0,0,0,0.1);
}
.chapter-number {
    font-size: 3rem;
    font-weight: 900;
    color: rgba(0,0,0,0.08);
    line-height: 1;
    margin-bottom: 0.2rem;
}
.chapter-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0.5rem 0 0.3rem;
}
.chapter-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Learning Path Section --- */
.learning-path-section {
    margin: 4rem 0 3rem;
    padding: 2rem 0;
}

.learning-path-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.learning-path-header h2 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

/* Diagramma a cascata (versione semplificata) */
.path-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin: 1.5rem 0 3rem;
    font-size: 0.95rem;
}

.path-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.9);
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.step-number {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent);
    min-width: 2.4rem;
    text-align: right;
}

.step-label {
    font-weight: 500;
}

.path-arrow {
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0.5;
}

/* Griglia delle descrizioni dei capitoli */
.path-chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-top: 2.5rem;
}

.path-chapter-card {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 1.2rem 1rem;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.path-chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.path-chapter-num {
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.05);
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    margin-bottom: 0.4rem;
}

.path-chapter-card h4 {
    margin: 0.3rem 0 0.2rem;
    font-size: 1rem;
    line-height: 1.2;
}

.path-chapter-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.promo-banner {
margin: 3rem auto 0; max-width: 1120px; padding: 0 1.5rem;
}
.promo-banner-inner {
display: flex; align-items: center; gap: 1.75rem;
background: #111014; color: #f2f2f5;
border-radius: 28px; padding: 1.75rem 2rem;
box-shadow: 0 30px 70px rgba(0,0,0,0.18);
border: 1px solid rgba(255,255,255,0.06);
}
.promo-icon {
flex: 0 0 auto; width: 84px; height: 84px; border-radius: 20px;
background: linear-gradient(160deg, #241a2e, #150f1c);
display: flex; align-items: center; justify-content: center;
border: 1px solid rgba(255,255,255,0.06);
}
.promo-icon svg { width: 52px; height: 52px; }
.promo-copy { flex: 1 1 auto; min-width: 0; }
.promo-copy .promo-eyebrow {
font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
font-weight: 700; color: #ff6a6a; margin: 0 0 0.35rem;
}
.promo-copy h3 { margin: 0 0 0.4rem; font-size: 1.2rem; line-height: 1.3; }
.promo-copy p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: #c7c7d1; }
.promo-cta {
flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem;
background: #ff3b3b; color: #fff; text-decoration: none;
font-weight: 700; font-size: 0.9rem; padding: 0.85rem 1.3rem;
border-radius: 14px; white-space: nowrap; transition: filter 0.15s ease, transform 0.15s ease;
}
.promo-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
@media (max-width: 720px) {
.promo-banner-inner { flex-direction: column; text-align: center; }
.promo-cta { width: 100%; justify-content: center; }
}