/* ═══════════════════════════════════════════════════════
   ConcorsiItalia — site.css
   Classi basate sul layout/template reale del progetto
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Variables ─────────────────────────────── */
:root {
    --navy:      #0f1f3d;
    --navy-mid:  #1a3260;
    --cobalt:    #1e4db7;
    --sky:       #3b82f6;
    --gold:      #f59e0b;
    --green:     #10b981;
    --orange:    #f97316;
    --red:       #ef4444;
    --cream:     #fafaf7;
    --gray-50:   #f9fafb;
    --gray-100:  #f3f4f6;
    --gray-200:  #e5e7eb;
    --gray-400:  #9ca3af;
    --gray-600:  #6b7280;
    --gray-700:  #374151;
    --gray-800:  #1f2937;
    --white:     #ffffff;
    --r:         10px;
    --shadow:    0 1px 4px rgba(15,31,61,.08);
    --shadow-md: 0 4px 20px rgba(15,31,61,.12);
    --shadow-lg: 0 12px 40px rgba(15,31,61,.18);
    --t:         .2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--cream);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--cobalt); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--navy); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════ */
.nav {
    background: var(--navy);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.nav-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex; align-items: center; gap: 1.5rem;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; flex-shrink: 0;
}
.nav-logo-icon {
    width: 36px; height: 36px;
    background: var(--gold); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.nav-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; font-weight: 700;
    color: var(--white); letter-spacing: -.3px;
}
.nav-logo-text em { color: var(--gold); font-style: normal; }
.nav-links {
    display: flex; align-items: center; gap: .25rem;
    flex: 1;
}
.nav-links li > a {
    color: rgba(255,255,255,.75);
    font-size: .875rem; font-weight: 500;
    padding: .4rem .75rem; border-radius: 6px;
    transition: all var(--t); display: block;
}
.nav-links li > a:hover { color: white; background: rgba(255,255,255,.08); }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
    background: none; border: none;
    color: rgba(255,255,255,.75);
    font-size: .875rem; font-weight: 500;
    padding: .4rem .75rem; border-radius: 6px;
    transition: all var(--t);
}
.nav-dropdown-btn:hover { color: white; background: rgba(255,255,255,.08); }
.nav-dropdown-menu {
    display: none;
    position: absolute; top: calc(100% + 8px); left: 0;
    background: white; border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: .5rem 0;
    z-index: 200;
    border: 1px solid var(--gray-200);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block; padding: .6rem 1.25rem;
    color: var(--gray-700); font-size: .875rem;
    transition: background var(--t);
}
.nav-dropdown-menu a:hover { background: var(--gray-50); color: var(--cobalt); }
.nav-dropdown-all {
    border-top: 1px solid var(--gray-200);
    margin-top: .25rem;
    color: var(--cobalt) !important;
    font-weight: 600 !important;
}

