/* ============================================
   TECNOIMPIANTI PRO - CSS UNICO SITO PUBBLICO
   Pagine coperte:
   - Home
   - Servizi (lista)
   - Singoli servizi
   - Lavori
   - Contatti
   - Chi siamo
   ============================================ */
   html, body {
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
    height: 100%;
}

html {
    scroll-behavior: smooth;
}
/* ===========================
   PALETTE & BASE — ENTERPRISE
=========================== */
:root {
    --color-bg: #0B1F3A;
    --color-bg-alt: #102B4C;
    --color-bg-deep: #081322;
    --color-surface: #FFFFFF;
    --color-surface-alt: #F4F6F8;
    --color-primary: #0B1F3A;
    --color-primary-soft: #102B4C;
    --color-accent: #FFC300;
    --color-text: #1F2933;
    --color-text-muted: #4B5563;
    --color-text-inverse: #F9FAFB;
    --color-text-inverse-muted: #D1D5DB;
    --color-text-inverse-soft: #CBD5F5;
    --color-border: #E2E8F0;
    --color-border-strong: #9CA3AF;
    --color-border-inverse: rgba(255, 255, 255, 0.35);
    --color-bg-footer: #0B1F3A;
    --color-text-footer: #9CA3AF;
    --color-text-footer-muted: #6B7280;
    --color-border-footer: rgba(255, 255, 255, 0.12);
    --color-placeholder-start: #102B4C;
    --color-placeholder-end: #1a3a5c;
    --color-success: #1F7A3F;
    --color-success-bg: #E7F5EC;
    --color-warning: #8A6A00;
    --color-warning-bg: #FFF4CC;
    --color-error: #8B1E2D;
    --color-error-bg: #FCE8EB;
    --color-focus: #FFC300;

    --radius-xs: 14px;
    --radius-sm: 14px;
    --radius-md: 14px;
    --radius-lg: 14px;
    --radius-xl: 14px;

    --shadow-sm: 0 2px 8px rgba(11, 31, 58, 0.06);
    --shadow-md: 0 8px 24px rgba(11, 31, 58, 0.1);
    --shadow-lg: 0 12px 32px rgba(11, 31, 58, 0.14);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 64px;
    --space-11: 56px;
    --space-12: 72px;

    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 15px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;
    --text-3xl: 34px;
    --text-4xl: 40px;

    --lh-tight: 1.2;
    --lh-snug: 1.35;
    --lh-normal: 1.6;
    --focus-ring: 0 0 0 3px rgba(255, 195, 0, 0.35);
}

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-surface-alt);
    color: var(--color-text);
    font-size: var(--text-md);
    line-height: var(--lh-normal);
}

h1, h2, h3 {
    line-height: var(--lh-snug);
}

/* Evita scroll doppio quando il menu mobile è aperto */
.no-scroll-mobile {
    overflow: hidden;
}

/* LINK */
a {
    color: var(--color-bg);
    text-decoration: none;
}

.section-dark a:not(.btn),
.footer a,
.hero a:not(.btn) {
    color: var(--color-text-inverse);
}

.footer-links a:hover,
.footer-col a:hover {
    color: var(--color-accent) !important;
}
a:hover {
    text-decoration: underline;
}
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.dropdown-btn:focus-visible,
.nav-toggle:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* LAYOUT GENERALE */
.site-main {
    min-height: 60vh;
}

/* ===========================
   HEADER & NAVBAR
=========================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
}
/* FIX MOBILE PER EVITARE LA STRISCIA NERA */
.site-header,
.topbar {
    height: auto !important;
    padding-top: env(safe-area-inset-top) !important;
    margin-top: 0 !important;
}

.topbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-img {
    height: 50px;
    width: auto;
}

.logo-area {
    text-decoration: none;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text-inverse);
    letter-spacing: 0.03em;
    /* Nessuna transition su font/letter-spacing per evitare vibrazione */
}

.logo-pro {
    color: var(--color-accent);
}

