/* ═══════════════════════════════════════════════
   DavideCiceri.com - Stylesheet
   Design: Industrial-refined with warm accents
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --primary: #1a3c5e;
    --primary-light: #2a5f8f;
    --accent: #c9873e;
    --accent-light: #e4a959;
    --dark: #0d1b2a;
    --text: #334155;
    --text-light: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --success: #059669;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(13,27,42,.08);
    --shadow-lg: 0 12px 48px rgba(13,27,42,.12);
    --transition: .3s cubic-bezier(.4,0,.2,1);
    --max-w: 1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { font-family: 'DM Sans', sans-serif; color: var(--text); background: var(--bg); line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; color: var(--primary); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: .5rem; }
p { margin-bottom: 1rem; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section--dark { background: var(--dark); color: #e2e8f0; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--gray { background: #f1f5f9; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px; border-radius: var(--radius); font-weight: 700;
    font-size: .95rem; border: none; cursor: pointer;
    transition: all var(--transition); text-transform: uppercase; letter-spacing: .5px;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-light); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4); }
.btn--outline:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }
.btn--dark { background: var(--primary); color: #fff; }
.btn--dark:hover { background: var(--primary-light); color: #fff; }
.btn--sm { padding: 10px 20px; font-size: .85rem; }

/* ════════════════════════════════════
   HEADER / NAVIGATION
   ════════════════════════════════════ */
.header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}
.header.scrolled { box-shadow: var(--shadow); }
.header__inner {
    display: flex; justify-content: space-between; align-items: center;
    height: 72px; max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
}
.header__logo { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--primary); font-weight: 700; }
.header__logo span { color: var(--accent); }
.header__nav { display: flex; gap: 32px; align-items: center; }
.header__nav a {
    font-size: .9rem; font-weight: 500; color: var(--text);
    position: relative; padding: 4px 0;
}
.header__nav a::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
    background: var(--accent); transition: width var(--transition);
}
.header__nav a:hover::after, .header__nav a.active::after { width: 100%; }
.header__nav a:hover { color: var(--primary); }
.header__cta { font-size: .85rem !important; }

.hamburger { display: none; }

/* ════════════════════════════════════
   HERO
   ════════════════════════════════════ */
.hero {
    position: relative;
    background: linear-gradient(rgba(13,27,42,.75), rgba(13,27,42,.85)), url('../img/hero-bg.jpg') center/cover no-repeat;
    color: #fff; padding: 100px 0 60px; min-height: 85vh;
    display: flex; align-items: center; overflow: hidden;
    margin-top: 72px;
}
.hero__content { position: relative; z-index: 2; color: #fff; }
.hero__tag {
    display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: .8rem;
    background: rgba(201,135,62,.2); color: var(--accent-light); font-weight: 500;
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 24px;
    border: 1px solid rgba(201,135,62,.3);
}
.hero h1 { color: #fff; margin-bottom: 20px; max-width: 700px; }
.hero__sub { font-size: 1.15rem; color: rgba(255,255,255,.75); max-width: 560px; margin-bottom: 36px; line-height: 1.8; }
.hero__buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__stats {
    display: flex; gap: 48px; margin-top: 60px; padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,.15);
}
.hero__stat-num { font-family: 'Playfair Display', serif; font-size: 2.5rem; font-weight: 700; color: var(--accent-light); }
.hero__stat-label { font-size: .85rem; color: rgba(255,255,255,.6); margin-top: 4px; }

/* ════════════════════════════════════
   SERVICES GRID
   ════════════════════════════════════ */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.service-card {
    background: var(--white); border-radius: var(--radius); 
    border: 1px solid var(--border); transition: all var(--transition);
    position: relative; overflow: hidden;
}
.service-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light)); transform: scaleX(0);
    transform-origin: left; transition: transform var(--transition);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service-card:hover::before { transform: scaleX(1); }
.service-card__img {
    width: 100%; height: 200px; overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}
.service-card__img img {
    width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease;
}
.service-card:hover .service-card__img img {
    transform: scale(1.05);
}
.service-card__body { padding: 28px; }
.service-card__icon { font-size: 2.5rem; margin-bottom: 8px; }
.service-card__title { margin-bottom: 12px; }
.service-card__text { color: var(--text-light); font-size: .95rem; margin-bottom: 16px; }
.service-card__link { font-weight: 700; font-size: .9rem; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.service-card__link:hover { gap: 10px; }

/* ════════════════════════════════════
   REFERENZE / TESTIMONIALS
   ════════════════════════════════════ */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.testimonial {
    background: rgba(255,255,255,.06); border-radius: var(--radius); padding: 32px;
    border: 1px solid rgba(255,255,255,.1);
}
.testimonial__text { font-style: italic; color: rgba(255,255,255,.8); margin-bottom: 16px; line-height: 1.8; }
.testimonial__author { color: var(--accent-light); font-weight: 700; }
.testimonial__role { color: rgba(255,255,255,.5); font-size: .85rem; }

/* ════════════════════════════════════
   BLOG
   ════════════════════════════════════ */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; }