/* Auth buttons */
.nav-auth {
    margin-left: auto;
    display: flex; align-items: center; gap: .5rem; flex-shrink: 0;
}
.btn-nav-ghost {
    background: none; border: none;
    color: rgba(255,255,255,.75);
    font-size: .875rem; font-weight: 500;
    padding: .4rem .875rem; border-radius: 6px;
    transition: all var(--t);
}
.btn-nav-ghost:hover { color: white; background: rgba(255,255,255,.08); }
.btn-nav-secondary {
    border: 1.5px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.85);
    font-size: .875rem; font-weight: 500;
    padding: .4rem .875rem; border-radius: 6px;
    transition: all var(--t);
}
.btn-nav-secondary:hover { border-color: rgba(255,255,255,.6); color: white; }
.btn-nav-primary {
    background: var(--gold); color: var(--navy);
    font-size: .875rem; font-weight: 700;
    padding: .45rem 1rem; border-radius: 6px;
    transition: background var(--t);
}
.btn-nav-primary:hover { background: #e08c00; color: var(--navy); }
.btn-nav-admin {
    background: rgba(245,158,11,.15);
    border: 1px solid rgba(245,158,11,.35);
    color: var(--gold);
    font-size: .8rem; font-weight: 600;
    padding: .35rem .875rem; border-radius: 6px;
    transition: all var(--t);
}
.btn-nav-admin:hover { background: rgba(245,158,11,.25); color: var(--gold); }

/* Mobile toggle */
.nav-mobile-toggle {
    display: none;
    flex-direction: column; gap: 5px;
    background: none; border: none;
    padding: 4px; margin-left: auto;
}
.nav-mobile-toggle span {
    display: block; width: 22px; height: 2px;
    background: white; border-radius: 2px;
    transition: all var(--t);
}

/* ═══════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════ */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, #0d2b7a 100%);
    padding: 5rem 1.5rem 6rem;
    text-align: center;
    position: relative; overflow: hidden;
}
.hero-bg-pattern {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse at 25% 60%, rgba(59,130,246,.18) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 20%, rgba(245,158,11,.12) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(245,158,11,.15);
    border: 1px solid rgba(245,158,11,.3);
    color: #fde68a;
    font-size: .78rem; font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase;
    padding: 5px 16px; border-radius: 100px;
    margin-bottom: 1.5rem;
}
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    font-weight: 900; color: white;
    line-height: 1.1; margin-bottom: 1rem;
}
.hero-title em { color: var(--gold); font-style: normal; }
.hero-subtitle {
    color: rgba(255,255,255,.72);
    font-size: 1.05rem; line-height: 1.75;
    margin-bottom: 2.5rem; font-weight: 300;
}

/* Search */
.hero-search { max-width: 680px; margin: 0 auto 2rem; }
.search-bar {
    background: white; border-radius: 12px;
    padding: 6px 6px 6px 18px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.search-icon { color: var(--gray-400); font-size: 1rem; flex-shrink: 0; }
.search-input {
    flex: 1; border: none; outline: none;
    font-family: inherit; font-size: .95rem;
    color: var(--gray-800); background: transparent; min-width: 0;
}
.search-input::placeholder { color: var(--gray-400); }
.btn-search {
    background: var(--cobalt); color: white;
    border: none; padding: 10px 22px;
    border-radius: 8px; font-family: inherit;
    font-weight: 700; font-size: .9rem;
    transition: background var(--t); white-space: nowrap;
}
.btn-search:hover { background: #1640a0; }
.filter-actions {
    margin-top: 16px;
}


.filter-submit {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: #2f5bea;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
}

    .filter-submit:hover {
        opacity: 0.96;
    }
/* Quick links */
.hero-quick-links {
    display: flex; align-items: center; gap: .5rem;
    flex-wrap: wrap; justify-content: center;
    font-size: .82rem; color: rgba(255,255,255,.6);
}
.quick-link {
    color: rgba(255,255,255,.8);
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    padding: 4px 12px; border-radius: 100px;
    font-size: .8rem; font-weight: 500;
    transition: all var(--t);
}
.quick-link:hover { background: rgba(255,255,255,.2); color: white; }

/* ═══════════════════════════════════════════════════════
   STATS STRIP
   ═══════════════════════════════════════════════════════ */
.stats-strip {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 0;
}
.stats-grid {
    display: flex; align-items: center;
    justify-content: center; gap: 2rem;
    flex-wrap: wrap;
}
.stat-item { display: flex; align-items: center; gap: 8px; }
.stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; font-weight: 700; color: var(--cobalt);
}
.stat-label { font-size: .8rem; color: var(--gray-600); font-weight: 500; }
.stat-divider { width: 1px; height: 30px; background: var(--gray-200); }

/* ═══════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════ */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--gray-50); }
.section-header {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 1rem;
    margin-bottom: 2rem; flex-wrap: wrap;
}
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem; color: var(--navy);
}
.section-sub { font-size: .875rem; color: var(--gray-600); margin-top: .2rem; }

/* Bandi grid on home */
.bandi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

