/* ============================================
   SEMPLIFICA.CLOUD — Foglio di stile principale
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-accent: #0ea5e9;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-bg: #ffffff;
    --color-bg-soft: #f8fafc;
    --color-border: #e2e8f0;
    --color-success: #16a34a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
    --radius: 14px;
    --max-width: 1140px;
}

html { scroll-behavior: smooth; }

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

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link { display: flex; align-items: center; }
.logo-img  { height: 40px; width: auto; }

/* --- Navigazione --- */
.main-nav { display: flex; align-items: center; }

.nav-list {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item { position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 500;
    color: var(--color-text);
    transition: background .2s, color .2s;
}

.nav-link:hover {
    background: var(--color-bg-soft);
    color: var(--color-primary);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .7;
    transition: opacity .2s;
}

.nav-link:hover .nav-icon { opacity: 1; }

.caret { font-size: .7rem; opacity: .6; }

/* --- Dropdown --- */
.dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
}

.nav-item.has-dropdown:hover .dropdown,
.nav-item.has-dropdown:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown arricchito con icone e descrizioni */
.dropdown--rich {
    min-width: 280px;
    padding: 10px;
}

.dropdown-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    transition: background .15s;
}

.dropdown-link:hover {
    background: var(--color-bg-soft);
}

.dropdown-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border-radius: 9px;
    color: var(--color-primary);
}

.dropdown-icon svg {
    width: 18px;
    height: 18px;
}

.dropdown-link:hover .dropdown-icon {
    background: #dbeafe;
}

.dropdown-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--color-text);
}

.dropdown-desc {
    font-size: .82rem;
    color: var(--color-text-light);
    line-height: 1.4;
}

/* --- Toggle mobile --- */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: .3s;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    padding: 72px 24px 80px;
    background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

/* --- Layout due colonne: sottotitolo | immagine --- */
.hero-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    max-width: 920px;
    margin: 0 auto 52px;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* --- Badge --- */
.hero-badge {
    display: inline-block;
    padding: 7px 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: .02em;
    margin-bottom: 28px;
}

/* --- Titolo --- */
.hero-title {
    font-size: clamp(1.9rem, 4.5vw, 3.1rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--color-text);
    margin: 0 auto 44px;
    max-width: 800px;
}

/* --- Sottotitolo --- */
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    line-height: 1.7;
    text-align: left;
}

/* --- Box Prezzi --- */
.price-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 0 auto 48px;
    max-width: 760px;
}

.price-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 36px 32px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.price-card--featured {
    border-color: var(--color-primary);
    border-width: 2px;
    position: relative;
}

.price-card--featured::before {
    content: 'Più scelto';
    position: absolute;
    top: -13px;
    left: 32px;
    background: var(--color-primary);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 50px;
    letter-spacing: .03em;
}

.price-card-header {
    margin-bottom: 16px;
}

.price-card-header h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.price-amount {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
}

.price-amount span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.price-card-desc {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 28px;
    flex-grow: 1;
}

/* --- Bottoni --- */
.btn {
    display: inline-block;
    padding: 13px 24px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    transition: background .2s, transform .15s, box-shadow .2s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
}

/* --- Trust Badges --- */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 28px;
}

.trust-badge {
    font-size: .92rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
}

.trust-badge::first-letter {
    color: var(--color-success);
    font-weight: 700;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .main-nav {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }

    .main-nav.open { max-height: 500px; }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 0;
    }

    .nav-item { width: 100%; }

    .nav-link {
        padding: 14px 8px;
        border-bottom: 1px solid var(--color-border);
    }

    /* Dropdown in modalità mobile — sempre visibili */
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 4px 8px;
        background: none;
    }

    .dropdown--rich { min-width: auto; }

    .dropdown-link {
        padding: 10px 8px;
    }

    .dropdown-icon {
        width: 30px;
        height: 30px;
        background: #f1f5f9;
    }

    /* Hero a colonna singola su mobile */
    .hero-top {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-subtitle {
        text-align: center;
    }

    .hero-image { order: -1; }

    .price-cards { grid-template-columns: 1fr; }

    .hero { padding: 48px 20px 60px; }

    .hero-subtitle { font-size: 1.05rem; }

    .price-card { padding: 28px 24px; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 48px 24px 32px;
    border-top: 1px solid #1e293b;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 32px;
}

/* --- Brand --- */
.footer-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
}

.footer-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
}

.footer-brand-dot { color: #60a5fa; }

.footer-brand-desc {
    font-size: .875rem;
    color: #64748b;
    line-height: 1.6;
    max-width: 240px;
}

/* --- Dolibarr badge --- */
.footer-dolibarr {
    display: flex;
    justify-content: center;
}

.footer-dolibarr-badge {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-dolibarr-badge img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-dolibarr-title {
    font-size: .75rem;
    font-weight: 700;
    color: #e2e8f0;
}

.footer-dolibarr-sub {
    font-size: .625rem;
    color: #94a3b8;
    line-height: 1.3;
    margin-top: 2px;
}

/* --- Links --- */
.footer-links { text-align: right; }

.footer-links-title {
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #64748b;
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    font-size: .875rem;
    color: #94a3b8;
    padding: 4px 0;
    transition: color .15s;
}

.footer-links a:hover { color: #fff; }

/* --- Bottom bar --- */
.footer-divider {
    border-top: 1px solid #1e293b;
    margin-bottom: 24px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: .75rem;
    color: #64748b;
}

.footer-bottom strong { color: #94a3b8; }

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    color: #64748b;
    transition: color .15s;
}

.footer-legal a:hover { color: #fff; }

/* --- Footer responsive --- */
@media (min-width: 640px) {
    .footer-bottom { flex-direction: row; }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .footer-links { text-align: left; }
    .footer-dolibarr { justify-content: flex-start; }
}
