/* =========================================================
   Dott. Ing. Alessio Zanghi - Automazioni su misura
   Palette: blu notte #0B1E36, bianco, grigi chiari, rame (dal logo)
   Font: Source Serif 4 (titoli) + Inter (testo)
   ========================================================= */

:root {
    --primary-color: #0B1E36;
    --primary-dark: #06121F;
    --secondary-color: #33465F;
    --accent-color: #C4915F;      /* rame del logo: linee, bordi, dettagli su scuro */
    --accent-text: #8F6236;       /* rame scurito: testo su bianco (contrasto AA) */
    --color-primary: var(--primary-color);
    --text-dark: #333;
    --text-body: #3B4656;
    --text-light: #fff;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-soft: #F3F5F8;
    --bg-dark: #0B1E36;
    --border-color: #E1E5EB;
    --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --radius: 10px;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

html { scroll-behavior: auto; }

body {
    font-family: var(--font-sans);
    color: var(--text-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.2;
}

a { color: var(--primary-color); text-decoration-color: var(--accent-color); text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }

img { max-width: 100%; height: auto; }

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

/* ---------- Animazioni reveal ---------- */
.js .reveal { opacity: 0; }
.js .reveal.animated { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; }
    .animated { animation: none !important; }
}

/* ---------- Navbar ---------- */
.navbar {
    padding: 0.85rem 0;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: box-shadow 0.3s ease, padding 0.3s ease, background 0.3s ease;
}
.navbar.scrolled {
    background: #fff;
    box-shadow: 0 1px 0 var(--border-color), 0 6px 24px rgba(11, 30, 54, 0.06);
    padding: 0.6rem 0;
}
.navbar .container { flex-wrap: nowrap; gap: 1rem; }
.navbar-brand { gap: 0.85rem; margin-right: 0; min-width: 0; }

/* Logo leggibile sullo sfondo chiaro della navbar: wrap neutro (stesso pattern del footer) */
.logo-wrap { display: inline-block; background: #fff; border-radius: 50%; padding: 0; line-height: 0; }
.logo-wrap img, .navbar-logo { height: 50px; width: auto; display: block; }


.btn-call {
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    padding: 0.55rem 1.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
}
.btn-call:hover, .btn-call:focus { background: #fff; color: var(--primary-color); border-color: var(--primary-color); }

.navbar-tagline {
    margin: 0;
    text-align: center;
    flex: 1 1 auto;
    pointer-events: none;
}
.navbar-tagline-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.005em;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 1.5px solid var(--accent-color);
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(11, 30, 54, 0.28), 0 0 0 0 rgba(196,145,95,0.45);
    animation: taglinePillPulse 2.8s ease-in-out infinite;
}
.navbar-tagline-pill i { color: var(--accent-color); font-size: 0.9em; }
@keyframes taglinePillPulse {
    0%, 100% { box-shadow: 0 4px 18px rgba(11, 30, 54, 0.28), 0 0 0 0 rgba(196,145,95,0.45); }
    50%      { box-shadow: 0 4px 18px rgba(11, 30, 54, 0.28), 0 0 0 6px rgba(196,145,95,0); }
}
@media (prefers-reduced-motion: reduce) { .navbar-tagline-pill { animation: none; } }
@media (max-width: 1199.98px) {
    .navbar-tagline-pill { font-size: 0.92rem; padding: 0.5rem 1.15rem; }
}

/* ---------- Bottoni ---------- */
.btn { font-weight: 600; letter-spacing: 0.01em; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; border-radius: 999px; }

.btn-primary-navy { background: var(--primary-color); color: #fff; border: 2px solid var(--primary-color); }
.btn-primary-navy:hover, .btn-primary-navy:focus { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-outline-navy { background: transparent; color: var(--primary-color); border: 2px solid var(--primary-color); }
.btn-outline-navy:hover, .btn-outline-navy:focus { background: var(--primary-color); color: #fff; }

.btn-copper { background: var(--accent-color); color: var(--primary-color); border: 2px solid var(--accent-color); }
.btn-copper:hover, .btn-copper:focus { background: #d4a575; border-color: #d4a575; color: var(--primary-color); }

/* ---------- Tipografia sezioni ---------- */
.section { padding: 6.5rem 0; }
.section-head { max-width: 760px; margin-bottom: 3.5rem; }

.eyebrow {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--accent-color); flex-shrink: 0; }
.eyebrow-light { color: var(--accent-color); }

.section-title { font-size: clamp(1.85rem, 3.4vw, 2.6rem); margin-bottom: 1.25rem; letter-spacing: -0.01em; }
.section-intro { font-size: 1.15rem; color: var(--text-body); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 11.5rem 0 4.5rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,0) 60%, #fff 100%),
        linear-gradient(90deg, rgba(11,30,54,0.045) 1px, transparent 1px) 0 0 / 72px 72px,
        linear-gradient(0deg, rgba(11,30,54,0.045) 1px, transparent 1px) 0 0 / 72px 72px,
        #fff;
    border-bottom: 1px solid var(--border-color);
}
.hero-title {
    font-size: clamp(2.3rem, 5.4vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-bottom: 1.6rem;
}
.hero-title-accent { display: block; color: var(--secondary-color); font-style: italic; font-weight: 400; }
.hero-lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 680px; margin-bottom: 2.25rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 1.1rem; }
.hero-note { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 0; }

/* ---------- Hero: animazione email (colonna destra) ---------- */
.hero-anim { display: flex; justify-content: center; }
.hero-anim-stage {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 280px;
    overflow: visible;
}
.mail-inbox {
    position: absolute;
    top: 14px;
    left: 8px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    z-index: 2;
    box-shadow: 0 6px 16px rgba(11,30,54,0.25);
}
.mail-inbox::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid var(--accent-color);
    opacity: 0.6;
    animation: inboxPulse 2.6s ease-out infinite;
}
@keyframes inboxPulse {
    0%   { transform: scale(0.85); opacity: 0.6; }
    70%  { transform: scale(1.4); opacity: 0; }
    100% { opacity: 0; }
}
.mail-card {
    position: absolute;
    top: 26px;
    left: 6px;
    width: 92px;
    height: 56px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(11,30,54,0.1);
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    opacity: 0;
    z-index: 3;
    animation: mailTravel 10s linear infinite;
}
.mail-card i { display: block; height: 3px; border-radius: 2px; background: var(--border-color); }
.mail-card i:nth-child(1) { width: 85%; }
.mail-card i:nth-child(2) { width: 100%; }
.mail-card i:nth-child(3) { width: 60%; }
.mail-card.mc-1 { --tx: 142px; --ty: 12px; --rot: -6deg; animation-delay: 0s; }
.mail-card.mc-2 { --tx: 286px; --ty: 12px; --rot: 6deg; animation-delay: 2.5s; }
.mail-card.mc-3 { --tx: 142px; --ty: 160px; --rot: -5deg; animation-delay: 5s; }
.mail-card.mc-4 { --tx: 286px; --ty: 160px; --rot: 5deg; animation-delay: 7.5s; border-color: var(--accent-color); }
@keyframes mailTravel {
    0%   { opacity: 0; transform: translate(0, 0) scale(0.8) rotate(0deg); }
    6%   { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
    20%  { opacity: 1; transform: translate(calc(var(--tx) * 0.5), calc(var(--ty) * 0.5 - 18px)) scale(0.92) rotate(var(--rot)); }
    32%  { opacity: 1; transform: translate(var(--tx), var(--ty)) scale(0.82) rotate(0deg); border-color: var(--border-color); box-shadow: 0 6px 18px rgba(11,30,54,0.1); }
    36%  { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(196,145,95,0.4); }
    42%  { opacity: 0; transform: translate(var(--tx), calc(var(--ty) + 10px)) scale(0.58) rotate(0deg); border-color: var(--accent-color); }
    100% { opacity: 0; transform: translate(0, 0) scale(0.8) rotate(0deg); }
}
.mail-bins {
    position: absolute;
    left: 132px;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px 18px;
}
.mail-bin {
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-soft);
    color: var(--secondary-color);
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.4rem;
    position: relative;
}
.mail-bin.mb-1 { animation: binReceive 10s linear infinite; animation-delay: 3s; }
.mail-bin.mb-2 { animation: binReceive 10s linear infinite; animation-delay: 5.5s; }
.mail-bin.mb-3 { animation: binReceive 10s linear infinite; animation-delay: 8s; }
.mail-bin.mb-4 { animation: binReceive 10s linear infinite; animation-delay: 10.5s; }
@keyframes binReceive {
    0%   { border-color: var(--border-color); box-shadow: none; transform: scale(1); }
    2%   { border-color: var(--accent-color); box-shadow: 0 0 0 5px rgba(196,145,95,0.22); transform: scale(1.045); }
    9%   { border-color: var(--accent-color); box-shadow: 0 0 0 5px rgba(196,145,95,0.22); transform: scale(1.045); }
    16%  { border-color: var(--border-color); box-shadow: none; transform: scale(1); }
    100% { border-color: var(--border-color); box-shadow: none; transform: scale(1); }
}
.mail-urgent-badge {
    position: absolute;
    top: 128px;
    right: 4px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--accent-color);
    z-index: 5;
    opacity: 0;
    transform: translateY(4px) scale(0.92);
    animation: mailUrgentBadge 20s linear infinite;
    animation-delay: 7.5s;
}
@keyframes mailUrgentBadge {
    0%   { opacity: 0; transform: translateY(4px) scale(0.92); }
    15%  { opacity: 0; }
    17%  { opacity: 1; transform: translateY(0) scale(1); }
    27%  { opacity: 1; transform: translateY(0) scale(1); }
    32%  { opacity: 0; transform: translateY(4px) scale(0.92); }
    100% { opacity: 0; }
}
@media (max-width: 991.98px) {
    .hero-anim { margin-top: 2.5rem; }
    .hero-anim-stage { max-width: 320px; height: 220px; }
    .mail-inbox { top: 10px; left: 8px; width: 36px; height: 36px; font-size: 0.85rem; }
    .mail-card { top: 20px; left: 2px; width: 72px; height: 44px; padding: 8px 10px; gap: 5px; }
    .mail-bins { left: 102px; gap: 12px 14px; }
    .mail-bin { font-size: 0.68rem; }
    .mail-card.mc-1 { --tx: 115px; --ty: 10px; }
    .mail-card.mc-2 { --tx: 231px; --ty: 10px; }
    .mail-card.mc-3 { --tx: 115px; --ty: 126px; }
    .mail-card.mc-4 { --tx: 231px; --ty: 126px; }
    .mail-urgent-badge { font-size: 0.6rem; padding: 0.25rem 0.5rem; top: 96px; right: 3px; }
}
@media (prefers-reduced-motion: reduce) {
    .mail-card { animation: none !important; opacity: 0; display: none; }
    .mail-bin { animation: none !important; border-color: var(--border-color) !important; box-shadow: none !important; transform: none !important; }
    .mail-urgent-badge { animation: none !important; opacity: 0; display: none; }
    .mail-inbox::after { animation: none !important; opacity: 0; }
}

/* ---------- Problema ---------- */
.lead-list { font-size: 1.2rem; color: var(--primary-color); font-weight: 500; }
.statement {
    margin: 2.25rem 0 0;
    padding: 1.5rem 0 1.5rem 1.75rem;
    border-left: 3px solid var(--accent-color);
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2.2vw, 1.6rem);
    line-height: 1.4;
    color: var(--primary-color);
}

/* ---------- Metodo: step orizzontali / verticali ---------- */
.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    position: relative;
}
.steps::before {
    content: '';
    position: absolute;
    top: 1.6rem;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-color);
    opacity: 0.6;
}
.steps::after {
    content: '';
    position: absolute;
    z-index: 0;
    top: 1.6rem;
    left: 0;
    width: 14px;
    height: 14px;
    margin-top: -6.5px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 5px rgba(196,145,95,0.18), 0 0 10px rgba(196,145,95,0.5);
    animation: stepsRunner 7s ease-in-out infinite;
}
@keyframes stepsRunner {
    0%   { left: 0; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { left: calc(100% - 14px); opacity: 0; }
}
@keyframes stepsRunnerVertical {
    0%   { top: 0; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { top: calc(100% - 14px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .steps::after { animation: none; display: none; } }
.step { position: relative; padding-top: 0; }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 6px var(--bg-soft);
    margin-bottom: 1.4rem;
}
.step-title { font-size: 1.45rem; margin-bottom: 0.6rem; }
.step p { margin-bottom: 0; font-size: 1rem; }

/* ---------- Esempi: griglia con separatori ---------- */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}
.example {
    padding: 2rem 2rem 2.1rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    transition: background 0.25s ease;
}
.example:hover { background: var(--bg-soft); }
.example h3 {
    position: relative;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    padding-top: 0.9rem;
    border-top: 2px solid var(--accent-color);
    display: inline-block;
}
.example h3::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 45%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    transform: translateX(-130%);
    opacity: 0;
}
.example.animated h3::before { animation: exampleShine 0.9s ease-out forwards; }
.example:nth-child(2).animated h3::before { animation-delay: 0.08s; }
.example:nth-child(3).animated h3::before { animation-delay: 0.16s; }
.example:nth-child(4).animated h3::before { animation-delay: 0.24s; }
.example:nth-child(5).animated h3::before { animation-delay: 0.32s; }
.example:nth-child(6).animated h3::before { animation-delay: 0.4s; }
@keyframes exampleShine {
    0%   { transform: translateX(-130%); opacity: 0.9; }
    100% { transform: translateX(260%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .example h3::before { display: none; } }
.example p { margin-bottom: 0; font-size: 0.98rem; }
.examples-note { margin: 2.5rem 0 0; font-size: 1.1rem; color: var(--primary-color); }
.examples-note a { font-weight: 600; }

/* ---------- Supervisione ---------- */
.control-points { margin-top: 2.5rem; }
.control-point {
    height: 100%;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1.75rem;
}
.control-point h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.control-point p { margin-bottom: 0; font-size: 1rem; }

/* ---------- Caso reale (blu notte) ---------- */
.section-case { background: var(--primary-color); color: rgba(255,255,255,0.82); }
.section-case h2, .section-case h3, .section-case h4 { color: #fff; }
.case-intro { color: rgba(255,255,255,0.85); }
.case-subtitle {
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
    margin: 3.5rem 0 1.75rem;
    font-weight: 500;
}
.case-points {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.14);
}
.case-point { padding: 1.5rem 1.75rem 0 0; }
.case-point + .case-point { padding-left: 1.75rem; border-left: 1px solid rgba(255,255,255,0.14); }
.case-point h4 {
    font-family: var(--font-sans);
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
    color: var(--accent-color);
}
.case-point p { font-size: 0.97rem; margin-bottom: 0; }
.case-system { margin-top: 2.5rem; }
.case-text { color: rgba(255,255,255,0.82); }
.case-text strong { color: #fff; }

/* Schema hub */
.hub {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}
.hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-lines line { stroke: var(--accent-color); stroke-width: 1.4; stroke-dasharray: 5 4; opacity: 0.85; vector-effect: non-scaling-stroke; }
.hub-pulse-line {
    stroke: #E8B583;
    stroke-width: 2.2;
    stroke-dasharray: 10 999;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: 0;
    animation: hubPulseTravel 9s linear infinite;
    filter: drop-shadow(0 0 2px rgba(196,145,95,0.9));
}
.hub-pulse-line.hp-1 { animation-delay: 0s; }
.hub-pulse-line.hp-2 { animation-delay: 1.5s; }
.hub-pulse-line.hp-3 { animation-delay: 3s; }
.hub-pulse-line.hp-4 { animation-delay: 4.5s; }
.hub-pulse-line.hp-5 { animation-delay: 6s; }
.hub-pulse-line.hp-6 { animation-delay: 7.5s; }
@keyframes hubPulseTravel {
    0%   { stroke-dashoffset: 46; opacity: 0; }
    3%   { opacity: 1; }
    16%  { stroke-dashoffset: -12; opacity: 1; }
    20%  { opacity: 0; stroke-dashoffset: -12; }
    100% { opacity: 0; stroke-dashoffset: 46; }
}
@media (prefers-reduced-motion: reduce) {
    .hub-pulse-line { animation: none !important; opacity: 0; }
}
.hub-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36%;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    border: 4px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.2;
    padding: 0.75rem;
    z-index: 2;
    box-shadow: 0 0 0 10px rgba(196,145,95,0.12);
}
.hub-node {
    position: absolute;
    transform: translate(-50%, -50%);
    background: var(--primary-dark);
    border: 1px solid rgba(196,145,95,0.7);
    color: #fff;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 2;
}
.hub-node.n1 { left: 50%; top: 11%; }
.hub-node.n2 { left: 84%; top: 30.5%; }
.hub-node.n3 { left: 84%; top: 69.5%; }
.hub-node.n4 { left: 50%; top: 89%; }
.hub-node.n5 { left: 16%; top: 69.5%; }
.hub-node.n6 { left: 16%; top: 30.5%; }

.case-closing {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255,255,255,0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.case-quote {
    font-family: var(--font-serif);
    font-size: clamp(1.15rem, 1.9vw, 1.4rem);
    line-height: 1.5;
    color: #fff;
    max-width: 720px;
    margin: 0;
}

/* ---------- Primo passo ---------- */
.first-box {
    position: relative;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--radius);
    padding: clamp(2rem, 4vw, 3.5rem);
    background: #fff;
    box-shadow: 0 10px 40px rgba(11,30,54,0.05);
}
.first-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius) 0 0 var(--radius);
    animation: firstBoxPulse 3.2s ease-in-out infinite;
}
@keyframes firstBoxPulse {
    0%, 100% { box-shadow: 0 0 10px 1px rgba(196,145,95,0.35); }
    50%      { box-shadow: 0 0 20px 4px rgba(196,145,95,0.65); }
}
@media (prefers-reduced-motion: reduce) { .first-box::before { animation: none; } }
.first-box .btn { white-space: normal; text-align: center; }

/* ---------- Chi sono ---------- */
.about-photo {
    position: relative;
    max-width: 440px;
    margin: 0 auto;
}
.about-photo::after {
    content: '';
    position: absolute;
    inset: 18px -18px -18px 18px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius);
    z-index: 0;
}
.about-photo picture, .about-photo img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    border-radius: var(--radius);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 15%;
}
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.stat { padding: 1.25rem 1rem 1.25rem 0; }
.stat + .stat { padding-left: 1.25rem; border-left: 1px solid var(--border-color); }
.stat-num {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(2rem, 3.2vw, 2.6rem);
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.stat-num-text { font-size: clamp(1.5rem, 2.4vw, 1.9rem); padding-top: 0.25rem; }
.stat-label { font-size: 0.92rem; color: var(--text-muted); }
.signature {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.35rem;
    color: var(--primary-color);
    white-space: nowrap;
    margin: 0;
}
.signature-sm { font-size: 1.15rem; margin-top: 1.5rem; }

/* ---------- FAQ ---------- */
.faq-accordion .accordion-item { border-bottom: 1px solid var(--border-color); background: transparent; }
.faq-accordion .accordion-item:first-child { border-top: 1px solid var(--border-color); }
.faq-accordion .accordion-header { margin: 0; }
.faq-accordion .accordion-button {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    background: transparent;
    padding: 1.35rem 0;
    box-shadow: none;
}
.faq-accordion .accordion-button:not(.collapsed) { color: var(--primary-color); background: transparent; }
.faq-accordion .accordion-button:focus { box-shadow: none; outline: 2px solid var(--accent-color); outline-offset: 2px; }
.faq-accordion .accordion-body { padding: 0 2.5rem 1.5rem 0; }

/* ---------- Contatti ---------- */
.contact-list { margin: 0; }
.contact-item { padding: 1.1rem 0; border-bottom: 1px solid var(--border-color); }
.contact-item:first-child { border-top: 1px solid var(--border-color); }
.contact-item dt {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-text);
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.contact-item dd { margin: 0; font-size: 1.08rem; color: var(--primary-color); font-weight: 500; }
.contact-item dd a { text-decoration: none; }
.contact-item dd a:hover { text-decoration: underline; }
.contact-wa-link { display: inline-block; margin-top: 0.3rem; font-size: 0.95rem; font-weight: 500; }
.contact-wa-link i { margin-right: 0.3rem; }

.form-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: clamp(1.5rem, 3.5vw, 2.5rem);
    box-shadow: 0 10px 40px rgba(11,30,54,0.06);
}
.form-label { font-weight: 600; font-size: 0.92rem; color: var(--primary-color); margin-bottom: 0.35rem; }
.form-control, .form-select {
    border: 1px solid #D3D9E1;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
}
.form-control:focus, .form-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 0.2rem rgba(11,30,54,0.12); }
.form-check-input:checked { background-color: var(--primary-color); border-color: var(--primary-color); }
.form-check-label { font-size: 0.95rem; }
.form-legal { color: var(--text-muted); }