/* CTA box */
.section-cta { padding: 4rem 0; }
.cta-box {
    background: linear-gradient(135deg, var(--navy), var(--navy-mid));
    border-radius: 16px; padding: 3rem 2rem;
    text-align: center; color: white;
}
.cta-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem; margin-bottom: .5rem;
}
.cta-text p { color: rgba(255,255,255,.7); margin-bottom: 1.75rem; }
.cta-actions { display: flex; gap: .875rem; justify-content: center; flex-wrap: wrap; }
.btn-cta-primary {
    background: var(--gold); color: var(--navy);
    font-weight: 700; font-size: .95rem;
    padding: 12px 28px; border-radius: 8px;
    transition: background var(--t);
}
.btn-cta-primary:hover { background: #e08c00; color: var(--navy); }
.btn-cta-ghost {
    border: 1.5px solid rgba(255,255,255,.3);
    color: white; font-weight: 600; font-size: .95rem;
    padding: 11px 24px; border-radius: 8px;
    transition: all var(--t);
}
.btn-cta-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }

/* Categorie grid on home */
.categorie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.categoria-card {
    background: white; border: 1.5px solid var(--gray-200);
    border-radius: var(--r); padding: 1.25rem 1rem;
    text-align: center; cursor: pointer;
    transition: all var(--t); text-decoration: none;
    color: var(--gray-800); display: block;
}
.categoria-card:hover {
    border-color: var(--cobalt); color: var(--cobalt);
    transform: translateY(-3px); box-shadow: var(--shadow-md);
}
.cat-icon { font-size: 1.75rem; display: block; margin-bottom: .5rem; }
.cat-nome { font-weight: 600; font-size: .875rem; margin-bottom: .2rem; }
.cat-count { font-size: .78rem; color: var(--gray-400); }

/* ═══════════════════════════════════════════════════════
   BANDO CARD
   ═══════════════════════════════════════════════════════ */
