/* ============================================
   Studio Tecnico Vegliach - CSS
   ============================================ */

/* --- Variables --- */
:root {
    --color-primary: rgb(47, 124, 255);
    --color-primary-dark: rgb(31, 82, 169);
    --color-primary-light: rgb(217, 231, 255);
    --color-secondary: rgb(241, 124, 32);
    --color-accent: rgb(78, 186, 154);
    --color-gray: rgb(105, 118, 139);
    --color-dark: rgb(43, 45, 66);
    --color-dark-nav: #11243d;
    --color-white: #ffffff;
    --color-light-bg: #e7e7e7;
    --color-text: #344165;
    --color-text-muted: #69768b;
    --color-purple: #5d639a;
    --font-main: 'Mulish', sans-serif;
    --container-max: 1200px;
    --header-height: 80px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-dark);
    background: var(--color-white);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--color-primary-dark); }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
.site-header {
    background: var(--color-dark-nav);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: padding 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(23, 25, 39, 0.3);
}

.site-header.scrolled .navbar {
    padding: 8px 0;
}

.site-header.scrolled .logo-img {
    height: 36px;
}

.navbar {
    padding: 20px 0;
    transition: padding 0.3s;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    padding: 0 5%;
}

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

.nav-menu {
    list-style: none;
    display: flex;
    gap: 8px;
}

.nav-menu a {
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white);
    transition: transform 0.3s;
}

.hamburger { position: relative; }
.hamburger::before,
.hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle.open .hamburger { background: transparent; }
.nav-toggle.open .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open .hamburger::after { top: 0; transform: rotate(-45deg); }

/* --- Hero Section (Home) --- */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: var(--color-dark-nav);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
}

.hero .container { position: relative; z-index: 2; width: 100%; }

/* --- Inner Page Header --- */
.page-header {
    background: var(--color-dark-nav);
    background-size: cover;
    background-position: center;
    padding: 80px 0;
    height: 280px;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(17, 36, 61, 0.7);
}

.page-header .container { position: relative; z-index: 2; width: 100%; }

.page-header h1 {
    color: var(--color-white);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Sections --- */
.section {
    padding: 80px 0;
}

.section-light { background: var(--color-white); }
.section-gray { background: var(--color-light-bg); }
.section-dark { background: var(--color-dark-nav); color: var(--color-white); }

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 16px;
}

.section-lead {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    max-width: 700px;
    line-height: 1.7;
}

.text-center { text-align: center; }
.text-center .section-lead { margin: 0 auto; }

/* --- Grid --- */
.grid {
    display: grid;
    gap: 40px;
}

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

.grid-center { align-items: center; }

/* --- Cards --- */
.card {
    background: var(--color-white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--color-primary);
    font-size: 1.4rem;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-dark);
}

.card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    text-align: justify;
}

/* --- Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-item .stat-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-item .stat-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* --- Servizi sidebar nav --- */
.servizi-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 50px;
    align-items: start;
}

.servizi-nav {
    position: sticky;
    top: 100px;
    list-style: none;
}

.servizi-nav li a {
    display: block;
    padding: 14px 20px;
    color: var(--color-dark);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.servizi-nav li a:hover,
.servizi-nav li a.active {
    border-left-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(47, 124, 255, 0.05);
}

.servizio-detail {
    background: var(--color-light-bg);
    padding: 40px;
    border-radius: 8px;
    min-height: 200px;
}

.servizio-detail h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-purple);
    margin-bottom: 16px;
}

.servizio-detail p {
    color: var(--color-text);
    line-height: 1.8;
    text-align: justify;
}

/* --- Contact Form --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: var(--color-dark);
    line-height: 2;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    font-family: var(--font-main);
    font-size: 16px;
    color: #666;
    background: var(--color-white);
    border: 1px solid #000;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(47, 124, 255, 0.15);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.btn {
    display: inline-block;
    padding: 10px 60px;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-white);
    background: var(--color-primary);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover { background: var(--color-primary-dark); color: var(--color-white); }

.alert {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success { background: rgb(177, 250, 159); border: 2px solid #000; color: var(--color-dark); }
.alert-error { background: rgb(255, 0, 0); border: 2px solid #000; color: var(--color-white); }

/* --- Map --- */
.map-container {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Chi Siamo --- */
.team-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
}

.team-image {
    border-radius: 8px;
    overflow: hidden;
}

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

/* --- Detrazioni --- */
.detrazioni-content {
    max-width: 800px;
    margin: 0 auto;
}

.detrazioni-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text);
}