/* Header shrink: solo padding, logo invariato (no vibrazione) */
.site-header.header-shrink .topbar {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

/* Phone in header — premium: numero sempre visibile, click-to-call */
.header-phone {
    font-weight: 700;
    color: var(--color-accent) !important;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.header-phone:hover {
    color: #ffd54f !important;
    text-decoration: underline;
}

.nav-phone {
    margin-left: var(--space-2);
}

.header-phone-icon {
    display: none;
}

@media (max-width: 900px) {
    .nav-phone {
        order: -1;
        width: 100%;
        margin: 0 0 var(--space-3);
    }
    .header-phone {
        font-size: var(--text-lg);
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
    }
    .header-phone-icon {
        display: inline-flex;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
}

/* NAVBAR DESKTOP */
.main-nav {
    display: flex;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li a,
.dropdown-btn {
    color: var(--color-text-inverse);
    font-weight: 500;
    font-size: var(--text-base);
    text-decoration: none;
    padding: var(--space-2) var(--space-1);
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-links li a:hover,
.dropdown-btn:hover {
    color: var(--color-accent);
}

.nav-links li a.is-active,
.dropdown-btn.is-active {
    color: var(--color-accent);
    position: relative;
}

.nav-links li a.is-active::after,
.dropdown-btn.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 999px;
}

/* HAMBURGER BUTTON – DESKTOP HIDDEN */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: var(--space-1) 0;
    background: var(--color-text-inverse);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

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

/* DROPDOWN */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    min-width: 250px;
    background: var(--color-surface);
    border-radius: var(--radius-xs);
    padding: var(--space-2) 0;
    list-style: none;
    margin: 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    display: none;
}

.dropdown-menu li a {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text);
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background: rgba(255, 195, 0, 0.1);
}

/* Desktop: dropdown su hover */
@media (min-width: 901px) {
    .dropdown:hover > .dropdown-menu {
        display: block;
    }
}

/* ===========================
   HERO
=========================== */
.hero {
    padding: var(--space-11) var(--space-5) var(--space-12);
    text-align: left;
}

.hero-dark {
    color: var(--color-text-inverse);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--color-bg); /* fallback */
}

.small-hero {
    padding: var(--space-8) var(--space-5);
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero home - più spazio e respiro */
.hero-home .hero-inner {
    padding: 0 var(--space-5);
}

.hero-home h1 {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
    letter-spacing: -0.02em;
}

.hero-home .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.hero-home .btn-outline {
    text-decoration: none;
}

.hero-text {
    max-width: 640px;
}

.hero h1 {
    font-size: var(--text-3xl);
    line-height: var(--lh-tight);
    font-weight: 800;
    margin: 0 0 var(--space-4);
}

.hero .subtitle {
    font-size: var(--text-md);
    color: var(--color-text-inverse-muted);
    margin-bottom: var(--space-6);
    line-height: var(--lh-normal);
}

/* BOTTONI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-bg);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: #ffd54f;
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(255, 195, 0, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-inverse);
    border-color: var(--color-border-inverse);
    margin-left: var(--space-3);
}

.btn-outline:hover {
    background: rgba(249, 250, 251, 0.08);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-outline-light {
    background: transparent;
    color: var(--color-text-inverse);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

/* Section numeri azienda */
.section-numbers {
    padding: var(--space-10) var(--space-5);
    background: var(--color-surface-alt);
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    text-align: center;
}

.number-card {
    padding: var(--space-6);
}

.number-value {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
}

.number-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* Service cards premium (home) */
.section-services {
    padding: var(--space-12) var(--space-5);
}

.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.service-card-premium {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(16px);
}

.service-card-premium.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

.service-card-premium.revealed:hover {
    transform: translateY(-4px);
}

.service-card-img-wrap {
    height: 220px;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.service-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: transform 0.3s ease;
}

.service-card-premium:hover .service-img {
    transform: scale(1.03);
}

/* Legacy: div con background (se usato altrove) */
.service-card-img {
    height: 220px;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.service-card-body {
    padding: var(--space-5);
}

.service-card-body h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
}

.service-card-body p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

/* Method timeline */
.section-method {
    padding: var(--space-12) var(--space-5);
}

.method-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
}

.method-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.method-step.revealed {
    opacity: 1;
    transform: translateY(0);
}

.method-step-num {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 195, 0, 0.2), rgba(255, 195, 0, 0.08));
    color: var(--color-accent);
    font-weight: 800;
    font-size: var(--text-lg);
    border-radius: var(--radius-md);
}

.method-step-content h3 {
    font-size: var(--text-md);
    margin: 0 0 var(--space-1);
}

.method-step-content p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0;
}

/* Portfolio section (dark) */
.section-portfolio {
    padding: var(--space-12) var(--space-5);
    background: var(--color-bg-alt);
    color: var(--color-text-inverse);
}

.section-portfolio .section-title,
.section-portfolio .section-subtitle {
    color: var(--color-text-inverse);
}