.post-card {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: all var(--transition);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card__img {
    height: 200px; overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}
.post-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-card:hover .post-card__img img { transform: scale(1.05); }
.post-card__body { padding: 28px; }
.post-card__cat {
    display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--accent); margin-bottom: 8px;
}
.post-card__title { font-size: 1.15rem; margin-bottom: 10px; }
.post-card__title a { color: var(--primary); }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--text-light); font-size: .9rem; margin-bottom: 16px; }
.post-card__meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-light); }

/* Single Post */
.post-single { max-width: 800px; margin: 0 auto; }
.post-single__header { margin-bottom: 40px; }
.post-single__cat { display: inline-block; background: rgba(201,135,62,.1); color: var(--accent); padding: 4px 12px; border-radius: 6px; font-size: .8rem; font-weight: 700; text-transform: uppercase; margin-bottom: 12px; }
.post-single__meta { color: var(--text-light); font-size: .9rem; }
.post-single__content { font-size: 1.05rem; }
.post-single__content h2 { margin-top: 2rem; margin-bottom: 1rem; font-size: 1.6rem; }
.post-single__content h3 { margin-top: 1.5rem; margin-bottom: .8rem; }
.post-single__content p { margin-bottom: 1.2rem; }
.post-single__content ul, .post-single__content ol { margin: 1rem 0; padding-left: 1.5rem; }
.post-single__content li { margin-bottom: .5rem; }
.post-single__content blockquote {
    border-left: 4px solid var(--accent); padding: 16px 24px; margin: 1.5rem 0;
    background: rgba(201,135,62,.05); border-radius: 0 8px 8px 0;
    font-style: italic; color: var(--text-light);
}

/* ════════════════════════════════════
   FAQ
   ════════════════════════════════════ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; cursor: pointer; font-weight: 700; font-size: 1.05rem;
    color: var(--primary); transition: color var(--transition);
}
.faq-q:hover { color: var(--accent); }
.faq-q::after { content: '+'; font-size: 1.5rem; font-weight: 300; transition: transform var(--transition); }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .4s ease; color: var(--text-light); }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a p { padding-bottom: 20px; }

/* ════════════════════════════════════
   CONTACT / FORM
   ════════════════════════════════════ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-info__item { display: flex; gap: 16px; margin-bottom: 24px; }
.contact-info__icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(201,135,62,.1); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.contact-info__label { font-size: .85rem; color: var(--text-light); }
.contact-info__value { font-weight: 700; color: var(--primary); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: .9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 1rem; transition: border-color var(--transition);
    background: var(--white);
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,135,62,.15); }
.form-group textarea { min-height: 140px; resize: vertical; }
.form-msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.form-msg--ok { background: #ecfdf5; color: #065f46; }
.form-msg--err { background: #fef2f2; color: #991b1b; }

/* ════════════════════════════════════
   CHAT WIDGET
   ════════════════════════════════════ */
.chat-toggle {
    position: fixed; bottom: 28px; right: 28px; z-index: 9999;
    width: 60px; height: 60px; border-radius: 50%; border: none;
    background: var(--accent); color: #fff; font-size: 1.6rem;
    cursor: pointer; box-shadow: 0 6px 24px rgba(201,135,62,.4);
    transition: all var(--transition); display: flex; align-items: center; justify-content: center;
}
.chat-toggle:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(201,135,62,.5); }
.chat-toggle.open { background: var(--primary); }

