/* style.css :: v1.9.0 :: 2026-09-11 :: 2 modifiche */

:root {
  --black: #0a0a0a;
  --black-2: #131313;
  --red: #c8102e;
  --red-dark: #8b0a20;
  --gold: #d4a017;
  --gold-dim: #8b6a0f;
  --green: #6b8f2e;
  --gray: #2a2a2a;
  --gray-light: #444;
  --text: #d4a017;
  --text-dim: #8a7a4a;
}

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

html, body {
  background: var(--black);
  color: var(--text);
  font-family: 'Courier New', 'JetBrains Mono', monospace;
  font-size: 14px;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg,
    rgba(0,0,0,0.15), rgba(0,0,0,0.15) 1px,
    transparent 1px, transparent 3px);
  pointer-events: none; z-index: 9999;
}

/* HEADER */
.header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 25px;
  background: linear-gradient(180deg, var(--black-2) 0%, var(--black) 100%);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 0 30px rgba(200, 16, 46, 0.4);
}
.header-left { display: flex; align-items: center; gap: 15px; }
.star {
  color: var(--red); font-size: 32px;
  text-shadow: 0 0 15px var(--red), 0 0 30px var(--red);
  animation: pulse 3s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.6;} }
.header h1 {
  font-size: 22px; font-weight: 900; letter-spacing: 5px;
  color: var(--gold); text-shadow: 0 0 10px var(--gold);
}
.subtitle { display: block; font-size: 10px; color: var(--text-dim); letter-spacing: 3px; margin-top: 3px; }
.header-right { display: flex; align-items: center; gap: 25px; }
.stamp {
  color: var(--red); border: 3px solid var(--red); padding: 8px 20px;
  font-size: 16px; font-weight: 900; letter-spacing: 4px;
  transform: rotate(-8deg);
  box-shadow: 0 0 15px rgba(200, 16, 46, 0.6);
  animation: glow 2s infinite;
}
@keyframes glow {
  0%,100%{box-shadow: 0 0 15px rgba(200,16,46,0.6);}
  50%{box-shadow: 0 0 25px rgba(200,16,46,0.9);}
}
.clock { text-align: center; }
.clock-label { font-size: 10px; color: var(--text-dim); letter-spacing: 2px; }
.clock-time { font-size: 18px; color: var(--gold); font-weight: bold; text-shadow: 0 0 10px var(--gold); }

/* MAIN */
.main { padding: 25px; max-width: 1600px; margin: 0 auto; }

/* STATUS BAR */
.status-bar {
  display: flex; justify-content: space-around; align-items: center;
  background: var(--black-2);
  border: 1px solid var(--gold-dim);
  padding: 15px; margin-bottom: 25px; flex-wrap: wrap; gap: 15px;
}
.status-item { display: flex; gap: 10px; align-items: center; }
.status-label { font-size: 11px; color: var(--text-dim); letter-spacing: 2px; }
.status-value { color: var(--gold); font-weight: bold; }
.status-value.ok { color: var(--green); }

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--black-2);
  border: 2px solid var(--gold-dim);
  padding: 20px;
  text-decoration: none; color: var(--text);
  transition: all 0.25s;
  position: relative;
  cursor: pointer;
  min-height: 200px;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.card:hover {
  border-color: var(--red);
  background: linear-gradient(180deg, var(--black-2) 0%, rgba(200,16,46,0.15) 100%);
  box-shadow: 0 0 30px rgba(200, 16, 46, 0.5);
  transform: translateY(-3px);
}
.card-primary { border-color: var(--red); }
.card-disabled { opacity: 0.35; cursor: not-allowed; }
.card-disabled:hover { transform: none; border-color: var(--gold-dim); background: var(--black-2); box-shadow: none; }

.card-icon { font-size: 32px; text-align: center; margin-bottom: 8px; }
.card-title {
  font-size: 12px; font-weight: bold; text-align: center;
  letter-spacing: 2px; color: var(--gold); margin-bottom: 4px;
}
.card-desc { font-size: 10px; text-align: center; color: var(--text-dim); flex: 1; letter-spacing: 1px; line-height: 1.4; }