.section-portfolio .section-subtitle {
    color: var(--color-text-inverse-muted);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.portfolio-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.portfolio-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-card-img {
    position: absolute;
    inset: 0;
    transition: transform 0.4s ease;
}

.portfolio-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portfolio-card-img:has(img) {
    background: none;
}

.portfolio-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 31, 58, 0.95) 0%, rgba(11, 31, 58, 0.4) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-5);
    opacity: 1;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-card-overlay {
    background: linear-gradient(to top, rgba(11, 31, 58, 0.98) 0%, rgba(11, 31, 58, 0.5) 60%, rgba(11, 31, 58, 0.2) 100%);
}

.portfolio-card:hover .portfolio-card-img {
    transform: scale(1.08);
}

.portfolio-tag {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portfolio-card-overlay h3 {
    font-size: var(--text-md);
    margin: 0 0 var(--space-1);
    color: #fff;
}

.portfolio-card-overlay p {
    font-size: var(--text-sm);
    color: var(--color-text-inverse-muted);
    margin: 0;
}

.section-actions {
    text-align: center;
}

/* Why section */
.section-why {
    padding: var(--space-12) var(--space-5);
}

.why-image-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    min-height: 400px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.why-image-inner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.checklist-large li {
    font-size: var(--text-base);
    margin-bottom: var(--space-3);
}

/* Service detail layout (alternato immagine/testo) */
.section-service-detail {
    padding: var(--space-12) var(--space-5);
}

.service-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
    align-items: center;
}

.service-detail-img {
    min-height: 360px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.service-detail-img img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
    display: block;
}

.service-detail-content {
    padding: var(--space-2) 0;
}

.service-detail-cta {
    margin-top: var(--space-6);
}

@media (max-width: 900px) {
    .service-detail-row {
        grid-template-columns: 1fr;
    }
    .service-detail-img {
        min-height: 260px;
    }
}

/* Perché scegliere (pagina servizi e dettaglio) */
.section-why-servizi {
    padding: var(--space-12) var(--space-5);
}

.why-servizi-img-inner {
    position: relative;
    width: 100%;
    min-height: 320px;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.why-servizi-img-inner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.why-servizi-content .section-title {
    margin-bottom: var(--space-5);
}

/* Hero enterprise */
.hero-enterprise .hero-tagline {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-accent);
    margin: 0 0 var(--space-2);
}

.hero-enterprise .subtitle {
    margin-bottom: var(--space-5);
}

/* HERO BADGES */
.hero-buttons {
    margin-top: var(--space-3);
}

.hero-badges {
    margin-top: var(--space-4);
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-inverse-soft);
}

/* ===========================
   SEZIONI COMUNI
=========================== */
.section-light,
.section-dark,
.section-cta {
    padding: var(--space-11) var(--space-5);
}

.section-light {
    background: var(--color-surface-alt);
}

.section-dark {
    background: var(--color-bg-alt);
    color: var(--color-text-inverse);
}

.section-cta {
    background: var(--color-bg-deep);
    color: var(--color-text-inverse);
    text-align: center;
}

.section-cta .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* Container premium - max-width coerente */
.container-max {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

@media (min-width: 1280px) {
    .container-max {
        padding: 0 var(--space-6);
    }
}

.section-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.section-dark .section-title {
    color: var(--color-text-inverse);
}

.section-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-muted);
    max-width: 700px;
    margin-bottom: var(--space-7);
    line-height: var(--lh-normal);
}

.section-dark .section-subtitle {
    color: var(--color-text-inverse-muted);
}

/* CTA FINALE */
.section-cta h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

.section-cta p {
    margin-bottom: var(--space-6);
    font-size: var(--text-base);
    color: var(--color-text-inverse-muted);
}

/* ===========================
   GRID, CARD, LAYOUT
=========================== */
.cards-grid {
    display: grid;
    gap: var(--space-6);
    align-items: stretch;
}

.cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* CARD BASE */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-xs);
    padding: var(--space-6) var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-dark .card {
    background: rgba(15,23,42,0.8);
    border-color: var(--color-border-inverse);
}

.card h3 {
    font-size: var(--text-lg);
    margin-top: 0;
    margin-bottom: var(--space-2);
}

/* METHOD CARD WITH IMAGE (PRO - leggibilità garantita) */
.method-card {
    position: relative;
    overflow: hidden;
}

.method-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px) saturate(0.9) contrast(0.95);
    transform: scale(1.05);
    z-index: 0;
}