.chat-box {
    position: fixed; bottom: 100px; right: 28px; z-index: 9998;
    width: 380px; max-height: 520px; border-radius: 16px; overflow: hidden;
    background: var(--white); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    display: flex; flex-direction: column;
    transform: scale(0) translateY(20px); transform-origin: bottom right;
    opacity: 0; transition: all .3s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
}
.chat-box.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; padding: 18px 20px;
}
.chat-header h4 { font-family: 'Playfair Display', serif; font-size: 1.1rem; }
.chat-header p { font-size: .8rem; opacity: .7; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; max-height: 340px; min-height: 280px; }
.chat-msg { margin-bottom: 12px; display: flex; }
.chat-msg--bot { justify-content: flex-start; }
.chat-msg--user { justify-content: flex-end; }
.chat-bubble {
    max-width: 80%; padding: 10px 14px; border-radius: 12px;
    font-size: .9rem; line-height: 1.5; word-wrap: break-word;
}
.chat-msg--bot .chat-bubble { background: #f1f5f9; color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg--user .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-typing { display: flex; gap: 4px; padding: 8px 14px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: typing .8s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%,100% { opacity:.3; transform:translateY(0); } 50% { opacity:1; transform:translateY(-3px); } }

.chat-input {
    display: flex; border-top: 1px solid var(--border); padding: 12px;
}
.chat-input input {
    flex: 1; border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 14px; font-size: .9rem; outline: none;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-input button {
    margin-left: 8px; background: var(--accent); color: #fff; border: none;
    border-radius: 8px; padding: 0 18px; cursor: pointer; font-weight: 700;
    transition: background var(--transition);
}
.chat-input button:hover { background: var(--accent-light); }

/* ════════════════════════════════════
   FOOTER
   ════════════════════════════════════ */
.footer { background: var(--dark); color: rgba(255,255,255,.7); padding: 60px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer h4 { color: #fff; margin-bottom: 16px; font-size: 1.1rem; }
.footer__desc { font-size: .9rem; line-height: 1.8; max-width: 360px; }
.footer__links { list-style: none; }
.footer__links li { margin-bottom: 8px; }
.footer__links a { color: rgba(255,255,255,.6); font-size: .9rem; }
.footer__links a:hover { color: var(--accent-light); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; text-align: center; font-size: .85rem; }

/* ════════════════════════════════════
   PAGE HEADER (internal pages)
   ════════════════════════════════════ */
.page-header {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    padding: 120px 0 60px; margin-top: 72px; color: #fff; text-align: center;
}
.page-header h1 { color: #fff; margin-bottom: 12px; }
.page-header p { color: rgba(255,255,255,.7); font-size: 1.1rem; }
.breadcrumb { font-size: .85rem; margin-bottom: 16px; }
.breadcrumb a { color: rgba(255,255,255,.5); }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb span { color: rgba(255,255,255,.4); margin: 0 8px; }

/* ════════════════════════════════════
   ADMIN PANEL
   ════════════════════════════════════ */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--dark); color: #fff; padding: 24px; flex-shrink: 0; }
.admin-sidebar h3 { font-size: 1rem; margin-bottom: 24px; color: var(--accent-light); }
.admin-sidebar a { display: block; color: rgba(255,255,255,.7); padding: 10px 12px; border-radius: 8px; margin-bottom: 4px; font-size: .9rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-main { flex: 1; padding: 32px; background: var(--bg); }
.admin-main h1 { font-size: 1.5rem; margin-bottom: 24px; }
.admin-card { background: var(--white); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); margin-bottom: 24px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.admin-table th { font-weight: 700; color: var(--primary); background: #f8fafc; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .75rem; font-weight: 700; }
.badge--green { background: #d1fae5; color: #065f46; }
.badge--yellow { background: #fef3c7; color: #92400e; }
.badge--red { background: #fee2e2; color: #991b1b; }

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 768px) {
    /* HEADER */
    .header__inner {
        height: 56px;
        padding: 0 16px;
    }
    .header__logo {
        font-size: 1.15rem;
    }
    
    /* HAMBURGER - sempre visibile su mobile */
    .hamburger {
        display: block !important;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 9999;
        position: relative;
    }
    .hamburger span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--primary);
        margin: 5px 0;
        transition: .3s;
    }
    
    /* NAV - nascosto di default su mobile */
    .header__nav {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        z-index: 9998;
        overflow-y: auto;
    }
    
    /* NAV - visibile quando aperto */
    .header__nav.open {
        display: flex !important;
    }
    
    .header__nav a {
        font-size: 1.3rem;
        color: #111827 !important;
        padding: 10px 0;
        text-decoration: none;
    }
    .header__nav a::after {
        display: none;
    }
    .header__nav a:hover {
        color: #c9873e !important;
    }
    .header__nav .header__cta {
        margin-top: 16px;
        font-size: 1rem !important;
        padding: 16px 40px;
        color: #fff !important;
        background: #c9873e;
        border-radius: 12px;
    }

    /* HERO */
    .hero {
        margin-top: 56px;
        min-height: 80vh;
        padding: 40px 0;
    }
    .hero h1 { font-size: 1.8rem; }
    .hero__sub { font-size: 1rem; }
    .hero__stats { gap: 24px; flex-wrap: wrap; }
    .hero__stat-num { font-size: 1.8rem; }
    .hero__buttons { flex-direction: column; }
    .hero__buttons .btn { text-align: center; justify-content: center; }
    
    /* GRIDS */
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .services-grid, .blog-grid, .testimonials-grid { grid-template-columns: 1fr; }
    
    /* SECTIONS */
    .section { padding: 50px 0; }
    .page-header { padding: 80px 0 40px; margin-top: 56px; }
    
    /* CHAT */
    .chat-box { width: calc(100vw - 24px); right: 12px; bottom: 90px; }
    .chat-toggle { bottom: 20px; right: 16px; width: 52px; height: 52px; font-size: 1.4rem; }
    
    /* ADMIN */
    .admin-wrap { flex-direction: column; }
    .admin-sidebar { width: 100%; position: relative; height: auto; }
    .admin-main { margin-left: 0; }
}