.bando-card {
    background: white; border: 1.5px solid var(--gray-200);
    border-radius: var(--r); overflow: hidden;
    transition: all var(--t); box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    position: relative;
}
.bando-card::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0; width: 4px;
}
.bando-card.status-open::before   { background: var(--green); }
.bando-card.status-closing::before { background: var(--orange); }
.bando-card.status-closed::before  { background: var(--gray-400); }
.bando-card:hover {
    border-color: var(--cobalt);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.bando-card-inner { padding: 1.35rem; display: flex; flex-direction: column; flex: 1; }
.bando-card-top {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: .75rem;
    margin-bottom: .75rem;
}
.bando-badges { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 100px;
    font-size: .71rem; font-weight: 700; letter-spacing: .2px;
    white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #ffedd5; color: #9a3412; }
.badge-closed   { background: var(--gray-100); color: var(--gray-600); }
.badge-new      { background: var(--gold); color: var(--navy); }
.badge-cat      { background: #dbeafe; color: #1e40af; }
.badge-region   { background: #dcfce7; color: #166534; }

.bando-save-btn {
    background: var(--cobalt); color: white;
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; font-weight: 700; flex-shrink: 0;
    transition: background var(--t);
}
.bando-save-btn:hover { background: #1640a0; color: white; }

.bando-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem; font-weight: 700;
    color: var(--navy); line-height: 1.35;
    margin-bottom: .3rem;
}
.bando-title a { color: inherit; }
.bando-title a:hover { color: var(--cobalt); }
.bando-ente { font-size: .82rem; color: var(--gray-600); font-weight: 500; margin-bottom: .5rem; }
.bando-desc {
    font-size: .82rem; color: var(--gray-600); line-height: 1.55;
    margin-bottom: .75rem;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

.bando-meta {
    display: flex; flex-wrap: wrap; gap: .5rem .875rem;
    margin-top: auto; padding-top: .875rem;
    border-top: 1px solid var(--gray-200);
    font-size: .78rem; color: var(--gray-600);
    margin-bottom: .875rem;
}
.bando-meta-item { display: flex; align-items: center; gap: 4px; }
.bando-meta-item.meta-warning { color: var(--orange); font-weight: 600; }

.bando-card-footer {
    display: flex; align-items: center;
    justify-content: space-between; gap: .5rem;
    flex-wrap: wrap;
}
.btn-detail {
    background: var(--cobalt); color: white;
    padding: 7px 16px; border-radius: 7px;
    font-size: .82rem; font-weight: 700;
    transition: background var(--t);
}
.btn-detail:hover { background: #1640a0; color: white; }
.bando-fonte { font-size: .72rem; color: var(--gray-400); }

/* ═══════════════════════════════════════════════════════
   BANDI LIST PAGE
   ═══════════════════════════════════════════════════════ */
.page-bandi { padding-bottom: 4rem; }
.bandi-topbar {
    background: var(--navy);
    padding: 1.75rem 0; margin-bottom: 2rem;
}
.bandi-topbar-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
    display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.bandi-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem; color: white; margin: 0;
}
.bandi-title em { color: var(--gold); font-style: normal; }
.bandi-count { color: rgba(255,255,255,.6); font-size: .875rem; }

.bandi-layout {
    max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
    display: grid; grid-template-columns: 270px 1fr;
    gap: 2rem; align-items: start;
}
.bandi-results { min-width: 0; }
.bandi-list { display: flex; flex-direction: column; gap: 1rem; }


.bandi-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .28);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

    .bandi-loading-overlay.is-visible {
        display: flex;
    }
.bandi-loading-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    padding: 18px 22px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    min-width: 260px;
}
.bandi-loading-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #dbeafe;
    border-top-color: var(--cobalt);
    animation: bandi-spin .8s linear infinite;
}
.bandi-loading-text { font-weight: 700; color: var(--navy); }
body.is-loading { cursor: progress; }
@keyframes bandi-spin { to { transform: rotate(360deg); } }

/* Sidebar filtri */
.sidebar-filtri {
    background: white;
    border-radius: var(--r);
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    align-self: start;
}
.filtri-header {
    background: var(--navy); padding: .875rem 1.25rem;
    color: white; font-weight: 600; font-size: .9rem;
    display: flex; align-items: center; justify-content: space-between;
}
.filtri-reset-link {
    color: rgba(255,255,255,.6); font-size: .75rem; font-weight: 400;
}
.filtri-reset-link:hover { color: white; }
.filtro-group {
    padding: .875rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.filtro-label {
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--gray-600); margin-bottom: .5rem; display: block;
}
.filtro-select, .filtro-input {
    width: 100%; padding: 8px 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px; font-family: inherit;
    font-size: .85rem; color: var(--gray-800);
    background: var(--gray-50); outline: none;
    transition: border-color var(--t);
}
.filtro-select:focus, .filtro-input:focus { border-color: var(--cobalt); background: white; }
.filtro-checks { display: flex; flex-direction: column; gap: 7px; }
.check-label {
    display: flex; align-items: center; gap: 8px;
    font-size: .85rem; cursor: pointer; color: var(--gray-800);
}
.check-label input { accent-color: var(--cobalt); width: 15px; height: 15px; }
.btn-applica-filtri {
    width: 100%; background: var(--cobalt); color: white;
    border: none; padding: 11px; font-family: inherit;
    font-weight: 700; font-size: .9rem;
    transition: background var(--t);
}
.btn-applica-filtri:hover { background: #1640a0; }

/* Active filter tags */
.filtri-attivi { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.filtro-tag {
    display: flex; align-items: center; gap: 5px;
    background: #eff6ff; color: var(--cobalt);
    border: 1px solid #bfdbfe; padding: 4px 10px;
    border-radius: 100px; font-size: .78rem; font-weight: 600;
}
.filtro-tag a { color: var(--cobalt); font-size: .82rem; line-height: 1; }
.filtro-tag-reset {
    background: var(--gray-100); color: var(--gray-600);
    border-color: var(--gray-200);
}

/* Risultati header */
.bandi-results > div:first-child {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 1rem;
    flex-wrap: wrap; gap: .5rem;
}

/* ═══════════════════════════════════════════════════════
   PAGINAZIONE
   ═══════════════════════════════════════════════════════ */
.paginazione {
    display: flex; justify-content: center; align-items: center;
    gap: 5px; margin-top: 2rem; flex-wrap: wrap;
}
.page-btn {
    min-width: 38px; height: 38px; padding: 0 8px;
    border: 1.5px solid var(--gray-200);
    background: white; border-radius: 7px;
    font-family: inherit; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t); color: var(--gray-800);
    text-decoration: none;
}
.page-btn:hover { border-color: var(--cobalt); color: var(--cobalt); }
.page-btn.active { background: var(--cobalt); border-color: var(--cobalt); color: white; font-weight: 700; }
.page-ellipsis { color: var(--gray-400); padding: 0 4px; line-height: 38px; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn-primary {
    background: var(--cobalt); color: white;
    border: none; padding: 10px 22px; border-radius: 8px;
    font-family: inherit; font-weight: 700; font-size: .9rem;
    transition: background var(--t); display: inline-block;
}
.btn-primary:hover { background: #1640a0; color: white; }
.btn-outline {
    background: white; border: 1.5px solid var(--gray-200);
    color: var(--gray-700); padding: 9px 20px; border-radius: 8px;
    font-family: inherit; font-weight: 600; font-size: .9rem;
    transition: all var(--t); display: inline-block;
}
.btn-outline:hover { border-color: var(--cobalt); color: var(--cobalt); }

/* ═══════════════════════════════════════════════════════
   ACCOUNT / FORMS
   ═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .83rem; font-weight: 600; color: var(--gray-700); margin-bottom: .35rem; }
.form-input, .form-control {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px; font-family: inherit;
    font-size: .9rem; color: var(--gray-800);
    background: var(--gray-50); outline: none;
    transition: all var(--t);
}
.form-input:focus, .form-control:focus { border-color: var(--cobalt); background: white; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; }
.form-row-space { margin-bottom: .875rem; }
.field-error { font-size: .78rem; color: var(--red); margin-top: 3px; }
.btn-auth-submit {
    width: 100%; background: var(--cobalt); color: white;
    border: none; padding: 12px; border-radius: 8px;
    font-family: inherit; font-weight: 700; font-size: .95rem;
    transition: background var(--t); margin-top: .5rem;
}
.btn-auth-submit:hover { background: #1640a0; }
.auth-divider {
    text-align: center; font-size: .8rem;
    color: var(--gray-400); margin: 1.25rem 0;
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: ''; position: absolute;
    top: 50%; width: 40%; height: 1px;
    background: var(--gray-200);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.btn-auth-secondary {
    display: block; width: 100%; text-align: center;
    border: 1.5px solid var(--gray-200); padding: 11px;
    border-radius: 8px; color: var(--gray-700); font-weight: 600;
    font-size: .9rem; transition: all var(--t);
}
.btn-auth-secondary:hover { border-color: var(--cobalt); color: var(--cobalt); }
.auth-logo-link { color: var(--navy); font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; }

/* Alert */
.alert {
    padding: .75rem 1rem; border-radius: 8px;
    font-size: .875rem; margin-bottom: 1rem;
}
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--gray-600); }
.empty-icon  { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--navy); margin-bottom: .5rem; }

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.footer {
    background: var(--navy);
    padding: 3rem 0 0; margin-top: auto;
}
.footer-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 1.5rem 2.5rem;
    display: grid; grid-template-columns: 1.5fr 2fr;
    gap: 3rem;
}
.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem; font-weight: 700; color: white;
    display: block; margin-bottom: .6rem;
}
.footer-brand p { color: rgba(255,255,255,.5); font-size: .85rem; line-height: 1.65; max-width: 280px; }
.footer-links { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: .5rem; }
.footer-col h4 { color: rgba(255,255,255,.9); font-size: .875rem; font-weight: 700; margin-bottom: .25rem; }
.footer-col a { color: rgba(255,255,255,.5); font-size: .84rem; }
.footer-col a:hover { color: rgba(255,255,255,.9); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 1rem 1.5rem;
    text-align: center;
    color: rgba(255,255,255,.35); font-size: .78rem;
    max-width: 1280px; margin: 0 auto;
}
.footer-disclaimer { margin-top: .3rem; color: rgba(255,255,255,.25); font-size: .72rem; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .bandi-layout { grid-template-columns: 240px 1fr; }
}
@media (max-width: 900px) {
    .bandi-layout { grid-template-columns: 1fr; }
    .sidebar-filtri { position: static; }
    .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
    .nav-links, .nav-auth { display: none; flex-direction: column; }
    .nav-links.open, .nav-auth.open {
        display: flex; background: var(--navy-mid);
        padding: .75rem 1.5rem; width: 100%;
        gap: .25rem;
    }
    .nav-links.open li > a,
    .nav-links.open .nav-dropdown-btn { color: rgba(255,255,255,.85); width: 100%; }
    .nav-dropdown-menu { position: static; box-shadow: none; background: rgba(255,255,255,.05);
                         border: none; border-radius: 0; padding: 0 0 0 1rem; }
    .nav-inner { flex-wrap: wrap; height: auto; padding: .75rem 1.25rem; }
    .nav-mobile-toggle { display: flex; margin-left: auto; }
    .bandi-grid { grid-template-columns: 1fr; }
    .stats-grid { gap: 1rem; }
    .stat-divider { display: none; }
    .form-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
    .hero { padding: 3rem 1.25rem 4rem; }
    .search-bar { flex-wrap: wrap; padding: 8px; }
    .btn-search { width: 100%; }
    .categorie-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-links { flex-direction: column; gap: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════
   DETAIL PAGE
   ═══════════════════════════════════════════════════════ */

/* Breadcrumb */
.breadcrumb-bar {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    padding: .6rem 0;
}
.breadcrumb {
    display: flex; align-items: center; gap: .4rem;
    font-size: .8rem; color: var(--gray-600);
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--cobalt); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span:not(:last-child) { color: var(--gray-400); }
.breadcrumb span:last-child {
    color: var(--gray-700); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 300px;
}

/* Layout container */
.detail-container { padding: 2.5rem 0 4rem; }
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5rem;
    align-items: start;
}

/* Main article */
.detail-main {}

/* Header */
.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
}
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.detail-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 900; color: var(--navy);
    line-height: 1.2; margin-bottom: .875rem;
}
.detail-ente {
    display: flex; align-items: center; gap: 8px;
    font-size: .95rem; color: var(--gray-700); font-weight: 500;
}
.detail-ente-icon { font-size: 1.1rem; }
.detail-ente-link {
    color: var(--cobalt); font-size: .85rem;
    text-decoration: none; opacity: .7;
    transition: opacity var(--t);
}
.detail-ente-link:hover { opacity: 1; }