.method-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(8,18,35,0.78) 0%,
        rgba(8,18,35,0.58) 55%,
        rgba(8,18,35,0.32) 100%
    );
    z-index: 1;
}

.method-card__content {
    position: relative;
    z-index: 2;
}

/* Padding + micro background dietro al testo solo nella card con immagine */
.method-card--with-image .method-card__content {
    padding: var(--space-6) var(--space-5);
    border-radius: calc(var(--radius-xs) - 2px);
    background: linear-gradient(
        to bottom,
        rgba(8,18,35,0.38),
        rgba(8,18,35,0.18)
    );
    backdrop-filter: blur(2px);
}

.method-card--with-image h3 {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.method-card--with-image p {
    color: rgba(255,255,255,0.92);
    text-shadow: 0 2px 8px rgba(0,0,0,0.40);
}

/* Testi card generiche */
.card p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
    line-height: var(--lh-normal);
}

.card p:last-child {
    margin-bottom: 0;
}

/* Card con icone - benefit section */
.card-benefit {
    text-align: center;
    padding: var(--space-8) var(--space-6);
}

.card-benefit .card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    background: linear-gradient(135deg, rgba(255, 195, 0, 0.15), rgba(255, 195, 0, 0.06));
    border-radius: var(--radius-sm);
    color: var(--color-accent);
}

.card-benefit .card-icon svg {
    flex-shrink: 0;
}

.section-benefits {
    padding: var(--space-12) var(--space-5);
}

.section-benefits .section-subtitle {
    margin-bottom: var(--space-9);
}

.section-dark .card p {
    color: var(--color-text-inverse);
}

.section-dark .card h3 {
    color: var(--color-text-inverse);
}

.card-outline {
    background: transparent;
}

/* CARD SERVIZI (pagina servizi) */
.service-grid-page {
    margin-top: var(--space-6);
}

.service-card-big h3 {
    margin-bottom: var(--space-2);
}

.service-card-big p {
    margin-bottom: var(--space-2);
}

/* LAYOUT 2 COLONNE */
.section-two-cols {
    display: grid;
    gap: var(--space-7);
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
}

/* CHECKLIST */
.checklist {
    list-style: none;
    padding: 0;
    margin: var(--space-3) 0 var(--space-6);
    font-size: var(--text-sm);
}

.checklist li {
    margin-bottom: var(--space-2);
    position: relative;
    padding-left: var(--space-5);
}

.checklist li::before {
    content: "✔";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent);
    font-size: var(--text-xs);
    line-height: var(--lh-snug);
}

/* BOX HIGHLIGHT */
.box-highlight {
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    padding: var(--space-6) var(--space-5);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.section-dark .box-highlight {
    background: rgba(15,23,42,0.92);
}

.box-highlight h3 {
    margin-top: 0;
    margin-bottom: var(--space-3);
}

.box-highlight p {
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.box-note {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.section-dark .box-note {
    color: var(--color-text-inverse);
}

/* LINK INLINE */
.link-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-weight: 500;
    font-size: var(--text-sm);
    text-decoration: none;
    color: var(--color-accent);
}

.link-inline:hover {
    text-decoration: underline;
}

/* ===========================
   LAVORI
=========================== */
.lavori-grid {
    margin-top: var(--space-6);
}

.lavoro-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lavoro-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.lavoro-img-placeholder {
    width: 100%;
    height: 180px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-xs);
    background: linear-gradient(135deg, var(--color-placeholder-start), var(--color-placeholder-end)) center/cover;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
    cursor: pointer;
}

.lavoro-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lavoro-img-placeholder:has(img) {
    background: none;
}

.lavoro-img-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.35));
}

/* Lavori filters */
.lavori-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.filter-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-xs);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
    background: var(--color-bg);
    color: var(--color-text-inverse);
    border-color: var(--color-bg);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(11, 31, 58, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lavoro-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.lavoro-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-xl);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.01em;
}

.lavoro-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.lavoro-title {
    font-size: var(--text-md);
    font-weight: 600;
    margin: var(--space-1) 0;
}

.lavoro-type {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin: 0;
}

.lavoro-desc {
    font-size: var(--text-sm);
    margin-top: var(--space-2);
    color: var(--color-text-muted);
}

.lavoro-proof {
    list-style: none;
    padding: 0;
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
    color: var(--color-text);
    display: grid;
    gap: var(--space-1);
}

.lavoro-proof li {
    position: relative;
    padding-left: 16px;
}

.lavoro-proof li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent);
}

