/* ================================================
   BACHECA FCO1 – style.css
   ================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #1a56db;
    --primary-dark:  #1341a8;
    --primary-light: #e8f0fe;
    --accent:        #ea580c;
    --bg:            #f8fafc;
    --card-bg:       #ffffff;
    --text:          #0f172a;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --radius:        14px;
    --radius-sm:     8px;
    --shadow:        0 1px 4px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
    --shadow-hover:  0 4px 16px rgba(26,86,219,.12), 0 12px 32px rgba(0,0,0,.08);
    --nav-h:         100px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== LAYOUT ===== */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== NAVBAR ===== */
.navbar {
    position: sticky; top: 0; z-index: 200;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-h);
}
.nav-inner {
    display: flex; align-items: center; gap: 1.5rem;
    height: 100%;
}
.navbar-brand {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1.1rem; color: var(--text); flex-shrink: 0;
}
.navbar-brand:hover { opacity: 0.9; }
.navbar-logo { height: 82px; width: auto; display: block; object-fit: contain; }
.logo-icon { font-size: 1.3rem; }
.logo-text strong { color: var(--primary); }

.nav-links {
    display: flex; gap: 0.25rem; align-items: center;
}
.nav-links a {
    padding: 0.4rem 0.75rem; border-radius: 8px;
    font-size: 0.875rem; color: var(--text-muted);
    transition: all .15s;
}
.nav-links a:hover { background: var(--bg); color: var(--text); }

.nav-right {
    display: flex; align-items: center; gap: 0.75rem;
    margin-left: auto;
}

/* User dropdown */
.user-dropdown { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 0.4rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 999px; padding: 0.35rem 0.75rem 0.35rem 0.4rem;
    cursor: pointer; font-size: 0.875rem; color: var(--text);
    transition: all .15s;
}
.user-btn:hover { border-color: var(--primary); }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}
.chevron { font-size: 0.65rem; color: var(--text-muted); }
.dropdown-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 8px);
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); min-width: 180px;
    box-shadow: var(--shadow); overflow: hidden; z-index: 300;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a {
    display: block; padding: 0.65rem 1rem;
    font-size: 0.875rem; color: var(--text);
    transition: background .1s;
}
.dropdown-menu a:hover { background: var(--bg); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 0; }
.logout-link { color: #dc2626 !important; }

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
    margin-left: auto;
}
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px; transition: all .2s;
}