.card-status { text-align: center; margin: 4px 0; }
.dot { font-size: 20px; color: var(--gray); transition: color 0.3s; }
.dot.online { color: var(--green); text-shadow: 0 0 10px var(--green); }
.dot.offline { color: var(--red); text-shadow: 0 0 10px var(--red); }

.card-btn {
  text-align: center; padding: 5px 8px;
  background: var(--red-dark);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 10px; font-weight: bold; letter-spacing: 2px;
  transition: all 0.2s;
}
.card:hover .card-btn {
  background: var(--red); color: white; border-color: var(--red);
}
.card-btn.disabled {
  background: var(--gray); color: var(--gray-light); cursor: not-allowed;
}

/* AZIONI RAPIDE */
.actions {
  background: var(--black-2);
  border: 1px solid var(--gold-dim);
  padding: 20px;
}
.actions-title {
  font-size: 12px; font-weight: bold; letter-spacing: 3px;
  color: var(--red); margin-bottom: 15px; text-align: center;
}
.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.action-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--black);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 14px;
  font-family: inherit; font-size: 12px; font-weight: bold;
  letter-spacing: 2px; cursor: pointer;
  transition: all 0.2s;
}
.action-btn:hover {
  background: var(--red); color: white; border-color: var(--red);
  box-shadow: 0 0 20px rgba(200, 16, 46, 0.5);
}
.action-btn span { font-size: 18px; }

/* FOOTER */
.footer {
  display: flex; justify-content: space-between; padding: 15px 25px;
  background: var(--black-2);
  border-top: 2px solid var(--red);
  font-size: 11px; color: var(--text-dim); letter-spacing: 2px;
  margin-top: 30px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .header { flex-direction: column; gap: 15px; }
  .header h1 { font-size: 16px; letter-spacing: 3px; }
  .header-right { flex-wrap: wrap; justify-content: center; }
  .stamp { font-size: 12px; padding: 5px 12px; }
  .clock-time { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .actions-grid { grid-template-columns: 1fr; }
  .main { padding: 15px; }
  .status-bar { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   SEZIONE CERTIFICATO (v1.9.0)
   ============================================================ */
.cert-section {
  background: var(--black-2);
  border: 1px solid var(--gold-dim);
  margin-top: 30px;
  position: relative;
}

.cert-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(180deg, var(--gray) 0%, var(--black-2) 100%);
  border-bottom: 1px solid var(--gold-dim);
}

.cert-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px var(--gold));
}

.cert-title {
  color: var(--gold);
  font-weight: bold;
  letter-spacing: 3px;
  font-size: 13px;
}

.cert-desc {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  margin-top: 3px;
}

.cert-status {
  font-size: 11px;
  color: var(--green);
  letter-spacing: 2px;
  font-weight: bold;
}

.cert-status.missing {
  color: var(--red);
  animation: pulse 2s infinite;
}

.cert-body {
  padding: 20px;
}

.cert-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.cert-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--black);
  border: 2px solid var(--gold-dim);
  color: var(--gold);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.cert-btn:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(200, 16, 46, 0.5);
}

.cert-btn-primary {
  background: var(--red-dark);
  border-color: var(--red);
}

.cert-btn-primary:hover {
  background: var(--red);
}

.cert-info {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
  padding: 12px;
  background: var(--black);
  border-left: 3px solid var(--gold);
}

.cert-info strong {
  color: var(--gold);
}

