/* ============================================================================
   FINOVAI · Interactive kit (Phase 4a). Token-driven, on-demand.
   Info Box · Flip Box · Tabs · Accordion · Image Compare · Video Popup
   ============================================================================ */

/* ---- Info Box ------------------------------------------------------------ */
.fv-infobox { padding: 2rem; border: 1px solid var(--fv-border); border-radius: var(--fv-radius); background: var(--fv-surface); position: relative; overflow: hidden; transition: transform var(--fv-dur) var(--fv-ease), border-color var(--fv-dur); }
.fv-infobox:hover { transform: translateY(-5px); border-color: var(--fv-accent); }
.fv-infobox--left { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: start; }
.fv-infobox__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--fv-radius-sm); color: var(--fv-accent); font-size: 26px; margin-bottom: 1.1rem; }
.fv-infobox--left .fv-infobox__icon { margin-bottom: 0; }
.fv-infobox__icon svg { width: 28px; height: 28px; fill: currentColor; }
.fv-infobox__title { font-size: var(--fv-text-lg); margin-bottom: .6rem; }
.fv-infobox__text { color: var(--fv-fg-soft); font-size: .95rem; }
.fv-infobox__link { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; color: var(--fv-accent); font-family: var(--fv-font-display); font-weight: 600; font-size: .9rem; }
.fv-infobox__link svg { width: 15px; height: 15px; transition: transform var(--fv-dur-fast); }
.fv-infobox__link:hover svg { transform: translateX(4px); }

/* ---- Flip Box ------------------------------------------------------------ */
.fv-flip { perspective: 1400px; min-height: 300px; }
.fv-flip__inner { position: relative; width: 100%; height: 100%; min-height: inherit; transition: transform .7s var(--fv-ease); transform-style: preserve-3d; }
.fv-flip:hover .fv-flip__inner, .fv-flip:focus-within .fv-flip__inner { transform: rotateY(180deg); }
.fv-flip__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--fv-radius-lg); padding: 2.2rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; border: 1px solid var(--fv-border); }
.fv-flip__front { background: var(--fv-surface); }
.fv-flip__back { background: var(--fv-navy); color: #fff; transform: rotateY(180deg); }
.fv-flip__back * { color: #fff; }
.fv-flip__icon { width: 56px; height: 56px; color: var(--fv-accent); margin-bottom: 1.2rem; }
.fv-flip__icon svg { width: 100%; height: 100%; fill: currentColor; }
.fv-flip__title { font-size: var(--fv-text-lg); margin-bottom: .5rem; }
.fv-flip__sub { color: var(--fv-fg-soft); font-size: .92rem; }
.fv-flip__text { font-size: .95rem; margin-bottom: 1.3rem; opacity: .9; }

/* ---- Tabs ---------------------------------------------------------------- */
.fv-tabs__nav { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 1px solid var(--fv-border); margin-bottom: 1.8rem; }
.fv-tabs__tab { font-family: var(--fv-font-display); font-weight: 600; font-size: .95rem; color: var(--fv-fg-soft); background: none; border: none; padding: .9rem 1.3rem; cursor: pointer; position: relative; transition: color var(--fv-dur-fast); }
.fv-tabs__tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fv-accent); transform: scaleX(0); transition: transform var(--fv-dur) var(--fv-ease); }
.fv-tabs__tab.is-active { color: var(--fv-fg); }
.fv-tabs__tab.is-active::after { transform: scaleX(1); }
.fv-tabs__panel { display: none; color: var(--fv-fg-soft); line-height: 1.65; }
.fv-tabs__panel.is-active { display: block; }

