/* Video in homepage: due telefoni che "squillano", il tasto verde fa partire il video.
   HTML in includes/home-video.php, JS in assets/js/home-video.js. Stessa sezione del sito beevoip.it, nei colori AI4CALL. */
.a4v {
    position: relative; overflow: hidden; padding: 112px 0 96px;
    background:
        radial-gradient(42% 60% at 76% 48%, rgba(255, 0, 0, 0.16), transparent 70%),
        linear-gradient(180deg, #08080f 0%, #000 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.a4v-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px 80px; align-items: center; }

.a4v-label {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 6px 16px; border-radius: 50px;
    background: rgba(255, 0, 0, 0.15); border: 1px solid rgba(255, 0, 0, 0.35); color: #ff4444;
    font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
.a4v-label-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4444; animation: a4v-pulse 1.5s infinite; }
@keyframes a4v-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); } 50% { box-shadow: 0 0 0 8px rgba(255, 68, 68, 0); } }

.a4v .a4v-title {
    margin: 0; max-width: 16ch; font-family: var(--font-display, 'Sora', sans-serif); font-size: clamp(32px, 3.6vw, 50px);
    font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; color: #fff;
}
.a4v .a4v-title span { color: #ff2a2a; }
.a4v .a4v-lead { margin: 22px 0 0; max-width: 44ch; font-size: 18px; line-height: 1.65; color: #b0b0b0; }
.a4v .a4v-go { margin-top: 30px; }
.a4v .a4v-note { display: flex; gap: 8px; align-items: center; margin: 22px 0 0; font-size: 14px; color: #8a8a94; }
.a4v-note svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.a4v-phones { display: flex; gap: 32px; align-items: flex-start; padding-bottom: 40px; }
.a4v-item { width: clamp(180px, 18vw, 250px); margin: 0; }
.a4v-item:nth-child(2) { margin-top: 48px; }
.a4v .a4v-item figcaption { margin-top: 18px; font-family: var(--font-display, 'Sora', sans-serif); font-size: 15px; font-weight: 600; line-height: 1.35; color: #fff; }

/* il telefono */
.a4v-phone {
    position: relative; aspect-ratio: 9 / 16; border-radius: 32px; padding: 7px; background: #0b0b10; overflow: hidden; isolation: isolate;
    box-shadow: inset 0 0 0 1.5px #3a3a46, 0 0 0 1px rgba(255, 255, 255, 0.04), 0 40px 70px -24px rgba(0, 0, 0, 0.9), 0 0 60px -20px rgba(255, 0, 0, 0.45);
    transform: rotate(-2deg); transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.45s ease;
}
.a4v-item:nth-child(2) .a4v-phone { transform: rotate(2deg); }
.a4v-phone:hover, .a4v-phone.is-playing,
.a4v-item:nth-child(2) .a4v-phone:hover, .a4v-item:nth-child(2) .a4v-phone.is-playing {
    transform: rotate(0) translateY(-6px);
    box-shadow: inset 0 0 0 1.5px #4a4a58, 0 0 0 1px rgba(255, 255, 255, 0.06), 0 48px 80px -24px rgba(0, 0, 0, 0.95), 0 0 80px -16px rgba(255, 0, 0, 0.55);
}
.a4v-phone::before { content: ""; position: absolute; z-index: 3; top: 15px; left: 50%; width: 64px; height: 18px; margin-left: -32px; border-radius: 10px; background: #0b0b10; pointer-events: none; }
.a4v-poster, .a4v-phone iframe { position: absolute; inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); border: 0; border-radius: 25px; object-fit: cover; background: #1a1a22; }
.a4v-phone iframe { z-index: 4; }

/* la barra "in linea" in alto */
.a4v .a4v-call {
    position: absolute; z-index: 2; top: 44px; left: 16px; right: 16px; display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px;
    border-radius: 14px; background: rgba(8, 8, 12, 0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    font-size: 12px; font-weight: 600; line-height: 1.2; color: #fff;
}
.a4v-call span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a4v-call b { font-family: var(--font-display, 'Sora', sans-serif); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: #ff4444; }
.a4v-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2fd36b; box-shadow: 0 0 0 0 rgba(47, 211, 107, 0.6); animation: a4v-dot 1.6s ease-out infinite; }
@keyframes a4v-dot { to { box-shadow: 0 0 0 8px rgba(47, 211, 107, 0); } }

/* il tasto verde "rispondi" */
.a4v .a4v-play {
    position: absolute; z-index: 2; inset: 7px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; padding-bottom: 28px;
    border-radius: 25px; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.7)); color: #fff; text-decoration: none; cursor: pointer;
}
.a4v-btn { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #22c55e; box-shadow: 0 10px 24px -8px rgba(34, 197, 94, 0.8); transition: transform 0.25s ease, background 0.25s ease; }
.a4v-btn::before, .a4v-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(47, 211, 107, 0.7); animation: a4v-ring 2.2s ease-out infinite; }
.a4v-btn::after { animation-delay: 0.7s; }
@keyframes a4v-ring { from { transform: scale(1); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
.a4v-btn svg { position: relative; width: 26px; height: 26px; margin-left: 3px; fill: #fff; }
.a4v-lbl { font-family: 'Monaco', 'Menlo', monospace; font-size: 13px; letter-spacing: 0.04em; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.a4v-play:hover .a4v-btn { transform: scale(1.08); background: #16a34a; }
.a4v .a4v-play:focus-visible { outline: 3px solid #2fd36b; outline-offset: -3px; }
.a4v-phone.is-playing .a4v-play, .a4v-phone.is-playing .a4v-call { display: none; }

@media (max-width: 1023px) {
    .a4v { padding: 80px 0 64px; }
    .a4v-grid { grid-template-columns: 1fr; }
    .a4v-phones { justify-content: center; gap: 18px; }
    .a4v-item { width: min(46%, 250px); }
}
@media (max-width: 480px) {
    .a4v .a4v-call { top: 38px; left: 10px; right: 10px; padding: 6px 9px; font-size: 11px; }
    .a4v-call b { display: none; }
    .a4v-btn { width: 54px; height: 54px; }
    .a4v .a4v-item figcaption { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .a4v-label-dot, .a4v-dot, .a4v-btn::before, .a4v-btn::after { animation: none; }
    .a4v-phone, .a4v-item:nth-child(2) .a4v-phone { transition: none; }
}
