/* =============================================
   CAFINCASA – STYLES.CSS
   CAF Roma | Centro di Assistenza Fiscale
   ============================================= */

:root {
    --primary:   #1e3a8a;
    --secondary: #3b82f6;
    --accent:    #10b981;
    --orange:    #f97316;
    --dark:      #1f2937;
    --light:     #f8fafc;
    --cream:     #fefce8;
    --whatsapp:  #25d366;
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    line-height: 1.3;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== ANIMAZIONI ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50%       { transform: translateY(-22px) rotate(2deg); }
}

@keyframes floatShadow {
    0%, 100% { transform: scaleX(1); opacity: 0.35; }
    50%       { transform: scaleX(0.75); opacity: 0.18; }
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes wobble {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

.animate-fade-up          { animation: fadeInUp 0.9s ease both; }
.animate-fade-up-delay-1  { animation: fadeInUp 0.9s ease 0.15s both; }
.animate-fade-up-delay-2  { animation: fadeInUp 0.9s ease 0.30s both; }
.animate-fade-up-delay-3  { animation: fadeInUp 0.9s ease 0.45s both; }

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0.75rem 0;
    z-index: 1030;
}

.logo-container {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-img { width: 100%; height: 100%; object-fit: contain; display: none; }
.logo-img.loaded { display: block; }

.logo-placeholder {
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}
.logo-placeholder.hidden { display: none; }

.brand-text {
    font-family: 'Merriweather', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.25s ease;
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px; left: 1rem;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { width: calc(100% - 2rem); }

.navbar-nav .nav-link.active { color: white !important; }

.nav-cta {
    background: rgba(16,185,129,0.2);
    border: 1px solid rgba(16,185,129,0.4);
    margin-left: 0.25rem;
}
.nav-cta:hover { background: rgba(16,185,129,0.35) !important; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 60%, #1d4ed8 100%);
    color: white;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
    min-height: 520px;
    display: flex;
    align-items: center;
}

/* Pattern geometrico di sfondo */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(16,185,129,0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59,130,246,0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    inset: 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.025'%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");
    pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16,185,129,0.2);
    border: 1px solid rgba(16,185,129,0.5);
    color: #6ee7b7;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.2rem;
    letter-spacing: 0.03em;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.25);
    margin-bottom: 1.2rem;
    line-height: 1.1;
}

.hero .lead {
    font-size: 1.15rem;
    font-weight: 300;
    opacity: 0.92;
    max-width: 520px;
}

.hero-buttons { margin-top: 0.5rem; }

.btn-hero-primary {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.85rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 8px 25px rgba(16,185,129,0.35);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-hero-primary:hover {
    background: #059669;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(16,185,129,0.5);
}

.btn-hero-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50px;
    padding: 0.82rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-hero-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: white;
    color: white;
    transform: translateY(-3px);
}

/* Mascotte */
.mascot-col { position: relative; z-index: 2; }

.mascot-wrapper {
    position: relative;
    display: inline-block;
}

.hero-mascot {
    width: 300px;
    max-width: 100%;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 25px 40px rgba(0,0,0,0.3));
    image-rendering: -webkit-optimize-contrast;
}

/* Ombra ellittica che respira sotto il gatto */
.mascot-shadow {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 18px;
    background: rgba(0,0,0,0.25);
    border-radius: 50%;
    filter: blur(8px);
    animation: floatShadow 4s ease-in-out infinite;
}

/* Fallback emoji */
.mascot-emoji {
    font-size: 8rem;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.25));
    line-height: 1;
}

/* Wave in fondo all'hero */
.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    line-height: 0;
    z-index: 3;
}
.hero-wave svg { display: block; width: 100%; }

/* ===== PULSANTE BOOTSTRAP PRIMARIO (sovrascrittura) ===== */
.btn-primary {
    background: var(--accent);
    border: none;
    border-radius: 50px;
    padding: 0.85rem 2rem;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(16,185,129,0.3);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background: #059669;
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(16,185,129,0.5);
}
.btn-primary:active, .btn-primary:focus { background: #047857; }

/* ===== SEZIONI – TITOLI ===== */
.section-title {
    font-size: 2.5rem;
    color: var(--primary);
}

.section-subtitle { font-size: 1.1rem; }

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
}

/* ===== SERVICE CARDS ===== */
.services-section { background: white; }

.service-card {
    background: white;
    padding: 2.2rem;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 50px rgba(59,130,246,0.2);
    border-color: #dbeafe;
}

.service-card:hover::before { transform: scaleX(1); }

.service-icon {
    font-size: 2.8rem;
    margin-bottom: 1.2rem;
    color: var(--secondary);
}

.service-icon i { display: inline-block; animation: wobble 4s ease-in-out infinite; }

.service-card h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.service-card p { color: #4b5563; margin-bottom: 0; }

.btn-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: gap 0.2s ease;
}
.btn-card-link:hover { gap: 10px; color: #059669; }

/* ===== SOCIAL SECTION ===== */
.social-section { background: var(--light); }

/* ===== ORARI ===== */
.orari-wrapper { background: var(--light); }

.orari-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    padding: 4rem 3rem;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(30,58,138,0.3);
    position: relative;
    overflow: hidden;
}

