:root {
    --primary: #2c3e50;
    --accent: #e74c3c;
    --bg: #f8f9fa;
    --text: #333;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: 40px; /* Dimensioni fisse per evitare CLS */
    display: block;
    aspect-ratio: 1 / 1;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
}

.hero {
    text-align: center;
    padding: 2rem 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-3px);
}

.card a {
    text-decoration: none;
    color: inherit;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.soluzione-detail {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.intro-text {
    margin: 2rem 0;
    font-size: 1.1rem;
    color: #555;
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
}

.answer-box {
    text-align: center;
    background: #eef2f3;
    padding: 3rem 2rem;
    border-radius: 8px;
    margin: 3rem 0;
    border: 1px solid #ddd;
}

.result {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 1rem 0;
}

.btn-primary, .btn-back {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1.2rem 0 0.5rem;
}

.related-section {
    margin: 2rem 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0;
}

.tag {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    text-decoration: none;
    font-size: 0.9rem;
}

.tag:hover {
    text-decoration: underline;
}

.blog-post .meta,
.blog-index .meta {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.post-section {
    margin: 1.4rem 0;
}

.upload-form {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--white);
    border: 2px dashed #ccc;
    text-align: center;
}

.alert {
    padding: 1rem;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    margin-bottom: 1rem;
}

footer {
    background: var(--primary);
    color: var(--white);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-info {
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.9;
    margin: 1rem 0;
}
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #222;
    color: white;
    padding: 1.5rem;
    display: none; /* Gestito via JS */
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.cookie-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

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

.cookie-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-link {
    color: #fff;
    text-decoration: underline;
}

.cookie-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

.cookie-modal.open {
    display: block;
}

.cookie-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.cookie-modal-panel {
    position: relative;
    max-width: 720px;
    margin: 8vh auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #eee;
}

.cookie-modal-title {
    font-size: 1.2rem;
    color: var(--primary);
}

.cookie-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fafafa;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.cookie-modal-body {
    padding: 1.1rem 1.2rem 0.2rem;
}

.cookie-modal-desc {
    color: #555;
    margin-bottom: 1rem;
}

.cookie-options {
    display: grid;
    gap: 0.9rem;
}

.cookie-option {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
}

.cookie-option-title {
    font-weight: 700;
    color: var(--primary);
}

.cookie-option-desc {
    grid-column: 1 / 2;
    color: #555;
    font-size: 0.95rem;
}

.cookie-option-right {
    grid-row: 1 / 3;
    grid-column: 2 / 3;
    display: flex;
    align-items: center;
}

.cookie-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.cookie-modal-footer {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 1rem 1.2rem 1.2rem;
    border-top: 1px solid #eee;
}

.cookie-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.cookie-btn:hover {
    background: #004494;
}

.cookie-btn.secondary {
    background: #555;
}

.cookie-btn.secondary:hover {
    background: #444;
}

.cookie-btn.outline {
    background: transparent;
    border: 1px solid #777;
    color: #ccc;
}

.cookie-btn.outline:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Pulsante rivedi preferenze */
.cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: #444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.cookie-settings-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.cookie-settings-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .cookie-container {
        flex-direction: column;
        text-align: center;
    }
}

.home-seo-text {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    color: #444;
    line-height: 1.8;
}

.home-seo-text h2, .home-seo-text h3 {
    color: var(--primary);
    margin-top: 2rem;
}

.home-seo-text p {
    margin-bottom: 1.5rem;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links li {
    position: relative;
}

.dropdown {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dropdown > a {
    display: inline-block;
}

.dropdown-toggle {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.35);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle::before {
    content: "▾";
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    list-style: none;
    background: var(--primary);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 240px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 0.9rem;
    white-space: nowrap;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu {
    display: block;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Stili Pagina Cerca */
.search-container-large {
    margin: 3rem 0;
    text-align: center;
}

.search-container-large input {
    width: 100%;
    max-width: 600px;
    padding: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 30px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-container-large input:focus {
    border-color: var(--primary);
}

.search-tip {
    margin-top: 1rem;
    color: #777;
    font-size: 0.9rem;
}

/* Stili Archivio */
.archive-intro {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #555;
}

.archive-card a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    display: block;
}

/* Stili Contatti */
.contact-box {
    background: #f9f9f9;
    padding: 2.5rem;
    border-radius: 10px;
    border: 1px solid #eee;
    line-height: 1.8;
}

.contact-details {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border-left: 5px solid var(--primary);
}

.contact-note {
    font-style: italic;
    color: #666;
}

@media (max-width: 768px) {
    .nav-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-links {
        gap: 1rem;
    }

    .dropdown {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        min-width: 0;
    }

    .dropdown-menu a {
        padding: 0.4rem 0;
        opacity: 0.9;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }
}
    .result {
        font-size: 1.8rem;
    }
}
