:root {
    --tim-blue: #025395;
    --tim-blue-dark: #002d85;
    --tim-red: #e4002b;
    --tim-green: #04b88f;
    --ink: #182a79;
    --bg-soft: #f5f8fc;
}

body.home,
body.page-template-page-grazie {
    font-family: 'Montserrat', system-ui, sans-serif;
    color: #1a1a1a;
}

body.home h1,
body.home h2,
body.home h3,
body.home h4 {
    font-family: 'Roboto', system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.home-hero {
    position: relative;
    background: linear-gradient(135deg, var(--tim-blue) 0%, var(--tim-blue-dark) 100%);
    color: #fff;
    padding: 110px 0 90px;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/hero.webp') center/cover no-repeat;
    opacity: 0.15;
    z-index: 0;
}

.home-hero .container {
    position: relative;
    z-index: 1;
}

.home-hero .eyebrow {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.home-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.05;
    margin: 0 0 0.5rem;
    font-style: italic;
}

.home-hero .hero-slogan {
    font-size: 1.35rem;
    font-weight: 600;
    font-style: italic;
    margin: 0 0 1rem;
    color: #ffd84d;
}

.home-hero h1 .accent {
    color: #ffd84d;
    display: inline-block;
    text-shadow: 3px 3px 0 var(--tim-red);
}

.home-hero p.lead {
    font-size: 1.15rem;
    max-width: 560px;
    line-height: 1.55;
    margin: 0 0 2rem;
    color: rgba(255, 255, 255, 0.92);
}

.home-hero .hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-tim {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    border: 2px solid transparent;
}

.btn-tim-primary {
    background: var(--tim-red);
    color: #fff;
    box-shadow: 0 8px 24px rgba(228, 0, 43, 0.35);
}

.btn-tim-primary:hover {
    transform: translateY(-2px);
    background: #b80022;
    color: #fff;
    box-shadow: 0 12px 28px rgba(228, 0, 43, 0.45);
}

.btn-tim-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.btn-tim-ghost:hover {
    background: #fff;
    color: var(--tim-blue);
    transform: translateY(-2px);
}

.btn-tim-light {
    background: #fff;
    color: var(--tim-blue);
}

.btn-tim-light:hover {
    background: #fff;
    color: var(--tim-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.section {
    padding: 90px 0;
}

/* Template "Raccolta Offerte": section più compatte (solo queste pagine) */
.page-template-page-offerte-selezionate .section {
    padding: 25px 0;
}

.section-bg-light {
    background: var(--bg-soft);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title .kicker {
    display: inline-block;
    color: var(--tim-red);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    color: var(--ink);
    margin: 0 0 0.75rem;
}

.section-title p {
    max-width: 640px;
    margin: 0 auto;
    color: #555;
    font-size: 1.05rem;
    line-height: 1.55;
}

.offer-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.75rem;
}

/* 3 per riga: ogni card occupa ~1/3 della larghezza (sottratti i gap),
   ma le righe incomplete restano centrate grazie a justify-content. */
.offer-card-home {
    flex: 0 1 calc(33.333% - 1.17rem);
    max-width: 360px;
}

@media (max-width: 991px) {
    .offer-card-home {
        flex-basis: calc(50% - 0.875rem);
    }
}

@media (max-width: 575px) {
    .offer-card-home {
        flex-basis: 100%;
    }
}

.offer-card-home {
    display: block;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(2, 83, 149, 0.08);
    border: 1px solid #e6edf5;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    text-decoration: none;
}

.offer-card-home:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(2, 83, 149, 0.18);
}

.offer-card-home .card-media {
    position: relative;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #e9f2fc 0%, #c9def5 100%);
    overflow: hidden;
}

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

.offer-card-home .discount-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--tim-red);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(228, 0, 43, 0.35);
}

.offer-card-home .card-body {
    padding: 1.1rem 1.25rem 1.35rem;
}

.offer-card-home .card-title-offer {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

.offer-card-home .card-price {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #555;
}

.offer-card-home .card-price strong {
    color: var(--tim-red);
    font-size: 1.35rem;
    font-weight: 800;
}

.offer-card-home .card-desc {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
}

.offer-card-home .card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tim-blue);
}

.offer-card-home:hover .card-cta {
    gap: 0.7rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-grid .about-copy h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--ink);
    margin-bottom: 1rem;
}

.about-grid .about-copy p {
    color: #444;
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

.about-stat {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 18px rgba(2, 83, 149, 0.08);
    border-top: 4px solid var(--tim-blue);
}

.about-stat .num {
    font-family: 'Roboto', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--tim-blue);
    line-height: 1;
}

.about-stat .lbl {
    color: #555;
    font-size: 0.9rem;
    margin-top: 0.35rem;
    display: block;
}

.about-illustration {
    position: relative;
    aspect-ratio: 4/5;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--tim-blue) 0%, var(--tim-blue-dark) 100%);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(2, 83, 149, 0.25);
}

.about-illustration::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/hero.webp') center/cover no-repeat;
    opacity: 0.25;
}