/* Mobile menu */
.mobile-menu {
    display: none; flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    background: #fff; border-top: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    padding: 0.7rem 0; font-size: 0.95rem; color: var(--text);
    border-bottom: 1px solid var(--border);
}
.mobile-menu hr { border: none; border-top: 1px solid var(--border); margin: 0.5rem 0; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.55rem 1.4rem; border-radius: 999px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    border: none; transition: all .2s; white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,86,219,.3); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline   { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block     { width: 100%; }
.btn-lg        { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-sm        { padding: 0.4rem 1rem; font-size: 0.82rem; }

/* ===== MAIN ===== */
main { min-height: calc(100vh - var(--nav-h)); }

/* ===== ALERTS ===== */
.alert { padding: 0.9rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-size: 0.9rem; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #16a34a; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #1a1f36 0%, #1a56db 100%);
    color: #fff; overflow: hidden;
}
.hero-inner {
    max-width: 1160px; margin: 0 auto; padding: 5rem 1.5rem 3rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.hero-badge {
    display: inline-block; background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px; padding: 0.25rem 0.9rem;
    font-size: 0.8rem; font-weight: 600; margin-bottom: 1.25rem;
    backdrop-filter: blur(4px);
}
.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800; line-height: 1.15; margin-bottom: 1.25rem;
}
.hero-title .highlight {
    background: linear-gradient(90deg, #ea580c, #fbbf24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 1.1rem; line-height: 1.7;
    color: rgba(255,255,255,.8); margin-bottom: 2rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Animated cards stack */
.hero-visual { display: flex; align-items: center; justify-content: center; }
.hero-card-stack { display: flex; flex-direction: column; gap: 1rem; width: 100%; max-width: 340px; }
.hcard {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    backdrop-filter: blur(6px);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    font-size: 0.9rem; font-weight: 500;
    transform: translateX(0); animation: floatIn .5s ease forwards;
    opacity: 0;
}
.hcard-1 { animation-delay: .1s; }
.hcard-2 { animation-delay: .3s; transform: translateX(20px); }
.hcard-3 { animation-delay: .5s; transform: translateX(-10px); }
@keyframes floatIn {
    to { opacity: 1; transform: translateX(0); }
}

/* Stats bar */
.stats-bar {
    max-width: 1160px; margin: 0 auto;
    padding: 1.5rem;
    display: flex; align-items: center; justify-content: center; gap: 0;
    border-top: 1px solid rgba(255,255,255,.12);
}
.stat-item { text-align: center; padding: 0 3rem; }
.stat-num { display: block; font-size: 2rem; font-weight: 800; color: #fff; }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .05em; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.2); }

/* ===== SECTIONS ===== */
.section { padding: 4rem 0; max-width: 1160px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2rem; }
.section-header h2 { font-size: 1.6rem; font-weight: 700; }
.section-header p { color: var(--text-muted); margin-top: 0.4rem; }
.link-tutti { font-size: 0.9rem; color: var(--primary); font-weight: 500; }

/* ===== CATEGORIE GRID ===== */
.categorie-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem;
}
.cat-card {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 1.75rem 1rem;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    transition: all .2s;
}
.cat-card:hover {
    border-color: var(--primary); transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.cat-icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.cat-nome { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.25rem; }
.cat-desc { font-size: 0.78rem; color: var(--text-muted); }

/* ===== COME FUNZIONA ===== */
.section-how { background: var(--bg); }
.steps-grid {
    display: flex; align-items: flex-start; gap: 0; margin-bottom: 2.5rem;
}
.step-card {
    flex: 1; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2rem 1.5rem; text-align: center; position: relative;
}
.step-num {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    width: 28px; height: 28px; background: var(--primary); color: #fff;
    border-radius: 50%; font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.step-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.step-card h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.step-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.step-arrow {
    font-size: 1.5rem; color: var(--text-muted); padding: 0 0.75rem;
    align-self: center; flex-shrink: 0;
}

/* Rules box */
.rules-box {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem;
}
.rules-box h3 { margin-bottom: 1.25rem; font-size: 1.1rem; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.rule-item { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; }
.rule-check { flex-shrink: 0; }

/* ===== POSTS GRID ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.post-card {
    background: var(--card-bg); border-radius: var(--radius);
    border: 1px solid var(--border); overflow: hidden;
    transition: all .2s; display: block; color: var(--text);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.post-img { height: 190px; overflow: hidden; }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-img img { transform: scale(1.04); }
.post-img-placeholder { height: 190px; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; background: var(--bg); }
.post-body { padding: 1.1rem; }
.post-cat { font-size: 0.72rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.post-titolo { margin: 0.3rem 0 0.5rem; font-size: 1rem; font-weight: 600; line-height: 1.35; }
.post-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.5; }
.post-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }
.post-prezzo { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 0.4rem; }
.dettaglio-prezzo { font-size: 1.9rem; font-weight: 800; color: var(--primary); margin: 0.5rem 0 1rem; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--text-muted); }
.empty-state p { margin-bottom: 0.5rem; }

/* ===== PAGINAZIONE ===== */
.paginazione { display: flex; gap: 0.4rem; justify-content: center; margin-top: 2.5rem; }
.page-btn { padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; color: var(--text); }
.page-btn.active, .page-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== FILTRI BAR ===== */
.lista-container { max-width: 1160px; margin: 2rem auto; padding: 0 1.5rem; }
.filtri-bar { margin-bottom: 1rem; }
.filtri-form { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.input-cerca {
    flex: 1; min-width: 200px; padding: 0.6rem 1.1rem;
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 0.9rem; font-family: inherit;
}
.input-cerca:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.select-categoria {
    padding: 0.6rem 1.1rem; border: 1px solid var(--border);
    border-radius: 999px; font-size: 0.9rem; font-family: inherit;
}
.categorie-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.categoria-pill {
    padding: 0.4rem 1rem; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 0.82rem; color: var(--text); transition: all .15s;
}
.categoria-pill:hover, .categoria-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.risultati-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; color: var(--text-muted); font-size: 0.9rem; }

/* ===== AUTH ===== */
.auth-container { max-width: 440px; margin: 3rem auto; padding: 0 1.5rem; }
.auth-box { background: var(--card-bg); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.auth-box h1 { margin-bottom: 1.75rem; font-size: 1.6rem; }
.auth-footer { margin-top: 1.5rem; text-align: center; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { font-weight: 600; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; font-weight: 500; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    width: 100%; padding: 0.65rem 0.95rem;
    border: 1px solid var(--border); border-radius: 9px;
    font-size: 0.95rem; font-family: inherit; background: var(--bg);
    transition: border .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none; border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.form-group small { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: var(--text-muted); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
legend { padding: 0 0.5rem; font-weight: 600; font-size: 0.9rem; }
.form-container { max-width: 700px; margin: 2rem auto; padding: 0 1.5rem; }
.form-container h1 { margin-bottom: 1.75rem; }
.form-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== AVATAR UPLOAD ===== */
.avatar-upload { display: flex; align-items: center; gap: 1.25rem; }
.avatar-preview {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--primary-light); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; overflow: hidden; flex-shrink: 0;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-input { flex: 1; }
.avatar-input input[type="file"] { font-size: 0.85rem; }
.avatar-input small { display: block; margin-top: 0.3rem; color: var(--text-muted); font-size: 0.78rem; }

/* ===== PROFILO ===== */
.profile-card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 2rem; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.profile-card h2 { font-size: 1.15rem; margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }

/* Alert success */
.alert-success { background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1.25rem; color: #166534; }

/* ===== DETTAGLIO ===== */
.dettaglio-container { max-width: 980px; margin: 2rem auto; padding: 0 1.5rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.3rem; margin-bottom: 1.5rem; color: var(--text-muted); font-size: 0.875rem; }
.back-link:hover { color: var(--primary); }
.dettaglio-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.foto-gallery { display: flex; flex-direction: column; gap: 0.75rem; }
.foto-main { border-radius: var(--radius); cursor: zoom-in; object-fit: cover; max-height: 300px; width: 100%; }
.foto-placeholder { height: 300px; display: flex; align-items: center; justify-content: center; font-size: 5rem; background: var(--bg); border-radius: var(--radius); }
.categoria-badge { display: inline-block; background: var(--primary-light); color: var(--primary); border-radius: 999px; padding: 0.25rem 0.85rem; font-size: 0.78rem; font-weight: 600; margin-bottom: 0.75rem; }
.dettaglio-info h1 { font-size: 1.6rem; margin-bottom: 1rem; line-height: 1.25; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.65rem; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.descrizione-box { background: var(--bg); border-radius: var(--radius-sm); padding: 1.25rem; margin-bottom: 1.75rem; line-height: 1.75; font-size: 0.95rem; }
.contatti-box { margin-bottom: 1.5rem; }
.contatti-box h3 { margin-bottom: 0.85rem; font-size: 1rem; }
.contatti-list { display: flex; flex-direction: column; gap: 0.65rem; }
.contatto-btn { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1.25rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; transition: opacity .15s; }
.contatto-btn:hover { opacity: .82; }
.contatto-btn.email    { background: #eff6ff; color: var(--primary); }
.contatto-btn.whatsapp { background: #f0fdf4; color: #15803d; }
.contatto-btn.telegram { background: #e0f2fe; color: #0369a1; }
.owner-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ===== PROFILO ===== */
.profilo-container { max-width: 820px; margin: 2rem auto; padding: 0 1.5rem; }
.profilo-header { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.profilo-header h1 { margin-right: auto; font-size: 1.6rem; }
.quota-bar { font-size: 0.875rem; color: var(--text-muted); }
.miei-annunci-lista { display: flex; flex-direction: column; gap: 0.85rem; }
.mio-annuncio { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; transition: box-shadow .15s; }
.mio-annuncio:hover { box-shadow: var(--shadow); }
.mio-annuncio.scaduto { opacity: .55; }
.mio-annuncio-info { display: flex; align-items: center; gap: 0.9rem; }
.mio-annuncio-info .thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.mio-annuncio-info h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.mio-annuncio-info span { font-size: 0.78rem; color: var(--text-muted); margin-right: 0.5rem; }
.mio-annuncio-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-expired { background: #fef2f2; color: #dc2626; }
.badge-premium { background: linear-gradient(90deg, #ea580c, #fbbf24); color: #fff; }

/* ===== CTA SECTION ===== */
.section-cta { padding: 5rem 1.5rem; background: linear-gradient(135deg, #1a1f36 0%, #1a56db 100%); }
.cta-box { max-width: 600px; margin: 0 auto; text-align: center; color: #fff; }
.cta-box h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem; }
.cta-box p { font-size: 1.1rem; color: rgba(255,255,255,.75); margin-bottom: 2rem; }

/* ===== FOOTER ===== */
.footer { background: #0f172a; color: rgba(255,255,255,.65); padding: 3.5rem 1.5rem 0; margin-top: 4rem; }
.footer-inner { max-width: 1160px; margin: 0 auto; display: flex; gap: 3rem; flex-wrap: wrap; padding-bottom: 3rem; }
.footer-brand { flex: 1; min-width: 200px; }
.footer-logo { height: 40px; width: auto; display: block; }
.footer-tagline { margin-top: 0.75rem; font-size: 0.85rem; color: rgba(255,255,255,.45); line-height: 1.5; }
.footer-contact { margin-top: 0.4rem; font-size: 0.85rem; color: rgba(255,255,255,.45); }
.footer-contact a { color: #60a5fa; }
.footer-contact a:hover { color: #93c5fd; }
.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col h4 { color: rgba(255,255,255,.9); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.footer-col a { font-size: 0.85rem; color: rgba(255,255,255,.5); }
.footer-col a:hover { color: rgba(255,255,255,.9); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 1.25rem 1.5rem; max-width: 1160px; margin: 0 auto; font-size: 0.8rem; color: rgba(255,255,255,.35); }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.footer-credits { font-size: 0.78rem; color: rgba(255,255,255,.35); }
.footer-credits a { color: rgba(255,255,255,.55); text-decoration: none; }
.footer-credits a:hover { color: rgba(255,255,255,.85); text-decoration: underline; }
.footer-admin-link { font-size: 0.85rem; color: rgba(255,255,255,.2); text-decoration: none; transition: color .2s; }
.footer-admin-link:hover { color: rgba(255,255,255,.6); }

/* ===== PREMIUM PAGE ===== */
.premium-container { max-width: 900px; margin: 3rem auto; padding: 0 1.5rem; }
.premium-hero { text-align: center; margin-bottom: 3rem; }
.premium-badge { display: inline-block; background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; font-size: 0.8rem; font-weight: 700; padding: 0.3rem 1rem; border-radius: 20px; letter-spacing: .05em; margin-bottom: 1rem; }
.premium-badge-big { display: inline-block; background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; font-size: 1rem; font-weight: 700; padding: 0.5rem 1.5rem; border-radius: 20px; margin-bottom: 1rem; }
.premium-hero h1 { font-size: 2.2rem; margin-bottom: 0.75rem; }
.premium-sub { font-size: 1.15rem; color: var(--text-muted); }
.premium-active { text-align: center; padding: 4rem 2rem; }
.premium-active h1 { margin: 1rem 0 0.5rem; }
.premium-active p { color: var(--text-muted); margin-bottom: 2rem; }
.premium-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.plan-card { background: var(--card-bg); border: 2px solid var(--border); border-radius: var(--radius); padding: 2rem; position: relative; }
.plan-premium { border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.1); }
.plan-popular { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: #f59e0b; color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 1rem; border-radius: 20px; white-space: nowrap; }
.plan-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.plan-price { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 1.5rem; }
.plan-price span { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; font-size: 0.9rem; }
.plan-features .disabled { opacity: .45; }
.plan-current { font-size: 0.8rem; color: var(--text-muted); background: var(--bg); border-radius: 8px; padding: 0.5rem 0.75rem; text-align: center; }
.paypal-note { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 0.75rem; }
@media (max-width: 600px) { .premium-grid { grid-template-columns: 1fr; } .premium-hero h1 { font-size: 1.6rem; } }

/* ===== PIANI PAGE ===== */
.piani-container { max-width: 960px; margin: 3rem auto; padding: 0 1.5rem; }
.piani-hero { text-align: center; margin-bottom: 3rem; }
.piani-hero h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.piani-hero p { font-size: 1.1rem; color: var(--text-muted); }
.piani-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; margin-bottom: 4rem; }
.piano-card { background: var(--card-bg); border: 2px solid var(--border); border-radius: var(--radius); padding: 2rem; position: relative; }
.piano-card--premium { border-color: #f59e0b; box-shadow: 0 8px 32px rgba(245,158,11,.15); }
.piano-badge-top { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg,#f59e0b,#ea580c); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 1.25rem; border-radius: 20px; white-space: nowrap; }
.piano-header { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.piano-nome { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.75rem; }
.piano-prezzo { font-size: 2.8rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 0.75rem; }
.piano-card--premium .piano-prezzo { color: var(--primary); }
.piano-prezzo span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.piano-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.piano-lista { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 2rem; font-size: 0.9rem; }
.piano-lista .no { opacity: .4; }
.piano-cta .btn-block { width: 100%; justify-content: center; padding: 0.85rem; font-size: 1rem; }
.btn-premium { background: linear-gradient(135deg,#f59e0b,#ea580c); color: #fff; border: none; }
.btn-premium:hover { opacity: .9; transform: translateY(-1px); }
.btn-premium-active { background: #fef3c7; color: #92400e; cursor: default; border: 1px solid #f59e0b; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: .85rem; font-size: 1rem; font-weight: 600; }
/* FAQ */
.piani-faq { padding-top: 2rem; border-top: 1px solid var(--border); }
.piani-faq h2 { font-size: 1.5rem; margin-bottom: 1.75rem; text-align: center; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.faq-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.faq-item h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.faq-item p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }
@media (max-width: 700px) { .piani-grid, .faq-grid { grid-template-columns: 1fr; } .piani-hero h1 { font-size: 1.5rem; } }

/* ===== 404 PAGE ===== */
.error404-container { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 3rem 1.5rem; }
.error404-box { text-align: center; max-width: 520px; }
.error404-code { font-size: 7rem; font-weight: 900; line-height: 1; color: var(--primary); opacity: .15; letter-spacing: -.05em; }
.error404-title { font-size: 1.8rem; font-weight: 700; margin: -1rem 0 1rem; color: var(--text); }
.error404-sub { font-size: 1rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 2.5rem; }
.error404-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
@media (max-width: 480px) { .error404-code { font-size: 5rem; } .error404-title { font-size: 1.4rem; } .error404-actions { flex-direction: column; align-items: stretch; } }

/* ===== PRIVACY PAGE ===== */
.privacy-container { max-width: 860px; margin: 2.5rem auto 4rem; padding: 0 1.5rem; }
.privacy-hero { text-align: center; margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.privacy-hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.privacy-hero p { font-size: 0.9rem; color: var(--text-muted); }
.privacy-toc { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 2rem; margin-bottom: 2.5rem; }
.privacy-toc h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.privacy-toc ol { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.privacy-toc a { font-size: 0.9rem; color: var(--primary); }
.privacy-section { margin-bottom: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--border); }
.privacy-section:last-child { border-bottom: none; }
.privacy-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.privacy-section h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.6rem; }
.privacy-section p { font-size: 0.925rem; line-height: 1.8; color: #334155; margin-bottom: 0.85rem; }
.privacy-section a { color: var(--primary); }
.privacy-box { background: var(--primary-light); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; margin: 1rem 0; }
.privacy-box p { margin: 0; line-height: 1.75; }
.privacy-list { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0; }
.privacy-list li { font-size: 0.925rem; line-height: 1.7; color: #334155; }
.privacy-table-wrapper { overflow-x: auto; margin: 1rem 0; }
.privacy-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.privacy-table th { background: #f8fafc; padding: 0.75rem 1rem; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.privacy-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); line-height: 1.55; vertical-align: top; }
.privacy-table tr:last-child td { border-bottom: none; }
.privacy-table code { background: #f1f5f9; padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.82rem; }
.tag-tecnico  { background: #dcfce7; color: #166534; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 20px; white-space: nowrap; }
.tag-analitico { background: #dbeafe; color: #1e40af; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 20px; white-space: nowrap; }
.tag-terze    { background: #fef3c7; color: #92400e; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 20px; white-space: nowrap; }
.diritti-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.25rem 0; }
.diritto-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.diritto-icon { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.diritto-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.35rem; }
.diritto-card p { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.55; }
@media (max-width: 700px) {
    .diritti-grid { grid-template-columns: 1fr 1fr; }
    .privacy-hero h1 { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .diritti-grid { grid-template-columns: 1fr; }
}

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

/* --- Tablet (max 900px) --- */
@media (max-width: 900px) {
    /* Navbar */
    .nav-links          { display: none; }
    .hamburger          { display: flex; }
    .nav-right .btn-sm  { display: none; }
    .user-dropdown      { display: none; }

    /* Hero */
    .hero-inner         { grid-template-columns: 1fr; text-align: center; padding: 3.5rem 1.25rem 2rem; }
    .hero-visual        { display: none; }
    .hero-cta           { justify-content: center; }
    .hero-sub           { font-size: 1rem; }

    /* Stats */
    .stats-bar          { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0; padding: 1.25rem 1rem; }
    .stat-item          { padding: 0.5rem 1.5rem; }
    .stat-divider       { width: 1px; height: 36px; }
    .stat-num           { font-size: 1.6rem; }

    /* Categorie */
    .categorie-grid     { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }

    /* Steps */
    .steps-grid         { flex-direction: column; gap: 0; }
    .step-arrow         { display: none; }
    .step-card          { margin-bottom: 1rem; }

    /* Rules */
    .rules-grid         { grid-template-columns: 1fr; }

    /* Dettaglio */
    .dettaglio-layout   { grid-template-columns: 1fr; }

    /* Footer */
    .footer-inner       { flex-direction: column; gap: 2rem; }
    .footer-links       { gap: 2rem; }
}

/* --- Mobile grande (max 640px) --- */
@media (max-width: 640px) {
    /* Base */
    body                { font-size: 15px; }
    .container          { padding: 0 1rem; }

    /* Navbar */
    .navbar             { height: 70px; }
    :root               { --nav-h: 70px; }
    .navbar-logo        { height: 56px; }
    .logo-text          { font-size: 1rem; }

    /* Hero */
    .hero-inner         { padding: 2.5rem 1rem 1.5rem; }
    .hero-title         { font-size: 1.75rem; }
    .hero-badge         { font-size: 0.75rem; }
    .hero-sub           { font-size: 0.95rem; }
    .hero-cta           { flex-direction: column; align-items: stretch; }
    .hero-cta .btn      { width: 100%; justify-content: center; padding: 0.9rem 1rem; font-size: 1rem; }

    /* Stats */
    .stats-bar          { flex-direction: column; gap: 0; padding: 1rem; }
    .stat-item          { padding: 0.6rem 1rem; width: 100%; display: flex; justify-content: center; align-items: center; gap: 0.75rem; }
    .stat-num           { font-size: 1.4rem; display: inline; }
    .stat-label         { display: inline; font-size: 0.8rem; }
    .stat-divider       { display: none; }

    /* Sezioni */
    .section            { padding: 2.5rem 1rem; }
    .section-header h2  { font-size: 1.3rem; }

    /* Categorie */
    .categorie-grid     { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
    .cat-card           { padding: 1.25rem 0.75rem; }
    .cat-icon           { font-size: 1.8rem; }
    .cat-nome           { font-size: 0.85rem; }
    .cat-desc           { display: none; }

    /* Post cards */
    .posts-grid         { grid-template-columns: 1fr; gap: 1rem; }
    .post-img           { height: 160px; }

    /* Steps */
    .step-card          { padding: 1.75rem 1.25rem; }
    .step-icon          { font-size: 2rem; }

    /* Forms */
    .form-container     { padding: 0 1rem; }
    .form-group input,
    .form-group textarea,
    .form-group select  { font-size: 16px; } /* evita zoom automatico iOS */
    .form-actions       { flex-direction: column; }
    .form-actions .btn  { width: 100%; justify-content: center; padding: 0.85rem; }

    /* Auth */
    .auth-container     { padding: 0 1rem; margin: 1.5rem auto; }
    .auth-box           { padding: 1.75rem 1.25rem; }

    /* Filtri */
    .filtri-form        { flex-direction: column; }
    .input-cerca        { width: 100%; }
    .select-categoria   { width: 100%; }
    .filtri-form .btn   { width: 100%; justify-content: center; }

    /* Dettaglio */
    .dettaglio-container { padding: 0 1rem; }
    .dettaglio-info h1  { font-size: 1.3rem; }
    .owner-actions      { flex-wrap: wrap; }
    .owner-actions .btn { flex: 1; justify-content: center; }

    /* Profilo */
    .profilo-container  { padding: 0 1rem; }
    .profilo-header     { flex-direction: column; align-items: flex-start; }
    .mio-annuncio       { flex-direction: column; align-items: flex-start; }
    .mio-annuncio-actions { width: 100%; justify-content: flex-end; }

    /* Pulsanti touch target minimo 44px */
    .btn                { min-height: 44px; }
    .btn-sm             { min-height: 36px; }
    .page-btn           { min-height: 44px; min-width: 44px; }

    /* CTA */
    .cta-box h2         { font-size: 1.5rem; }
    .cta-box p          { font-size: 0.95rem; }
    .section-cta        { padding: 3rem 1rem; }

    /* Footer */
    .footer             { padding: 2.5rem 1rem 0; margin-top: 2rem; }
    .footer-links       { flex-direction: column; gap: 1.5rem; }
}

/* --- Mobile piccolo (max 380px, iPhone SE ecc.) --- */
@media (max-width: 380px) {
    .hero-title         { font-size: 1.5rem; }
    .categorie-grid     { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .cat-card           { padding: 1rem 0.5rem; }
    .navbar-brand       { font-size: 0.95rem; }
    .stat-num           { font-size: 1.25rem; }
}

/* ===== FOTO UPGRADE HINT ===== */
.foto-upgrade-hint { font-size: .8rem; font-weight: 400; color: var(--text-muted); }
.foto-upgrade-hint a { color: #ea580c; text-decoration: none; font-weight: 600; }
.foto-upgrade-hint a:hover { text-decoration: underline; }
