/* ============ Promoarena - Frontend pubblico ============ */

:root {
    --pa-primary: #1a3a52;
    --pa-primary-dark: #122a3c;
    --pa-primary-light: #2c5878;
    --pa-accent: #ffc107;
    --pa-accent-dark: #d39e00;
    --pa-cta: #fd7e14;
    --pa-text: #333;
    --pa-muted: #6c757d;
    --pa-light: #f4f6f9;
    --ease-smooth: cubic-bezier(.4, 0, .2, 1);
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--pa-text);
    line-height: 1.6;
    background: #fff;
    overflow-x: hidden;
}

a { color: var(--pa-primary); text-decoration: none; transition: color .2s var(--ease-smooth); }
a:hover { color: var(--pa-primary-light); text-decoration: underline; }

/* Niente underline nativa per i link di header, topbar, footer e brand: gestiti via CSS animato dedicato */
.site-topbar a:hover,
.site-header a:hover,
.site-footer a:hover,
.navbar-brand:hover,
.site-header .navbar-brand:hover { text-decoration: none; }

/* ============ ANIMAZIONI KEYFRAMES ============ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.85); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(253, 126, 20, .5); }
    50% { box-shadow: 0 0 0 14px rgba(253, 126, 20, 0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

/* Classi attivabili via JS (Intersection Observer) */
.reveal { opacity: 0; transition: opacity .8s var(--ease-smooth), transform .8s var(--ease-smooth); will-change: opacity, transform; }
.reveal.visible { opacity: 1; transform: none !important; }
.reveal-up   { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right{ transform: translateX(40px); }
.reveal-scale{ transform: scale(.9); }
.reveal-delay-1.visible { transition-delay: .1s; }
.reveal-delay-2.visible { transition-delay: .2s; }
.reveal-delay-3.visible { transition-delay: .3s; }
.reveal-delay-4.visible { transition-delay: .4s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ============ HEADER ============ */
.site-topbar {
    background: var(--pa-primary-dark);
    color: rgba(255,255,255,.85);
    font-size: .85rem;
    padding: .4rem 0;
}
.site-topbar a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-topbar a:hover { color: #fff; }
.site-topbar .topbar-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    transition: background .2s, transform .2s var(--ease-bounce);
}
.site-topbar .topbar-social a:hover { background: rgba(255,255,255,.18); transform: translateY(-2px) scale(1.1); }

.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow .3s, padding .3s;
}
.site-header.scrolled { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.site-header .navbar { transition: padding .3s; }
.site-header.scrolled .navbar { padding-top: .25rem !important; padding-bottom: .25rem !important; }
.site-header .navbar-brand { font-weight: 700; color: var(--pa-primary); display: flex; align-items: center; gap: .75rem; transition: transform .3s; }
.site-header .navbar-brand:hover { transform: scale(1.02); }
.site-header .navbar-brand img { max-height: 50px; transition: max-height .3s; }
.site-header.scrolled .navbar-brand img { max-height: 38px; }
.site-header .navbar-brand .brand-text small { display: block; font-weight: 400; font-size: .7rem; color: var(--pa-muted); }

.site-header .nav-link {
    color: var(--pa-text); font-weight: 500;
    padding: .5rem 1rem;
    position: relative;
    transition: color .25s var(--ease-smooth);
}
.site-header .nav-link::after {
    content: '';
    position: absolute;
    left: 1rem; right: 1rem; bottom: 4px;
    height: 2px;
    background: var(--pa-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .3s var(--ease-smooth);
}
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--pa-primary); }
.site-header .nav-link:hover::after, .site-header .nav-link.active::after { transform: scaleX(1); }

.site-header .nav-link.btn-cta {
    background: var(--pa-cta); color: #fff !important;
    padding: .5rem 1.25rem; border-radius: 30px; margin-left: .5rem;
    transition: all .25s var(--ease-smooth);
}
.site-header .nav-link.btn-cta::after { display: none; }
.site-header .nav-link.btn-cta:hover {
    background: #e66a00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(253, 126, 20, .35);
}

/* ============ HERO ============ */
.hero {
    position: relative;
    color: #fff;
    padding: 6rem 0 5rem;
    background: linear-gradient(135deg, var(--pa-primary) 0%, var(--pa-primary-light) 100%);
    overflow: hidden;
}
.hero.has-image::before {
    content: '';
    position: absolute; inset: 0;
    background-position: center; background-size: cover;
    opacity: .35;
    transform: scale(1.05);
    transition: transform 30s linear;
    will-change: transform;
}
.hero.has-image:hover::before { transform: scale(1.15); }

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), transparent 50%);
    pointer-events: none;
}

.hero > .container { position: relative; z-index: 2; }
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700; line-height: 1.15;
    margin-bottom: 1rem;
    animation: fadeUp .9s var(--ease-smooth) both;
}
.hero .lead {
    font-size: 1.25rem; opacity: .92;
    margin-bottom: 2rem;
    animation: fadeUp 1s var(--ease-smooth) .15s both;
}
.hero .hero-btns { animation: fadeUp 1s var(--ease-smooth) .3s both; }
.hero .hero-btns .btn {
    padding: .75rem 1.75rem;
    font-weight: 600; border-radius: 30px;
    margin: .25rem;
    transition: all .25s var(--ease-smooth);
}
.hero .hero-btns .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.hero .hero-btns .btn-pa-cta { animation: pulseGlow 2.5s ease-in-out infinite; }