/* ============================================================
   MODAL ISTRUZIONI (v1.9.0)
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.visible {
  display: flex;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--black-2);
  border: 3px solid var(--red);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(200, 16, 46, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(180deg, var(--red-dark) 0%, var(--black-2) 100%);
  border-bottom: 2px solid var(--red);
}

.modal-title {
  color: var(--gold);
  font-weight: bold;
  letter-spacing: 3px;
  font-size: 13px;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
}

.modal-close:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-intro {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-intro code {
  background: var(--black);
  color: var(--gold);
  padding: 2px 6px;
  border: 1px solid var(--gold-dim);
  font-family: inherit;
}

.modal-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--red);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.modal-tab {
  flex: 1;
  min-width: 100px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 1px solid var(--gray);
}

.modal-tab:last-child { border-right: none; }

.modal-tab:hover {
  color: var(--gold);
  background: var(--gray);
}

.modal-tab.active {
  color: var(--gold);
  background: var(--black);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.modal-panel {
  display: none;
  color: var(--text);
  font-size: 12px;
  line-height: 1.8;
}

.modal-panel.active {
  display: block;
}

.modal-panel ol {
  padding-left: 25px;
  color: var(--gold);
}

.modal-panel ol li {
  margin-bottom: 8px;
  color: #d4a017;
}

.modal-panel ol li strong {
  color: var(--red);
  font-weight: bold;
}

.modal-panel ol li code {
  background: var(--black);
  color: var(--gold);
  padding: 2px 6px;
  border: 1px solid var(--gold-dim);
  font-family: inherit;
  font-size: 11px;
}

.modal-note {
  margin-top: 15px;
  padding: 10px;
  background: var(--black);
  border-left: 3px solid var(--gold);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.6;
}

.modal-note code {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  word-break: break-all;
  white-space: pre-wrap;
}

@media (max-width: 700px) {
  .cert-header {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cert-icon { font-size: 40px; }
  .cert-actions { flex-direction: column; }
  .cert-btn { justify-content: center; }
  .modal-tab { font-size: 10px; padding: 8px 4px; }
}




/* Version badge nell'header (v1.9.0) */
.version-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--red-dark);
  color: var(--gold);
  border: 2px solid var(--red);
  padding: 5px 14px;
  cursor: help;
  align-self: center;
  box-shadow: 0 0 10px rgba(200, 16, 46, 0.5);
  animation: pulse 3s infinite;
  line-height: 1.2;
}

.version-num {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
}

.version-date {
  font-size: 9px;
  color: #8a7a4a;
  letter-spacing: 1px;
  margin-top: 2px;
  font-weight: normal;
}

.version-badge:hover {
  background: var(--red);
  color: white;
  box-shadow: 0 0 20px rgba(200, 16, 46, 0.8);
}

/* Modal Samba (v1.6.4) */
.samba-block {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px 12px;
  align-items: center;
  background: var(--black);
  border: 1px solid var(--gold-dim);
  padding: 15px;
  margin-bottom: 15px;
}

.samba-label {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
}

.samba-path {
  background: var(--black-2);
  border: 1px solid var(--gold-dim);
  padding: 10px 14px;
  color: var(--gold);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  word-break: break-all;
  user-select: all;
}

/* ============================================================
   SFONDO DINAMICO KGB (v1.9.3)
   ============================================================ */
html {
    height: 100%;
}

body {
    background-color: #0a0a0a !important;
    background-image: url('/bg.jpg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(10,10,10,0.30);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* Desktop grande (>1400px) */
@media (min-width: 1400px) {
    body {
        background-size: cover;
        background-position: center center;
    }
}

/* Desktop medio (1024-1399px) */
@media (min-width: 1024px) and (max-width: 1399px) {
    body {
        background-size: cover;
        background-position: center center;
    }
}

/* Tablet (768-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    body {
        background-size: cover;
        background-position: center center;
    }
    body::before {
        background: rgba(10,10,10,0.40);
    }
}

/* Smartphone portrait (<768px) */
@media (max-width: 767px) {
    body {
        background-size: auto 100vh;
        background-size: auto 100dvh;
        background-position: center center;
        background-attachment: fixed;
    }
    body::before {
        background: rgba(10,10,10,0.50);
    }
}

/* Smartphone landscape */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        background-size: auto 100vh;
        background-size: auto 100dvh;
    }
}

/* Ultra-Wide (>1920px) */
@media (min-width: 1921px) {
    body {
        background-size: cover;
        background-position: center center;
    }
}

/* 4K+ */
@media (min-width: 2560px) {
    body {
        background-size: 100% auto;
        background-position: center top;
    }
}

/* Fallback browser senza dvh */
@supports not (height: 100dvh) {
    body {
        min-height: 100vh;
    }
    body::before {
        height: 100vh;
    }
}
