/* ══════════════════════════════════════════════
   GINOS – Design System
   Tone: Clinical precision + digital warmth
   ══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-dark:  #1a3a52;
  --blue-mid:   #2c5f8d;
  --blue-light: #4a90d9;
  --blue-pale:  #eef4fb;
  --accent:     #e8554e;
  --text-dark:  #1f2a44;
  --text-mid:   #4a5568;
  --text-muted: #94a3b8;
  --bg-page:    #f0f4f8;
  --bg-white:   #ffffff;
  --border:     #e2e8f0;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.13);
  --nav-h:      60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── TOP NAVIGATION BAR (tutte le pagine) ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  box-shadow: 0 2px 12px rgba(26,58,82,.25);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}
.site-nav-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-nav-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.site-nav-logo img {
  height: 50px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
}
.site-nav-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.site-nav-links a {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,.80);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.site-nav-links a:hover  { background: rgba(255,255,255,.12); color: #fff; }
.site-nav-links a.active { background: rgba(255,255,255,.18); color: #fff; }
.site-nav-links a.nav-cta {
  background: var(--accent);
  color: #fff;
  margin-left: 8px;
}
.site-nav-links a.nav-cta:hover { background: #d44b44; }

/* ── PAGE WRAPPER ── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* ── INDEX: Hero ── */
.ginos-hero {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px 28px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.ginos-logo {
  display: block;
  margin: 0 auto 12px;
  height: 100px;
  width: auto;
  max-width: 520px;
}
.ginos-tagline {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 auto 16px;
  max-width: 560px;
  line-height: 1.5;
}

/* Hero nav cards */
.hero-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}
.hero-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 12px;
  background: var(--blue-pale);
  border: 1.5px solid #c5d8ef;
  border-top: 3px solid var(--blue-mid);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.hero-nav-card:hover {
  background: #ddeaf8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.hnc-icon  { font-size: 1.4rem; line-height: 1; }
.hnc-title { font-size: 0.85rem; font-weight: 700; color: var(--blue-mid); }
.hnc-sub   { font-size: 0.71rem; color: var(--text-muted); text-align: center; line-height: 1.3; }

/* ── CONTENT CARD (shared) ── */
.content-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ── Disclaimer ── */
.disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 16px;
  text-align: center;
}

/* ── App buttons ── */
.app-btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 15px 16px;
  font-size: 1.05em;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  background: var(--sector-color, var(--blue-mid));
  color: #fff;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: transform .1s, filter .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.app-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.20);
}
.app-btn:active { transform: scale(.99); }
.app-btn.disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }
.app-btn .app-title  { display: block; font-weight: 700; font-size: 1em; letter-spacing: .2px; line-height: 1.3; }
.app-btn .app-sector {
  display: inline-block;
  margin-top: 7px;
  font-size: .8em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.14);
}
.app-btn .viki-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7em;
  font-weight: 700;
  margin-top: 8px;
  opacity: .9;
}
.viki-dot           { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255,255,255,.35); }
.viki-dot.bozza     { background: #ff5252; }
.viki-dot.revisione { background: #ffb300; }
.viki-dot.validata  { background: #69f0ae; }

/* ── Desktop grid ── */
@media (min-width: 768px) {
  .menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
  }
  .app-btn { margin: 0; min-height: 82px; }
  .app-feedback-btn {
    display: inline-block !important;
    position: absolute;
    top: 10px; right: 10px;
  }
}
@media (min-width: 1024px) {
  .menu { grid-template-columns: repeat(3, 1fr); }
}

/* ── Filter chips ── */
.filter-section { margin-bottom: 16px; }
.filter-label   { font-size: 0.82rem; font-weight: 600; color: var(--text-mid); margin-bottom: 8px; text-align: left; }
.filter-chips   { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 6px; }
.filter-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--chip-color, var(--blue-mid));
  background: #fff;
  color: var(--chip-color, var(--blue-mid));
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  font-family: inherit;
}
.filter-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.filter-chip.active {
  background: var(--chip-color, var(--blue-mid));
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.15);
}