.hero > .container > div:first-child { animation: fadeIn .9s ease both; }

/* ============ SEZIONI BLOCCHI HOMEPAGE ============ */
.block-section { padding: 4rem 0; }
.block-section h2 { font-weight: 700; color: var(--pa-primary); margin-bottom: .5rem; }
.block-section .lead { color: var(--pa-muted); font-size: 1.1rem; margin-bottom: 2rem; }

.block-cta { padding: 4rem 0; text-align: center; position: relative; overflow: hidden; }
.block-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 50%, rgba(255,255,255,.15), transparent 70%);
    pointer-events: none;
}
.block-cta > .container { position: relative; z-index: 2; }
.block-cta h2 { font-weight: 700; margin-bottom: .5rem; }
.block-cta .btn {
    padding: .75rem 1.75rem;
    font-weight: 600; border-radius: 30px;
    margin: .25rem;
    transition: all .25s var(--ease-smooth);
}
.block-cta .btn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }

.block-stats { padding: 4rem 0; }
.stat-card { text-align: center; padding: 1.5rem; transition: transform .3s var(--ease-smooth); }
.stat-card:hover { transform: translateY(-6px); }
.stat-card i { transition: transform .4s var(--ease-bounce); display: inline-block; }
.stat-card:hover i { transform: scale(1.2) rotate(-8deg); }
.stat-card .stat-num { font-size: 3rem; font-weight: 800; color: var(--pa-primary); line-height: 1; }
.stat-card .stat-label { color: var(--pa-muted); text-transform: uppercase; font-size: .85rem; letter-spacing: .05em; margin-top: .5rem; }

.block-banner { padding: 2rem 0; }

/* ============ ARTICOLI / NEWS CARD ============ */
.news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    height: 100%;
    transition: transform .35s var(--ease-smooth), box-shadow .35s var(--ease-smooth);
    position: relative;
}
.news-card:hover { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(0,0,0,.12); }
.news-card .news-img {
    aspect-ratio: 16/9;
    background: #eef1f4 center/cover no-repeat;
    overflow: hidden;
    position: relative;
    transition: filter .35s;
}
.news-card .news-img::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.25));
    opacity: 0;
    transition: opacity .35s;
}
.news-card:hover .news-img::after { opacity: 1; }
.news-card:hover .news-img { transform: scale(1.04); }
.news-card .news-img { transition: transform .6s var(--ease-smooth), filter .35s; }
.news-card .news-body { padding: 1.25rem; }
.news-card .news-cat {
    display: inline-block;
    background: var(--pa-accent); color: #000;
    padding: .15rem .65rem; border-radius: 20px;
    font-size: .7rem; font-weight: 600;
    text-transform: uppercase;
    margin-bottom: .5rem;
    transition: transform .25s var(--ease-bounce);
}
.news-card:hover .news-cat { transform: scale(1.05); }
.news-card .news-title { font-size: 1.15rem; font-weight: 600; line-height: 1.3; margin-bottom: .5rem; color: var(--pa-text); }
.news-card .news-title a { color: inherit; transition: color .25s; }
.news-card .news-title a:hover { color: var(--pa-primary); text-decoration: none; }
.news-card .news-excerpt { color: var(--pa-muted); font-size: .9rem; }
.news-card .news-meta { color: var(--pa-muted); font-size: .8rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid #eef1f4; }

/* ============ PAGINA STATICA ============ */
.page-header-block {
    background: var(--pa-primary);
    color: #fff;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.page-header-block.has-image::before {
    content: '';
    position: absolute; inset: 0;
    background-position: center; background-size: cover;
    opacity: .3;
    transform: scale(1.05);
    animation: heroZoom 25s ease-in-out infinite alternate;
}
@keyframes heroZoom {
    from { transform: scale(1.02); }
    to { transform: scale(1.12); }
}
.page-header-block > .container { position: relative; z-index: 2; }
.page-header-block h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; animation: fadeUp .8s var(--ease-smooth) both; }
.page-header-block .lead { opacity: .92; font-size: 1.2rem; animation: fadeUp .8s var(--ease-smooth) .12s both; }