/* Meta grid */
.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.meta-card {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r);
    padding: 1rem 1.1rem;
}
.meta-card-warning {
    background: #fff7ed;
    border-color: #fed7aa;
}
.meta-card-closed {
    background: var(--gray-100);
    border-color: var(--gray-300);
}
.meta-card-label {
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--gray-600); margin-bottom: .3rem;
}
.meta-card-value {
    font-size: .975rem; font-weight: 700; color: var(--navy);
    line-height: 1.3;
}
.meta-card-warning .meta-card-value { color: var(--orange); }
.meta-card-closed .meta-card-value  { color: var(--gray-400); }
.meta-card-sub {
    font-size: .78rem; font-weight: 500;
    color: var(--orange); display: block;
    margin-top: 2px;
}

/* Disclaimer */
.disclaimer-box {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: var(--r);
    padding: 1rem 1.25rem;
    font-size: .85rem; color: #78350f;
    line-height: 1.6; margin-bottom: 2rem;
    display: flex; gap: 10px; align-items: flex-start;
}
.disclaimer-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* Sections */
.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.detail-section:last-child { border-bottom: none; }
.detail-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; color: var(--navy);
    margin-bottom: .875rem;
}
.detail-text {
    font-size: .9375rem; line-height: 1.8;
    color: var(--gray-700);
}
.detail-text p { margin-bottom: .875rem; }