/* ---- Accordion ----------------------------------------------------------- */
.fv-acc__item { border-bottom: 1px solid var(--fv-border); }
.fv-acc__q { width: 100%; text-align: left; background: none; border: none; color: var(--fv-fg); font-family: var(--fv-font-display); font-weight: 600; font-size: 1.1rem; padding: 1.4rem 2.5rem 1.4rem 0; cursor: pointer; position: relative; }
.fv-acc__q::after { content: ""; position: absolute; right: .4rem; top: 50%; width: 12px; height: 2px; background: var(--fv-accent); transition: transform var(--fv-dur); }
.fv-acc__q::before { content: ""; position: absolute; right: .8rem; top: 50%; width: 2px; height: 12px; background: var(--fv-accent); transform: translateY(-5px); transition: transform var(--fv-dur), opacity var(--fv-dur); }
.fv-acc__item.is-open .fv-acc__q::before { opacity: 0; }
.fv-acc__a { max-height: 0; overflow: hidden; transition: max-height var(--fv-dur) var(--fv-ease); }
.fv-acc__a-inner { padding: 0 2.5rem 1.4rem 0; color: var(--fv-fg-soft); line-height: 1.65; }

/* ---- Image Compare (before/after) ---------------------------------------- */
.fv-compare { position: relative; overflow: hidden; border-radius: var(--fv-radius); user-select: none; touch-action: none; }
.fv-compare img { display: block; width: 100%; pointer-events: none; }
.fv-compare__after { position: absolute; inset: 0; width: var(--pos, 50%); overflow: hidden; }
.fv-compare__after img { position: absolute; inset: 0; height: 100%; width: auto; max-width: none; }
.fv-compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; background: var(--fv-gold); transform: translateX(-50%); }
.fv-compare__grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 42px; height: 42px; border-radius: 50%; background: var(--fv-gold); color: var(--fv-navy); display: grid; place-items: center; cursor: ew-resize; box-shadow: var(--fv-shadow); }
.fv-compare__grip svg { width: 20px; height: 20px; fill: currentColor; }
.fv-compare__label { position: absolute; top: 1rem; font-family: var(--fv-font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; background: rgba(5,7,15,.6); color: #fff; padding: .3rem .7rem; border-radius: var(--fv-radius-pill); backdrop-filter: blur(4px); }
.fv-compare__label--before { left: 1rem; } .fv-compare__label--after { right: 1rem; }

/* ---- Video Popup --------------------------------------------------------- */
.fv-video { position: relative; border-radius: var(--fv-radius-lg); overflow: hidden; cursor: pointer; background: var(--fv-navy); }
.fv-video img { width: 100%; display: block; transition: transform .6s var(--fv-ease); }
.fv-video:hover img { transform: scale(1.04); }
.fv-video__play { position: absolute; inset: 0; display: grid; place-items: center; }
.fv-video__play span { width: 78px; height: 78px; border-radius: 50%; background: var(--fv-gold); color: var(--fv-navy); display: grid; place-items: center; box-shadow: 0 10px 40px -8px rgba(0,0,0,.5); transition: transform var(--fv-dur); }
.fv-video:hover .fv-video__play span { transform: scale(1.1); }
.fv-video__play svg { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.fv-video__pulse { position: absolute; width: 78px; height: 78px; border-radius: 50%; border: 2px solid var(--fv-gold); animation: fv-pulse 2s var(--fv-ease) infinite; }
@keyframes fv-pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }
.fv-vmodal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.fv-vmodal.is-open { display: flex; }
.fv-vmodal__bg { position: absolute; inset: 0; background: rgba(5,7,15,.82); backdrop-filter: blur(6px); }
.fv-vmodal__frame { position: relative; z-index: 1; width: 100%; max-width: 960px; aspect-ratio: 16/9; }
.fv-vmodal__frame iframe, .fv-vmodal__frame video { width: 100%; height: 100%; border: 0; border-radius: var(--fv-radius); }
.fv-vmodal__close { position: absolute; top: -3rem; right: 0; background: none; border: none; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; }

@media (prefers-reduced-motion: reduce) { .fv-video__pulse { animation: none; } .fv-flip__inner { transition: none; } }