.page-content { padding: 4rem 0; }
.page-content h2, .page-content h3, .page-content h4 { color: var(--pa-primary); margin-top: 2rem; }
.page-content img { max-width: 100%; height: auto; border-radius: 8px; transition: transform .35s; }
.page-content img:hover { transform: scale(1.02); }
.page-content .img-fluid { max-width: 100%; height: auto; }
.page-content blockquote { border-left: 4px solid var(--pa-accent); padding: .5rem 1.25rem; color: var(--pa-muted); font-style: italic; margin: 1.5rem 0; background: #fafafa; border-radius: 0 8px 8px 0; }

/* ============ BLOCCO ALLERTE METEO ============ */
.block-allerte { padding: 4rem 0; position: relative; overflow: hidden; }
.block-allerte::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.12), transparent 55%);
    pointer-events: none;
}
.block-allerte > .container { position: relative; z-index: 2; }
.block-allerte h2 { color: #fff; }

.allerta-card {
    display: block;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px;
    padding: 1.5rem;
    color: #fff;
    text-decoration: none;
    height: 100%;
    transition: all .25s var(--ease-smooth);
    text-align: center;
}
.allerta-card:hover {
    background: rgba(255,255,255,.22);
    color: #fff;
    text-decoration: none;
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
    border-color: rgba(255,255,255,.4);
}
.allerta-card > i:first-child {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: .75rem;
    display: inline-block;
    text-shadow: 0 4px 12px rgba(0,0,0,.2);
    transition: transform .35s var(--ease-bounce);
}
.allerta-card:hover > i:first-child { transform: scale(1.15) rotate(-6deg); }
.allerta-card h5 { font-weight: 700; margin-bottom: .5rem; }
.allerta-card p { font-size: .9rem; opacity: .92; margin-bottom: 1rem; }
.allerta-card .allerta-link {
    display: inline-block;
    padding: .35rem 1rem;
    background: rgba(255,255,255,.2);
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    transition: background .2s;
}
.allerta-card:hover .allerta-link { background: #fff; color: var(--pa-cta); }

/* ============ FOOTER ============ */
.site-footer { background: var(--pa-primary-dark); color: rgba(255,255,255,.85); padding: 3.5rem 0 0; margin-top: 4rem; }
.site-footer h5 { color: #fff; font-weight: 600; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,.75); text-decoration: none; transition: color .2s, padding-left .2s; }
.site-footer a:hover { color: var(--pa-accent); text-decoration: none; }
.site-footer ul li a:hover { padding-left: 4px; }
.site-footer .footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.1); color: #fff;
    margin-right: .35rem;
    transition: all .25s var(--ease-bounce);
    font-size: 1.05rem;
}
.site-footer .footer-social a:hover {
    background: var(--pa-accent); color: #000;
    transform: translateY(-3px) rotate(-6deg);
}
.site-footer ul { list-style: none; padding: 0; }
.site-footer ul li { margin-bottom: .5rem; transition: padding-left .2s; }
.site-footer .footer-bottom { background: rgba(0,0,0,.25); padding: 1rem 0; margin-top: 3rem; font-size: .85rem; color: rgba(255,255,255,.6); }

/* ============ FORM CONTATTI ============ */
.contact-info { background: var(--pa-light); padding: 2rem; border-radius: 12px; }
.contact-info h4 { color: var(--pa-primary); font-weight: 600; }
.contact-info .contact-row { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; transition: transform .25s; }
.contact-info .contact-row:hover { transform: translateX(4px); }
.contact-info .contact-row i {
    width: 38px; height: 38px;
    background: var(--pa-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; flex-shrink: 0;
    transition: transform .3s var(--ease-bounce);
}
.contact-info .contact-row:hover i { transform: scale(1.1) rotate(-8deg); }

.form-control, .form-select {
    transition: border-color .2s, box-shadow .2s, transform .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--pa-primary);
    box-shadow: 0 0 0 .2rem rgba(26, 58, 82, .15);
}

/* ============ BOTTONI GENERICI ============ */
.btn { transition: all .25s var(--ease-smooth); }
.btn:hover { transform: translateY(-2px); }
.btn-pa-primary { background: var(--pa-primary); color: #fff; border-color: var(--pa-primary); }
.btn-pa-primary:hover { background: var(--pa-primary-light); color: #fff; border-color: var(--pa-primary-light); box-shadow: 0 6px 16px rgba(26,58,82,.25); }
.btn-pa-cta { background: var(--pa-cta); color: #fff; border-color: var(--pa-cta); }
.btn-pa-cta:hover { background: #e66a00; color: #fff; border-color: #e66a00; box-shadow: 0 6px 16px rgba(253, 126, 20, .35); }

/* ============ BREADCRUMBS / VARIE ============ */
.breadcrumb-nav { background: var(--pa-light); padding: .75rem 0; font-size: .9rem; }
.breadcrumb-nav .breadcrumb { margin: 0; }

/* Back-to-top button */
.back-to-top {
    position: fixed;
    bottom: 25px; right: 25px;
    width: 48px; height: 48px;
    background: var(--pa-primary); color: #fff;
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
    cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all .3s var(--ease-smooth);
    z-index: 999;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--pa-primary-light); transform: translateY(-4px); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .hero { padding: 3rem 0; }
    .block-section, .block-cta, .block-stats, .page-content { padding: 2.5rem 0; }
    .stat-card .stat-num { font-size: 2.25rem; }
}

/* Utility */
.text-pa-primary { color: var(--pa-primary) !important; }
.bg-pa-primary { background: var(--pa-primary) !important; color: #fff; }