/* Sidebar */
.detail-sidebar { position: sticky; top: 80px; }

.detail-actions-card {
    background: white;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
}

.btn-fonte-ufficiale {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--cobalt); color: white;
    padding: 1rem; font-weight: 700; font-size: .95rem;
    text-decoration: none; width: 100%;
    transition: background var(--t);
    text-align: center;
}
.btn-fonte-ufficiale:hover { background: #1640a0; color: white; }

.btn-preferito {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; background: white;
    border: none; border-top: 1px solid var(--gray-200);
    padding: .875rem; font-family: inherit;
    font-size: .9rem; font-weight: 600;
    color: var(--gray-700); cursor: pointer;
    transition: all var(--t); text-decoration: none;
    text-align: center;
}
.btn-preferito:hover   { background: #fffbeb; color: var(--gold); }
.btn-preferito.is-preferito { color: var(--gold); background: #fffbeb; }

.detail-share {
    border-top: 1px solid var(--gray-200);
    padding: .875rem 1rem;
}
.share-label { font-size: .78rem; color: var(--gray-600); margin-bottom: .5rem; font-weight: 600; }
.share-buttons { display: flex; gap: 6px; }
.share-btn {
    flex: 1; padding: 7px 10px; border-radius: 7px;
    font-size: .8rem; font-weight: 600;
    text-align: center; cursor: pointer;
    border: 1.5px solid var(--gray-200);
    transition: all var(--t); background: white;
    color: var(--gray-700); text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
.share-wa   { background: #dcfce7; border-color: #86efac; color: #166534; }
.share-wa:hover { background: #16a34a; color: white; border-color: #16a34a; }
.share-copy:hover { border-color: var(--cobalt); color: var(--cobalt); }

/* Info card */
.detail-info-card {
    background: white;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.detail-info-card h3 {
    font-size: .8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--gray-600); margin-bottom: .875rem;
    padding-bottom: .5rem; border-bottom: 1px solid var(--gray-200);
}
.info-list {
    display: flex; flex-direction: column; gap: .625rem;
}
.info-list li {
    font-size: .85rem; color: var(--gray-700);
    display: flex; gap: 6px; align-items: flex-start;
}
.info-list li strong { color: var(--navy); flex-shrink: 0; min-width: 70px; }

/* Auth pages */
.auth-page {
    min-height: calc(100vh - 128px);
    display: flex; align-items: center; justify-content: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #f0f4ff 0%, var(--cream) 100%);
}
.auth-card {
    background: white;
    border-radius: 16px;
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%; max-width: 440px;
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem; color: var(--navy);
    margin-bottom: .25rem;
}
.auth-header p { color: var(--gray-600); font-size: .875rem; }

/* ── Responsive detail ─────────────────────────────── */
@media (max-width: 900px) {
    .detail-layout  { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .detail-meta-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .detail-meta-grid { grid-template-columns: 1fr 1fr; }
    .detail-title { font-size: 1.4rem; }
}


/* ── Step 1 SEO/public refinements ───────────────────────── */
.bandi-eyebrow { margin: 0 0 .35rem; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.bandi-intro-copy { max-width: 880px; margin: .5rem 0 1rem; color: rgba(255,255,255,.82); font-size: .98rem; line-height: 1.65; }
.seo-save-search-panel { display:flex; justify-content:space-between; gap:16px; align-items:center; flex-wrap:wrap; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); padding:14px 16px; border-radius:16px; margin:0 0 1rem; }
.save-search-title { color:white; font-weight:700; }
.save-search-copy { color:rgba(255,255,255,.7); font-size:.92rem; max-width:680px; }
.save-search-actions { margin:0; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.badge-multisource { background:#ede9fe; color:#5b21b6; }
.bando-card-source-block { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.bando-fonte-last { color: var(--gray-500); font-size: .73rem; }
.seo-copy-panel { margin-top: 2rem; background: white; border: 1px solid var(--gray-200); border-radius: var(--r); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); }
.seo-copy-panel h2 { margin: 0 0 .6rem; font-size: 1.15rem; color: var(--navy); }
.seo-copy-panel p { margin: 0 0 .65rem; color: var(--gray-700); line-height: 1.7; }
.seo-copy-panel p:last-child { margin-bottom: 0; }
.detail-alert-success { margin-bottom:20px; border-color:#86efac; background:#f0fdf4; color:#166534; }
.detail-summary { margin: 0 0 1rem; color: #4b5563; line-height: 1.7; }
.detail-badge.success { background:#dcfce7; color:#166534; }
.detail-badge.neutral { background:#f3f4f6; color:#4b5563; }
.detail-origin-grid { display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.detail-section-note { margin: -.2rem 0 1rem; color:#6b7280; line-height:1.6; }
.detail-mini-copy { margin-top:8px; font-size:.82rem; color:#6b7280; }
.detail-info-extended { margin-top:18px; padding:18px; }
@media (max-width: 760px) {
  .save-search-actions, .seo-save-search-panel { width: 100%; }
  .bando-card-source-block { align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════
   COME FUNZIONA — How steps (Homepage)
   ═══════════════════════════════════════════════════════ */
.how-steps {
    display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap;
}
.how-step {
    flex: 1; min-width: 200px; text-align: center; padding: 2rem 1.5rem;
    background: white; border: 1.5px solid var(--gray-200); border-radius: var(--r);
    position: relative;
}
.how-step-arrow {
    display: flex; align-items: center; padding: 0 .75rem; font-size: 1.5rem;
    color: var(--gray-400); flex-shrink: 0; padding-top: 3.5rem;
}
.how-step-num {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--cobalt); color: white; width: 28px; height: 28px;
    border-radius: 50%; font-size: .8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.how-step-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.how-step-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 0 0 .5rem; }
.how-step-text { font-size: .875rem; color: var(--gray-600); line-height: 1.6; margin: 0; }

@media (max-width: 700px) {
    .how-steps { flex-direction: column; gap: 1rem; }
    .how-step-arrow { display: none; }
    .how-step { min-width: unset; }
}

/* ═══════════════════════════════════════════════════════
   RICERCHE SALVATE — container-sm helper
   ═══════════════════════════════════════════════════════ */
.container-sm { max-width: 860px; margin: 0 auto; padding: 0 1.25rem; }

/* ═══════════════════════════════════════════════════════
   COOKIE BANNER
   ═══════════════════════════════════════════════════════ */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9999;
    background: #0F1F3D; color: white; border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: cookieSlideUp .3s ease-out;
}
@keyframes cookieSlideUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
.cookie-banner-inner {
    max-width: 1100px; margin: 0 auto; padding: 16px 20px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cookie-banner-text {
    flex: 1; min-width: 280px; font-size: .875rem; line-height: 1.5; color: rgba(255,255,255,.9);
}
.cookie-banner-text strong { color: white; }
.cookie-banner-text a { color: #93C5FD; text-decoration: underline; }
.cookie-banner-text a:hover { color: white; }
.cookie-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-btn {
    padding: 9px 20px; border-radius: 8px; border: 0; cursor: pointer;
    font-size: .875rem; font-weight: 600; font-family: inherit;
    transition: background .15s, transform .1s;
}
.cookie-btn:hover { transform: translateY(-1px); }
.cookie-btn-primary { background: #1E4DB7; color: white; }
.cookie-btn-primary:hover { background: #2563EB; }
@media (max-width: 600px) {
    .cookie-banner { left: 8px; right: 8px; bottom: 8px; }
    .cookie-banner-inner { padding: 14px; }
    .cookie-btn { width: 100%; }
    .cookie-banner-actions { width: 100%; }
}