.btn-submit {
    background: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 999px;
    padding: 0.8rem 2rem;
    font-size: 1rem;
}
.btn-submit:hover, .btn-submit:focus { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-submit:disabled { opacity: 0.75; }

/* Validazione form (obbligatorio) */
.form-control.is-invalid, .form-check-input.is-invalid { border-color: #dc3545 !important; box-shadow: 0 0 0 0.2rem rgba(220,53,69,0.25) !important; }
.form-check-input.is-invalid ~ .form-check-label { color: #dc3545; }

/* Toggle canale Messaggio / WhatsApp */
.form-channel-toggle { display: inline-flex; background: rgba(0,0,0,0.06); border-radius: 999px; padding: 4px; margin-bottom: 1.25rem; gap: 2px; }
.form-channel-toggle .channel-btn { border: none; background: transparent; color: var(--text-muted, #6c757d); padding: 8px 20px; border-radius: 999px; font-weight: 500; font-size: 0.92rem; cursor: pointer; transition: all 0.25s ease; display: inline-flex; align-items: center; }
.form-channel-toggle .channel-btn:hover { color: var(--color-primary, #1A1A1A); }
.form-channel-toggle .channel-btn.active { background: var(--color-primary, #1A1A1A); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.form-channel-toggle .channel-btn[data-channel="whatsapp"].active { background: #25D366; color: #fff; box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35); }
form#contactForm[data-channel="whatsapp"] .btn-submit { background: #25D366 !important; border-color: #25D366 !important; }
form#contactForm[data-channel="whatsapp"] .btn-submit:hover { background: #1da851 !important; border-color: #1da851 !important; }
@media (max-width: 480px) { .form-channel-toggle .channel-btn { padding: 7px 14px; font-size: 0.85rem; } }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.75);
    padding: 4.5rem 0 2rem;
    font-size: 0.95rem;
}
.site-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.site-footer a:hover { color: var(--accent-color); }
.footer-brand .footer-logo-wrap { display: inline-block; background: #fff; padding: 10px; border-radius: 10px; margin-bottom: 1rem; line-height: 0; }
.footer-brand .footer-logo-wrap img { height: 42px; width: auto; display: block; max-width: 100%; }
.footer-signature { font-family: var(--font-serif); font-size: 1.25rem; color: #fff; white-space: nowrap; margin-bottom: 0.5rem; }
.footer-claim { margin-bottom: 0; }
.footer-title {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 1rem;
}
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 0.5rem; }
.footer-legal { margin-bottom: 0.6rem; line-height: 1.65; }
.footer-legal strong { color: #fff; font-weight: 600; }
.footer-legal-note { font-size: 0.88rem; color: rgba(255,255,255,0.6); margin-bottom: 0; }
.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

/* ---------- WhatsApp FAB ---------- */
.wa-fab { position: fixed; right: 20px; bottom: 20px; width: 60px; height: 60px; border-radius: 50%; background: #25D366; color: #fff !important; display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); z-index: 9998; transition: transform 0.2s; text-decoration: none; animation: waPulse 2s infinite; }
.wa-fab:hover { transform: scale(1.08); color: #fff; }
@keyframes waPulse {
    0% { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 0 rgba(37,211,102,0.45); }
    70% { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 12px rgba(37,211,102,0); }
    100% { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 0 rgba(37,211,102,0); }
}
@media (max-width: 576px) { .wa-fab { width: 50px; height: 50px; font-size: 24px; right: 15px; bottom: 15px; } }
@media (prefers-reduced-motion: reduce) { .wa-fab { animation: none; } }

/* Badge reCAPTCHA: nascosto (su mobile si sovrappone al FAB WhatsApp). La dicitura richiesta da Google resta nel testo sotto il form. */
.grecaptcha-badge { visibility: hidden !important; }

/* Cookie icon: rame del brand, mai rosso */
#cookie-settings-icon { background: var(--accent-color, #C4915F) !important; color: var(--primary-color) !important; }
@media (max-width: 576px) { .cookie-settings-btn { left: 15px; bottom: 15px; width: 50px; height: 50px; } }

/* ---------- Pagina 404 ---------- */
.page-404 .navbar,
.page-404 .navbar.scrolled { background: #fff; box-shadow: 0 1px 0 var(--border-color), 0 6px 24px rgba(11, 30, 54, 0.06); }
.error-section { padding: 12rem 0 6rem; min-height: 70vh; display: flex; align-items: center; }
.error-code {
    font-family: var(--font-serif);
    font-size: clamp(5rem, 14vw, 9rem);
    font-weight: 600;
    line-height: 1;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.error-icon { font-size: 2.5rem; color: var(--accent-color); margin-bottom: 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .case-points { grid-template-columns: repeat(2, 1fr); }
    .case-point:nth-child(3) { padding-left: 0; border-left: none; }
    .case-point:nth-child(n+3) { margin-top: 1.5rem; }
}

@media (max-width: 991.98px) {
    .section { padding: 5rem 0; }
    .steps { grid-template-columns: 1fr; gap: 0; }
    .steps::before { top: 0; bottom: 0; left: 1.6rem; right: auto; width: 1px; height: auto; }
    .steps::after { top: 0; left: 1.6rem; right: auto; margin-top: 0; margin-left: -6.5px; animation-name: stepsRunnerVertical; }
    .step { display: grid; grid-template-columns: 3.2rem 1fr; column-gap: 1.5rem; padding-bottom: 2.25rem; }
    .step:last-child { padding-bottom: 0; }
    .step-num { grid-row: span 2; margin-bottom: 0; }
    .step-title { margin-top: 0.55rem; }
    .examples-grid { grid-template-columns: repeat(2, 1fr); }
    .case-closing { flex-direction: column; align-items: flex-start; }
    .hub { margin-top: 1rem; }
}

@media (max-width: 767.98px) {
    .hero { padding: 10.5rem 0 3.5rem; }
    .examples-grid { grid-template-columns: 1fr; }
    .case-points { grid-template-columns: 1fr; }
    .case-point, .case-point + .case-point { padding: 1.25rem 0; border-left: none; margin-top: 0; }
    .case-point + .case-point { border-top: 1px solid rgba(255,255,255,0.14); }

    /* Schema: cerchio sopra, elementi in griglia sotto */
    .hub { aspect-ratio: auto; max-width: none; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
    .hub-lines { display: none; }
    .hub-center { position: static; transform: none; width: 170px; }
    .hub-nodes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; width: 100%; position: relative; padding-top: 1.5rem; }
    .hub-nodes::before { content: ''; position: absolute; top: -1.5rem; left: 50%; width: 1px; height: 3rem; background: var(--accent-color); opacity: 0.7; }
    .hub-node { position: static; transform: none; text-align: center; white-space: normal; }

    .stats { grid-template-columns: 1fr 1fr 1fr; }
    .stat { padding-right: 0.5rem; }
    .stat + .stat { padding-left: 0.75rem; }
    .stat-num-text { font-size: 1.3rem; }
    .stat-label { font-size: 0.82rem; }

    .faq-accordion .accordion-body { padding-right: 0; }
    .site-footer { padding-bottom: 5.5rem; }
}

@media (max-width: 576px) {
    .navbar-logo, .logo-wrap img { height: 40px; }
    .btn-call { padding: 0.45rem 1rem; font-size: 0.88rem; }
    .hero-ctas .btn { width: 100%; }
    .about-photo::after { inset: 12px -12px -12px 12px; }
}

@media (max-width: 380px) {
    .navbar .container { gap: 0.5rem; }
    .btn-call { padding: 0.4rem 0.8rem; }
}