/* ── News banner ── */
.news-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-light));
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: opacity .15s;
  width: 100%;
}
.news-banner:hover { opacity: .92; }
.news-badge { flex-shrink:0; background: var(--accent); color:#fff; font-size:.75rem; font-weight:700; padding:3px 8px; border-radius:8px; }
.news-badge.aggiornata { background: #fb8c00; }
.news-banner-body { flex:1; min-width:0; }
.news-banner-title { font-size:.97rem; font-weight:700; color:#fff; margin:0 0 2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.news-banner-desc  { font-size:.82rem; color:rgba(255,255,255,.82); margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.news-banner-arrow { flex-shrink:0; font-size:1.4rem; color:rgba(255,255,255,.75); }
.news-dots         { display:flex; justify-content:center; gap:6px; margin:0 auto 16px; }
.news-dot          { width:7px; height:7px; border-radius:50%; background:#b0c4d8; border:none; padding:0; cursor:pointer; transition:background .2s, transform .2s; }
.news-dot.active   { background: var(--blue-mid); transform:scale(1.3); }

/* ── VIKI banner + footer link ── */
.viki-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #eef4fb, #f5f7fa);
  border: 1px solid #c5d8ef;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.viki-intro-text { flex:1; min-width:180px; }
.viki-intro-text strong { font-size:.8rem; color: var(--blue-mid); text-transform:uppercase; letter-spacing:.06em; }
.viki-intro-text span   { font-size:.82rem; color: var(--text-mid); display:block; margin-top:2px; }
.viki-footer-link {
  display: block;
  text-align: center;
  margin: 24px auto 0;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-light));
  color: #fff;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .2s;
  box-shadow: var(--shadow-sm);
}
.viki-footer-link:hover { opacity: .88; }

/* ── VIKI CSS (card badges) ── */
.app-feedback-btn {
  display: none;
  font-size:.7em; font-weight:700; padding:3px 8px; border-radius:6px;
  background:rgba(255,255,255,.2); border:1px solid rgba(255,255,255,.4);
  color:#fff; cursor:pointer; text-decoration:none; transition:background .15s;
  white-space:nowrap;
}
.app-feedback-btn:hover { background:rgba(255,255,255,.35); }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
.site-footer a { color: var(--blue-light); text-decoration: none; }

/* ── Admin link ── */
.admin-link { margin:10px auto 0; text-align:center; font-size:.9em; }
.admin-link a { color:#0a58ca; text-decoration:none; }
.admin-link a:hover { text-decoration:underline; }
.menu button.disabled { opacity:.55; cursor:not-allowed; }

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: all .25s;
}

/* Mobile dropdown menu */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1a3a52, #2c5f8d);
  z-index: 99;
  padding: 8px 16px 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.nav-mobile-menu.open { display: block; }
.nav-mobile-menu a {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: background .15s;
}
.nav-mobile-menu a:last-child { border-bottom: none; }
.nav-mobile-menu a:hover { background: rgba(255,255,255,.12); }
.nav-mobile-menu a.nav-cta-m {
  background: var(--accent);
  color: #fff;
  margin-top: 8px;
  border-bottom: none;
}

/* ── PWA fixed bottom banner (mobile) ── */
#pwa-banner-mobile {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: linear-gradient(90deg, #1a3a52, #2c5f8d);
  padding: 12px 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
  align-items: center;
  gap: 12px;
}
#pwa-banner-mobile.visible { display: flex; }
.pwa-m-icon { font-size: 1.6rem; flex-shrink: 0; }
.pwa-m-text { flex: 1; min-width: 0; }
.pwa-m-text strong { display: block; font-size: .85rem; color: #fff; font-weight: 700; line-height: 1.2; }
.pwa-m-text span   { font-size: .72rem; color: rgba(255,255,255,.72); }
.pwa-m-btn {
  background: #fff; color: #2c5f8d; border: none;
  border-radius: 8px; padding: 8px 14px;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  flex-shrink: 0; white-space: nowrap;
}
.pwa-m-close {
  background: none; border: none;
  color: rgba(255,255,255,.55); font-size: 1.2rem;
  cursor: pointer; flex-shrink: 0; padding: 4px;
}
/* Bottom padding so footer content not hidden behind fixed banner */
body.pwa-banner-shown { padding-bottom: 72px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav-hamburger { display: flex; }
  .site-nav-links { display: none; }   /* hide desktop links */
  .site-nav-divider { display: none; }
  .site-nav-logo img { height: 40px; }
  .site-nav-inner { padding: 0 14px; }
  .hero-nav { grid-template-columns: repeat(3,1fr); gap:8px; }
  .hnc-sub  { display: none; }
  .ginos-logo { height: 68px; }
  .ginos-hero { padding: 18px 14px 16px; }
  .ginos-tagline { font-size: .78rem; }
  .page-wrap { padding: 14px 10px 40px; }
  /* Hide desktop PWA banner on mobile */
  #pwa-banner { display: none !important; }
}
@media (min-width: 641px) {
  /* Hide mobile-only elements on desktop */
  #pwa-banner-mobile { display: none !important; }
  .nav-hamburger { display: none !important; }
  .nav-mobile-menu { display: none !important; }
}