.orari-section::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.orario-item {
    background: rgba(255,255,255,0.12);
    padding: 1.8rem 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.orario-item:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-4px);
}

.orario-chiuso { opacity: 0.65; }

.orario-item .day {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.orario-item .time { font-size: 1rem; opacity: 0.9; line-height: 1.6; }

.appuntamento-note { opacity: 0.9; }

.btn-whatsapp {
    background: var(--whatsapp);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.85rem 2rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(37,211,102,0.35);
}

.btn-whatsapp:hover {
    background: #1ebe5c;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(37,211,102,0.5);
}

/* ===== CONTATTI ===== */
.contact-container {
    background: white;
    padding: 3.5rem;
    border-radius: 28px;
    box-shadow: 0 8px 50px rgba(0,0,0,0.09);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.4rem;
    background: var(--light);
    border-radius: 14px;
    transition: all 0.3s ease;
    color: var(--dark);
    border: 2px solid transparent;
}

.contact-item:hover {
    background: #eff6ff;
    border-color: #dbeafe;
    transform: translateX(6px);
    color: var(--dark);
}

.contact-icon {
    font-size: 1.8rem;
    color: var(--secondary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.contact-details strong { display: block; color: var(--primary); margin-bottom: 0.2rem; }
.contact-details p { margin: 0; color: #4b5563; }

.form-label { font-weight: 600; color: var(--primary); }

.form-control {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.25s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ===== CALCOLATORE ===== */
.calculator-container {
    background: white;
    padding: 3.5rem;
    border-radius: 28px;
    box-shadow: 0 8px 50px rgba(0,0,0,0.09);
}

.calculator-intro {
    background: linear-gradient(135deg, var(--cream), #fef3c7);
    border-left: 5px solid var(--orange) !important;
    border-radius: 16px;
    padding: 1.5rem;
}

.result-box {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(30,58,138,0.35);
    animation: fadeInUp 0.5s ease;
}

.result-detail {
    background: rgba(255,255,255,0.12);
    padding: 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: white;
    padding: 3.5rem 0 2rem;
}

.footer .text-muted { color: #9ca3af !important; }

.footer a.text-muted:hover { color: var(--accent) !important; }

.social-links a {
    color: #9ca3af;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px) scale(1.1);
}

#fb-feed-container {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 0.75rem;
    min-height: 100px;
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    background: var(--whatsapp);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(37,211,102,0.5);
    z-index: 1040;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 1s both;
}

.whatsapp-float:hover {
    background: #1ebe5c;
    color: white;
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 10px 35px rgba(37,211,102,0.6);
}

/* ===== UTILITY ===== */
.page-content { min-height: 70vh; }

/* ===== RESPONSIVE ===== */

/* Large desktop */
@media (min-width: 1200px) {
    .hero { min-height: 600px; }
    .hero-title { font-size: 4.5rem; }
    .hero-mascot { width: 380px; }
}

/* Tablet landscape */
@media (max-width: 991px) {
    .hero {
        padding: 5rem 0 5rem;
        text-align: center;
    }

    .hero .lead { max-width: 100%; }

    .hero-buttons { justify-content: center !important; }

    .hero-title { font-size: 3rem; }

    .mascot-col { margin-top: 2rem; }

    .hero-mascot { width: 280px; }
    .mascot-shadow { width: 170px; }

    .section-title { font-size: 2.2rem; }

    .orari-section { padding: 3rem 2rem; }
}

/* Tablet portrait */
@media (max-width: 767px) {
    .hero { padding: 4.5rem 0 5rem; }
    .hero-title { font-size: 2.6rem; }
    .mascot-col { margin-top: 1.5rem; }
    .hero-mascot { width: 260px; }
    .mascot-shadow { width: 155px; }

    .contact-container,
    .calculator-container { padding: 2rem 1.5rem; }

    .service-card { padding: 1.8rem; }

    .contact-item { flex-direction: row; }

    .btn-hero-primary,
    .btn-hero-outline { width: 100%; justify-content: center; }
}

/* Mobile */
@media (max-width: 575px) {
    .hero-title { font-size: 2.1rem; }

    .hero .lead { font-size: 1rem; }

    .hero-badge { font-size: 0.78rem; }

    .hero-mascot { width: 220px; }
    .mascot-shadow { width: 130px; }

    .section-title { font-size: 1.9rem; }

    .service-icon { font-size: 2.2rem; }

    .service-card h3 { font-size: 1.2rem; }

    .orari-section { border-radius: 18px; padding: 2.5rem 1.5rem; }

    .contact-container,
    .calculator-container { padding: 1.5rem 1rem; }

    .result-box { padding: 1.8rem 1.2rem; }

    .whatsapp-float {
        width: 52px; height: 52px;
        bottom: 16px; right: 16px;
        font-size: 1.4rem;
    }

    .brand-text { font-size: 1.35rem; }
}
