/* Stili comuni del sito pubblico (header, navigazione, footer, badge WhatsApp).
   Estratti da header.php e footer.php: un solo file memorizzabile in cache, versionato con ?v=data di modifica. */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #3d5a80;
    --accent-secondary: #5a7ca8;
    --light-color: #ecf0f1;
    --dark-color: #1a1a2e;
    --text-muted: #6c757d;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100%;
}

/* Wrapper for sticky footer */
.page-wrapper {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

/* Main content wrapper - grows to push footer down */
.main-content {
    flex: 1 0 auto !important;
}

/* Footer stays at bottom */
.footer {
    flex-shrink: 0 !important;
    width: 100% !important;
}

/* Navbar Styles */
.navbar {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.12);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand img {
    transition: all 0.3s ease;
}

.navbar.scrolled .navbar-brand img {
    max-height: 50px !important;
}

.navbar-nav .nav-link {
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--accent-color);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 60%;
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.navbar-nav .dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.navbar-nav .dropdown-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: var(--accent-color);
}

.navbar-nav .dropdown-item i {
    width: 20px;
    margin-right: 8px;
    color: var(--accent-color);
}

/* Auth Buttons */
.btn-nav-login {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-nav-login:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
}

.btn-nav-register {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    border: none;
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-nav-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.btn-nav-dashboard {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-nav-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    color: #fff;
}

/* User dropdown when logged in */
.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

/* Hero Section Base */
.hero-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, #16213e 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

/* Card Styles */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
}

.btn-outline-primary {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .navbar-collapse {
        background: #fff;
        padding: 1rem;
        border-radius: 12px;
        margin-top: 1rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .btn-nav-login,
    .btn-nav-register,
    .btn-nav-dashboard {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
}

/* ─── Footer ─── */
.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #b8c5d6;
    padding: 60px 0 30px;
    font-size: 0.95rem;
    margin-top: auto; /* Sticky footer - stays at bottom */
}
.footer h5, .footer .footer-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}
.footer h5::after, .footer .footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}
.footer a {
    color: #b8c5d6;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}
.footer a:hover {
    color: #fff;
    transform: translateX(5px);
}
.footer .footer-links li {
    margin-bottom: 12px;
}
.footer .footer-links a::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.3s ease;
}
.footer .footer-links a:hover::before {
    opacity: 1;
}
.footer .contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    color: #b8c5d6;
}
.footer .contact-item i {
    width: 35px;
    height: 35px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #667eea;
    flex-shrink: 0;
}
.footer .contact-item span {
    line-height: 1.5;
}
.footer hr {
    border-color: rgba(255,255,255,0.1);
    margin: 40px 0 25px;
}
.footer .footer-bottom {
    font-size: 0.875rem;
    color: #8892a0;
}
.footer .footer-bottom a {
    color: #8892a0;
    padding: 5px 0;
    margin: 0 10px;
    position: relative;
}
.footer .footer-bottom a:hover {
    color: #fff;
    transform: none;
}
.footer .footer-bottom a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #667eea;
    transition: width 0.3s ease;
}
.footer .footer-bottom a:hover::after {
    width: 100%;
}
.footer .brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    display: inline-block;
}
.footer .brand-name span {
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
#whatsapp-badge {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(37,211,102,.45);
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
}
#whatsapp-badge:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,.6);
}
#whatsapp-badge img {
    border-radius: 50%;
    display: block;
}

/* Linguette (nav-pills) con contrasto AA sul grigio chiaro */
.nav-pills .nav-link:not(.active) { color: #0a58ca; }

/* Contrasto AA: link e testo "primary" leggermente più scuri sullo sfondo grigio chiaro */
:root { --bs-link-color: #0a58ca; --bs-link-color-rgb: 10, 88, 202; --bs-link-hover-color: #084298; }
.text-primary { color: #0a58ca !important; }

/* Codice inline: rosa più scuro per il contrasto AA */
code { color: #a61e5c; }

/* Smartphone: le righe con spaziatura ampia (g-5/gx-5) sbordavano di 12px dal contenitore */
@media (max-width: 575.98px) {
    .row.g-5, .row.gx-5 { --bs-gutter-x: 1.5rem; }
}
