:root {
    --orange: #db901b;
    --orange-hover: #c47f14;
    --black: #000000;
    --text-body: #555555;
    --text-dark: #2a2b39;
    --bg-white: #ffffff;
    --bg-light: #ebebeb;
    --bg-card: #ffffff;
    --border-light: #eee;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: 'Manrope', sans-serif;
    background: var(--bg-white);
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    font-weight: 400;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--black);
}

h1 { font-weight: 300; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; }
h2 { font-weight: 600; font-size: clamp(1.5rem, 3.5vw, 2.2rem); line-height: 1.25; }
h3 { font-weight: 600; font-size: 1.1rem; }

p { color: var(--text-body); font-size: 0.95rem; line-height: 1.7; }

.text-orange { color: var(--orange) !important; }

/* --- CTA Buttons (stile te.com: pill arrotondato, bold) --- */
.btn-tecom {
    background: var(--orange);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    padding: 14px 34px;
    border-radius: 36px;
    border: none;
    transition: background 0.2s, transform 0.15s;
    text-decoration: none;
    display: inline-block;
}

.btn-tecom:hover {
    background: var(--orange-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-tecom-sm {
    padding: 10px 24px;
    font-size: 0.85rem;
}

/* --- Top bar --- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
}

.topbar img { height: 50px; }

/* Offset scroll per la topbar sticky */
#form { scroll-margin-top: 50px; }

/* --- Hero --- */
.hero {
    padding-top: 140px;
    padding-bottom: 80px;
    background: linear-gradient(160deg, #fff 50%, #f7f0e5 100%);
}

.hero-visual {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.10);
    aspect-ratio: 16/9;
    background: var(--bg-light);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumb .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    background: var(--orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.video-thumb .play-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 22px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

.video-thumb:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.hero .badge-b2b {
    background: rgba(219, 144, 27, 0.1);
    color: var(--orange);
    font-weight: 700;
    font-size: 0.72rem;
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid rgba(219, 144, 27, 0.25);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 20px;
}

.hero h1 strong {
    font-weight: 700;
    color: var(--orange);
}

.hero .lead {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--text-body);
    font-weight: 400;
    max-width: 560px;
}

.stat-box {
    border-top: 1px solid var(--border-light);
    padding-top: 28px;
    margin-top: 48px;
}

.stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--orange);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-body);
}

/* --- Section labels --- */
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--orange);
    margin-bottom: 8px;
}

/* --- Cards --- */
.card-tecom {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 28px;
    height: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}

.card-tecom:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,0.09);
    border-color: rgba(219, 144, 27, 0.3);
    transform: translateY(-3px);
}

.card-tecom .icon-box {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(219, 144, 27, 0.15) 0%, rgba(219, 144, 27, 0.05) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--orange);
    margin-bottom: 16px;
}

.card-tecom h3 { margin-bottom: 8px; }
.card-tecom p { margin-bottom: 0; font-size: 0.9rem; }

/* --- Solution card con barra top arancione --- */
.card-solution { position: relative; overflow: hidden; }
.card-solution::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--orange);
}

/* --- Sezione su sfondo grigio chiaro --- */
.bg-light-section { background: var(--bg-light); }

/* --- Financing note --- */
.financing-note {
    background: linear-gradient(135deg, rgba(219, 144, 27, 0.08) 0%, rgba(219, 144, 27, 0.03) 100%);
    border: 1px solid rgba(219, 144, 27, 0.2);
    border-left: 4px solid var(--orange);
    border-radius: 14px;
    padding: 24px 28px;
    color: var(--text-dark);
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(219, 144, 27, 0.06);
}

/* --- Why grid --- */
.why-item { text-align: center; padding: 24px 12px; }

.why-item .icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(219, 144, 27, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.3rem;
    color: var(--orange);
}

.why-item h3 { font-size: 1.1rem; }
.why-item p { font-size: 0.9rem; }

/* --- Form --- */
.lead-form {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}

.lead-form .form-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.lead-form .form-control,
.lead-form .form-select {
    background: var(--bg-white);
    border: 1px solid #ddd;
    border-radius: 10px;
    color: var(--black);
    padding: 11px 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.92rem;
}

.lead-form .form-control::placeholder { color: #bbb; }

.lead-form .form-control:focus,
.lead-form .form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(219, 144, 27, 0.12);
}

.lead-form .form-check-input:checked {
    background-color: var(--orange);
    border-color: var(--orange);
}

.lead-form .form-check-label {
    font-size: 0.8rem;
    color: var(--text-body);
}

.lead-form .form-check-label a {
    color: var(--orange);
    text-decoration: none;
}

.form-privacy-note {
    font-size: 0.75rem;
    color: var(--text-body);
    text-align: center;
}

/* --- Validazione form --- */
.lead-form .form-control.is-invalid,
.lead-form .form-select.is-invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.lead-form .form-control.is-invalid:focus,
.lead-form .form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.lead-form .form-check-input.is-invalid {
    border-color: #dc3545;
}

.lead-form .form-check.is-invalid .form-check-label {
    color: #dc3545;
}

.field-error {
    display: none;
    color: #dc3545;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 5px;
    line-height: 1.3;
}

.field-error.visible {
    display: block;
    animation: errorFadeIn 0.2s ease;
}

.field-error::before {
    content: '⚠ ';
    margin-right: 2px;
}

@keyframes errorFadeIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-summary-error {
    display: none;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    color: #842029;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.form-summary-error.visible {
    display: block;
}

.form-success {
    display: none;
    text-align: center;
    padding: 48px 20px;
}

.form-success h3 { margin-bottom: 10px; }
.form-success p { color: var(--text-body); }

.form-success .icon-success {
    font-size: 3rem;
}

/* --- Footer --- */
.footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    padding: 36px 0;
}

.footer img { height: 30px; }

.footer a {
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

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

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-body);
}

/* --- Fade-in --- */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Utility --- */
.max-w-580 { max-width: 580px; }
.max-w-620 { max-width: 620px; }

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .hero-visual-mobile {
        display: block;
    }

    .hero .col-lg-6:last-child {
        display: none;
    }

    .stat-box .row {
        flex-direction: column;
        gap: 12px !important;
    }
}

@media (min-width: 992px) {
    .hero-visual-mobile {
        display: none;
    }
}

.hero-visual-mobile {
    margin-top: 40px;
}

.hero-visual-mobile .hero-visual {
    aspect-ratio: 16/9;
    margin-bottom: 45px;
}

@media (max-width: 767.98px) {
    .hero { padding-top: 40px !important; padding-bottom: 60px !important; }
    .hero .container { text-align: center; }
    .hero .lead { margin-left: auto; margin-right: auto; }
    .hero .stat-box .row { justify-content: center; }
    .lead-form { padding: 24px 20px; }
    section { padding-top: 56px !important; padding-bottom: 56px !important; }

    /* Topbar non sticky su mobile, solo logo centrato */
    .topbar {
        position: static;
        background: #fff;
        backdrop-filter: none;
    }
    .topbar .container {
        justify-content: center !important;
    }
    .topbar .btn-tecom { display: none; }
}