.about-illustration .badge-overlay {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.95);
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.about-illustration .badge-overlay strong {
    display: block;
    color: var(--tim-blue);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.about-illustration .badge-overlay span {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 700;
}

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

.service-card {
    display: block;
    background: #fff;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid #e6edf5;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

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

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(2, 83, 149, 0.12);
    border-color: var(--tim-blue);
}

.service-card .service-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tim-blue) 0%, var(--tim-blue-dark) 100%);
    border-radius: 16px;
    color: #fff;
    font-size: 1.75rem;
}

.service-card h3 {
    color: var(--ink);
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
}

.service-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.contact-section {
    background: linear-gradient(135deg, var(--tim-blue) 0%, var(--tim-blue-dark) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.contact-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/hero.webp') center/cover no-repeat;
    opacity: 0.1;
}

.contact-section .container {
    position: relative;
    z-index: 1;
}

.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-copy h2 {
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin: 0 0 1rem;
}

.contact-copy p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.contact-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 1rem;
}

.contact-features li i {
    color: var(--tim-green);
    font-size: 1.2rem;
}

.lead-form-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    color: #1a1a1a;
}

.lead-form-card h3 {
    color: var(--ink);
    font-size: 1.4rem;
    margin: 0 0 0.35rem;
    text-align: center;
}

.lead-form-card .form-sub {
    color: #666;
    font-size: 0.95rem;
    text-align: center;
    margin: 0 0 1.5rem;
}

.lead-form-card .form-group {
    margin-bottom: 1rem;
}

.lead-form-card label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lead-form-card input[type="tel"],
.lead-form-card input[type="text"],
.lead-form-card input[type="email"],
.lead-form-card textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #d8e1ec;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    color: #1a1a1a;
}

.lead-form-card textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.45;
}

.lead-form-card input[type="tel"]:focus,
.lead-form-card input[type="text"]:focus,
.lead-form-card input[type="email"]:focus,
.lead-form-card textarea:focus {
    outline: none;
    border-color: var(--tim-blue);
    box-shadow: 0 0 0 4px rgba(2, 83, 149, 0.12);
}

.lead-form-card .privacy-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1rem 0 1.25rem;
    font-size: 0.78rem;
    color: #666;
    line-height: 1.4;
}

.lead-form-card .privacy-row input {
    margin-top: 3px;
    flex-shrink: 0;
}

.lead-form-card .privacy-row a {
    color: var(--tim-blue);
    text-decoration: underline;
}

.lead-form-card button[type="submit"] {
    width: 100%;
    background: var(--tim-red);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(228, 0, 43, 0.3);
}

.lead-form-card button[type="submit"]:hover {
    background: #b80022;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(228, 0, 43, 0.4);
}

.lead-form-card .form-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.lead-form-card .form-success,
.lead-form-card .form-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.wa-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.2s ease;
}

.wa-float:hover {
    transform: scale(1.08);
    color: #fff;
}

.grazie-wrap {
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, var(--tim-blue) 0%, var(--tim-blue-dark) 100%);
    display: flex;
    align-items: center;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.grazie-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/hero.webp') center/cover no-repeat;
    opacity: 0.12;
}

.grazie-card {
    background: #fff;
    border-radius: 22px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    z-index: 1;
}

.grazie-card .check {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--tim-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.4rem;
    box-shadow: 0 12px 30px rgba(4, 184, 143, 0.4);
}

.grazie-card h1 {
    color: var(--ink);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin: 0 0 1rem;
}

.grazie-card p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.grazie-steps {
    background: var(--bg-soft);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: left;
    margin: 1.5rem 0 2rem;
    border-left: 4px solid var(--tim-blue);
}

.grazie-steps h3 {
    color: var(--tim-blue);
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.grazie-steps ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

.grazie-steps ul li {
    padding: 0.35rem 0 0.35rem 1.6rem;
    position: relative;
}

.grazie-steps ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--tim-green);
    font-weight: 800;
}

.grazie-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 992px) {
    .about-grid,
    .contact-wrap {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .home-hero {
        padding: 80px 0 60px;
    }
    .section {
        padding: 64px 0;
    }
}

@media (max-width: 576px) {
    .grazie-card {
        padding: 2rem 1.5rem;
    }
    .lead-form-card {
        padding: 1.75rem 1.25rem;
    }
}

/* ===== 404 ===== */
.error-hero {
    background: linear-gradient(135deg, var(--tim-blue) 0%, var(--tim-blue-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 4.5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.error-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/hero.webp') center/cover no-repeat;
    opacity: 0.12;
}

.error-hero .container { position: relative; z-index: 1; }

.error-code {
    font-family: 'Roboto', system-ui, sans-serif;
    font-weight: 900;
    font-size: clamp(5rem, 16vw, 9rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: #ffd84d;
    text-shadow: 4px 4px 0 var(--tim-red);
    margin-bottom: 0.5rem;
}

.error-hero h1 {
    font-family: 'Roboto', system-ui, sans-serif;
    font-weight: 900;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    margin: 0 0 1rem;
}

.error-hero p {
    max-width: 560px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-offers { padding: 3.5rem 0 4.5rem; }