/* --- Realizzazioni Gallery --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.gallery-item:hover img { transform: scale(1.05); }

/* --- Clienti/Partners --- */
.clienti-section img {
    max-height: 80px;
    width: auto;
    margin: 0 auto;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.clienti-section img:hover { opacity: 1; }

/* --- Footer --- */
.site-footer {
    background: var(--color-light-bg);
    padding: 24px 0;
    text-align: center;
}

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

/* --- Responsive --- */
@media (max-width: 1024px) {
    .servizi-layout {
        grid-template-columns: 1fr;
    }

    .servizi-nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 20px;
    }

    .servizi-nav li a {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-dark-nav);
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 4px;
        transition: right 0.3s;
        z-index: 200;
    }

    .nav-menu.open { right: 0; }

    .nav-menu a {
        display: block;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .nav-toggle { z-index: 300; }

    .nav-social {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .grid-2,
    .grid-3,
    .grid-4 { grid-template-columns: 1fr; }

    /* Hero mobile */
    .hero { min-height: 60vh; }

    .hero h1 {
        font-size: 3rem !important;
    }

    .hero h1 span {
        font-size: 1.4rem !important;
    }

    .hero p {
        font-size: 1rem !important;
    }

    /* Page headers mobile */
    .page-header { padding: 50px 0 30px; }
    .page-header h1 { font-size: 1.6rem; }
    .page-header h2 { font-size: 1rem !important; }
    .page-header p { font-size: 0.9rem; }

    /* Sections mobile */
    .section { padding: 40px 0; }
    .section-title { font-size: 1.5rem; }
    .section-subtitle { font-size: 1.2rem; }

    /* Cards mobile - 2 columns on tablet */
    .grid-4 { grid-template-columns: repeat(2, 1fr); }

    /* Servizi nav mobile - vertical list */
    .servizi-nav {
        flex-direction: column;
        gap: 2px;
    }

    .servizi-nav li a {
        padding: 10px 16px;
        font-size: 0.85rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .servizi-nav li a:hover,
    .servizi-nav li a.active {
        border-left-color: var(--color-primary);
        border-bottom: none;
    }

    /* Grid gap reduce */
    .grid { gap: 24px; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

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

    /* Footer */
    .site-footer p { font-size: 0.75rem; }

    /* Map */
    .map-container { height: 300px; }

    /* Team image */
    .team-image { max-height: 350px; }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.4rem !important;
    }

    .hero h1 span {
        font-size: 1.1rem !important;
        letter-spacing: 1px !important;
    }

    .hero p {
        font-size: 0.9rem !important;
    }

    .grid-4 { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }

    .page-header h1 { font-size: 1.3rem; }

    .section { padding: 30px 0; }

    .card { padding: 24px; }

    .container { padding: 0 16px; }

    .btn { padding: 10px 40px; }

    .servizio-detail { padding: 24px; }
}

/* --- WhatsApp Button --- */
.whatsapp-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn svg {
    width: 30px;
    height: 30px;
    fill: #ffffff;
}

/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-dark-nav);
    color: var(--color-white);
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
    display: none;
}

.cookie-banner.visible { display: block; }

.cookie-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.6;
    min-width: 280px;
}

.cookie-text a { color: var(--color-primary); }

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 10px 24px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.cookie-btn-accept {
    background: var(--color-primary);
    color: var(--color-white);
}

.cookie-btn-accept:hover { background: var(--color-primary-dark); }

.cookie-btn-reject {
    background: transparent;
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* --- Privacy Checkbox --- */
.form-group-checkbox {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-group-checkbox label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    cursor: pointer;
}

.form-group-checkbox label a {
    color: var(--color-primary);
}

/* Move WhatsApp button up when cookie banner is visible */
.cookie-banner.visible ~ .whatsapp-btn {
    bottom: 100px;
}

/* --- Screen reader only (SEO hidden text) --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Hide reCAPTCHA badge (allowed with v3 + attribution text) --- */
.grecaptcha-badge {
    visibility: hidden !important;
}

.recaptcha-notice {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 12px;
    line-height: 1.5;
}

.recaptcha-notice a {
    color: var(--color-text-muted);
    text-decoration: underline;
}

/* --- Footer Social Icons --- */
.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

.footer-social a {
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.footer-social a:hover {
    color: var(--color-primary);
}

/* --- Header Social Icons --- */
.nav-social {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-social a {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    padding: 4px;
}

.nav-social a:hover {
    color: var(--color-white);
    background: none;
}

/* --- Hero CTA Button --- */
.btn-hero {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 36px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--color-white);
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: none;
}

.btn-hero:hover {
    background: var(--color-white);
    color: var(--color-dark-nav);
    border-color: var(--color-white);
}

/* --- Servizi tabs: content visible by default for SEO --- */
.servizi-content {
    position: relative;
}

.servizio-detail.servizio-hidden {
    display: none;
}

/* --- Job Posting Styles --- */
.job-badge {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.job-section {
    background: var(--color-white);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-align: justify;
}

.job-section-highlight {
    background: var(--color-primary-light);
    border-color: transparent;
}

.job-section-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--color-primary);
}

.job-section-highlight .job-section-icon {
    background: var(--color-white);
}

.job-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 12px;
}

.job-section p {
    color: var(--color-text);
    line-height: 1.8;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.job-tag {
    display: inline-block;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.job-list {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.job-list li {
    padding: 6px 0 6px 28px;
    position: relative;
    color: var(--color-text);
    line-height: 1.6;
}

.job-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
}

.job-ral {
    margin-top: 16px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
}

.job-cta {
    text-align: center;
    margin: 50px 0 0;
    padding: 40px;
    background: var(--color-light-bg);
    border-radius: 12px;
}

.job-cta h3 {
    font-size: 1.3rem;
    color: var(--color-dark);
    margin-bottom: 12px;
}

.job-cta p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--color-text);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .job-section { padding: 24px; }
    .job-tags { gap: 6px; }
    .job-tag { font-size: 0.8rem; padding: 5px 12px; }
    .job-cta { padding: 24px; }
}