/* ===========================
   FORM CONTATTI
=========================== */
.contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3) var(--space-4);
    margin-top: var(--space-4);
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.form-row.full {
    grid-column: 1 / -1;
}

.contact-form label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: var(--space-3) var(--space-3);
    font-size: var(--text-sm);
    border-radius: var(--radius-xs);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface-alt);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--color-text-muted);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
    background-color: var(--color-surface);
}

.contact-form input:invalid,
.contact-form select:invalid,
.contact-form textarea:invalid {
    border-color: var(--color-error);
}

.contact-form input:invalid:focus,
.contact-form select:invalid:focus,
.contact-form textarea:invalid:focus {
    box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.25);
}

.contact-form textarea {
    min-height: 130px;
    resize: vertical;
}

.contact-form button {
    grid-column: 1 / -1;
}

.form-file {
    padding: var(--space-2);
}

/* Preventivi layout */
.section-preventivi {
    padding: var(--space-12) var(--space-5);
}

.preventivi-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-10);
    align-items: start;
}

.preventivi-form-col .section-title {
    margin-bottom: var(--space-5);
}

.contact-form-premium .form-row {
    margin-bottom: 0;
}

.box-contatti p {
    margin: var(--space-3) 0;
}

.map-placeholder {
    margin-top: var(--space-5);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    min-height: 200px;
}

.map-placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.map-placeholder-inner span {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

/* FAQ */
.preventivi-faq {
    margin-top: var(--space-12);
    padding-top: var(--space-10);
    border-top: 1px solid var(--color-border);
}

.faq-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-6);
}

.faq-list {
    max-width: 700px;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item summary {
    padding: var(--space-4) 0;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    float: right;
    color: var(--color-accent);
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    padding-bottom: var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

@media (max-width: 900px) {
    .preventivi-layout {
        grid-template-columns: 1fr;
    }
}

/* Chi siamo */
.about-story {
    max-width: 800px;
}

.about-story p {
    margin-bottom: var(--space-4);
    line-height: var(--lh-normal);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-6);
}

.value-card {
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.value-icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: rgba(255, 195, 0, 0.2);
    color: var(--color-accent);
    border-radius: var(--radius-xs);
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.value-card h3 {
    font-size: var(--text-lg);
    margin: 0 0 var(--space-2);
    color: var(--color-text-inverse);
}

.value-card p {
    font-size: var(--text-sm);
    color: var(--color-text-inverse-muted);
    margin: 0;
}

.section-team {
    padding: var(--space-12) var(--space-5);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    margin-top: var(--space-6);
}

.team-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.team-img {
    height: 220px;
    overflow: hidden;
}

.team-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-info {
    padding: var(--space-5);
}

.team-info h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
}

.team-info p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0;
}

@media (max-width: 900px) {
    .values-grid,
    .team-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   UTILITIES / STATUS
=========================== */
.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: var(--space-7);
}

.mt-md {
    margin-top: var(--space-4);
}

.mb-lg {
    margin-bottom: var(--space-7);
}

.btn-block {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

.notice {
    color: var(--color-text);
}

.notice--success {
    background: var(--color-success-bg);
    border-color: rgba(31, 122, 63, 0.35);
    color: var(--color-success);
}

.notice--warning {
    background: var(--color-warning-bg);
    border-color: rgba(138, 106, 0, 0.35);
    color: var(--color-warning);
}

.notice--error {
    background: var(--color-error-bg);
    border-color: rgba(139, 30, 45, 0.35);
    color: var(--color-error);
}

.notice-title {
    margin-bottom: var(--space-3);
    color: currentColor;
}

.form-messages {
    margin-bottom: var(--space-4);
}

.form-message {
    padding: var(--space-3);
    border-radius: var(--radius-xs);
    margin-bottom: var(--space-2);
}

.form-message-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.form-message-error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.notice p {
    color: currentColor;
}

.slot-grid {
    display: grid;
    gap: var(--space-4);
    margin-bottom: var(--space-7);
}

.slot-option {
    display: flex;
    align-items: center;
    padding: var(--space-4);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.slot-option input {
    margin-right: var(--space-4);
    width: 20px;
    height: 20px;
}

.slot-option strong {
    font-size: var(--text-md);
    display: block;
    margin-bottom: var(--space-1);
}

.slot-option span {
    color: var(--color-text-muted);
}

.slot-option:focus-within {
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
    background: rgba(0, 86, 210, 0.04);
}

/* ===========================
   FOOTER
=========================== */
.footer {
    background: var(--color-bg-footer);
    color: var(--color-text-footer);
    padding: var(--space-7) var(--space-5) var(--space-4);
    margin-top: var(--space-8);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto var(--space-5);
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
    gap: var(--space-7);
    align-items: flex-start;
}

.footer-logo {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text-inverse);
    margin: 0 0 var(--space-1);
}

.footer-logo span {
    color: var(--color-accent);
}

.footer-tagline {
    font-size: var(--text-sm);
    margin: 0;
}

.footer-col h4 {
    margin-top: 0;
    margin-bottom: var(--space-2);
    color: var(--color-text-inverse);
    font-size: var(--text-sm);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.footer-links a {
    text-decoration: none;
    color: var(--color-text-inverse-muted);
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-col p {
    font-size: var(--text-sm);
    margin: var(--space-1) 0;
}

.footer-col a {
    color: var(--color-text-inverse);
    text-decoration: none;
}

.footer-col a:hover {
    text-decoration: underline;
}

.footer-piva,
.footer-rea {
    font-size: var(--text-xs);
    color: var(--color-text-footer-muted);
    margin: var(--space-1) 0;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    border-top: 1px solid var(--color-border-footer);
    padding-top: var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-footer-muted);
    text-align: center;
}

.footer-legal {
    margin-top: var(--space-2);
}

.footer-legal a {
    color: var(--color-text-footer-muted);
    text-decoration: none;
}

.footer-legal a:hover {
    color: var(--color-accent);
}

/* ===========================
   RESPONSIVE
=========================== */

/* Tablet & mobile */
@media (max-width: 900px) {

    .topbar {
        padding: var(--space-3) var(--space-4);
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 0px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-bg-footer);
        transform: translateY(-100%);
        transition: transform 0.25s ease;
        padding: var(--space-5) var(--space-5) var(--space-7);
        display: block;
        z-index: 9999;
    }

    .main-nav.nav-open {
        transform: translateY(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: var(--color-bg-footer);
        padding-left: var(--space-2);
    }

    .dropdown-menu li a {
        color: var(--color-text-inverse);
        font-size: var(--text-sm);
        padding: var(--space-2) 0;
    }

    .dropdown-menu.dropdown-open {
        display: block;
    }

    .hero {
        padding: var(--space-8) var(--space-4) var(--space-9);
    }

    .small-hero {
        padding: var(--space-7) var(--space-4);
    }

    .hero h1 {
        font-size: var(--text-2xl);
    }

    .hero .subtitle {
        font-size: var(--text-sm);
    }

    .hero-badges {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }

    .section-light,
    .section-dark,
    .section-cta {
        padding: var(--space-9) var(--space-4);
    }

    .cards-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-two-cols {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .method-timeline {
        grid-template-columns: minmax(0, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .cards-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .method-timeline {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Adattamenti per schermi grandi */
@media (min-width: 1280px) {
    .hero h1 {
        font-size: var(--text-4xl);
    }

    .section-title {
        font-size: var(--text-2xl);
    }
}

/* ========================
   DROPDOWN PERFETTO DESKTOP
======================== */
@media (min-width: 901px) {

    .dropdown {
        position: relative;
    }

    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--color-surface);
        min-width: 240px;
        border-radius: var(--radius-xs);
        box-shadow: var(--shadow-md);
        padding: var(--space-3) 0;
        display: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity .15s ease, transform .15s ease;
        transform: translateY(10px);
        z-index: 9999;
    }

    .dropdown:hover > .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0);
    }
}


/* -------------------------------------
   PULSANTE AREA RISERVATA (HEADER) — discreto
-------------------------------------- */
.btn-area-riservata {
    padding: var(--space-1) var(--space-3);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xs);
    color: var(--color-text-inverse-muted) !important;
    font-weight: 500;
    font-size: var(--text-sm);
    transition: 0.2s ease;
}

.btn-area-riservata:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-inverse) !important;
    border-color: rgba(255, 255, 255, 0.5);
}

@supports (padding-top: env(safe-area-inset-top)) {
    .site-header {
        padding-top: env(safe-area-inset-top);
    }
}

@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .service-card-premium,
    .portfolio-card,
    .method-step {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* -------------------------------------
   WHATSAPP FAB — icona sola, cerchio verde
-------------------------------------- */
.whatsapp-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.whatsapp-fab:focus {
    outline: 3px solid rgba(37, 211, 102, 0.35);
    outline-offset: 3px;
}

.whatsapp-fab__icon {
    width: 28px;
    height: 28px;
    display: block;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
}