/* ------------------------------------------------------
   TEMA LIGHT & DARK (CSS VARIABLES)
------------------------------------------------------ */

:root {
    --bg: #ffffff;
    --text: #000000;
    --panel: rgba(241, 241, 241, 0.85); /* 85% opaco, 15% trasparente */
    --panel-border: #333333;
    --accent: #005bbb;
    --header-bg: #e6e6e6;
    --footer-bg: #e6e6e6;
    /* Tabelle */
    --table-row-even: rgba(0, 91, 187, 0.06);
    --table-row-hover: rgba(0, 91, 187, 0.15);
}

[data-theme="dark"] {
    --bg: #000000;
    --text: #ffffff;
    --panel: rgba(26, 26, 26, 0.85); /* stesso livello di trasparenza */
    --panel-border: white;
    --accent: #0077ff;
    --header-bg: #222;
    --footer-bg: #222;
    /* Tabelle */
    --table-row-even: rgba(0, 119, 255, 0.12);
    --table-row-hover: rgba(0, 119, 255, 0.22);
}

/* ------------------------------------------------------
   RESET E BASE
------------------------------------------------------ */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    perspective: 1000px;
}

/* ------------------------------------------------------
   HEADER
------------------------------------------------------ */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--header-bg);
    color: var(--text);
    padding: 10px 20px;
    height: 160px;
    z-index: 1000;
    border: 1px solid var(--text);
}

    header img {
        height: 100px;
    }

    header h1 {
        flex: 1;
        text-align: center;
        margin: 0;
        padding: 0;
        font-size: 20px;
    }

/* ------------------------------------------------------
   MAIN / SECTION
------------------------------------------------------ */

main {
    margin: 5px auto 10px auto;
    padding: 20px;
    max-width: 900px;
}

section {
    background: var(--panel);
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    opacity: 0;
    animation: fadeInUp 1.6s ease forwards;
}

    section .content {
        width: 90%;
        transform: translateY(0);
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), box-shadow 0.4s ease;
        transform-style: preserve-3d;
    }

    section:hover .content {
        transform: translateY(-10px) translateX(25px) scale(1.05) rotateX(5deg);
    }

    section:hover h2 {
        color: var(--accent);
        transform: translateX(6px);
    }

/* ------------------------------------------------------
   TITOLI E CONTENUTI
------------------------------------------------------ */

h2, h1, h3 {
    color: var(--text);
    transition: color 0.25s ease, transform 0.25s ease;
}

a {
    color: #008cff;
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: #0077ff;
}

.econtent {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    text-align: justify;
    padding: 20px 60px 20px 20px;
    margin: 0 auto;
    max-width: 1000px;
    box-sizing: border-box;
}

    .econtent a {
        color: var(--accent);
        text-decoration: none;
    }

/* Immagini floatate */
.float-img-l,
.float-img-r,
.float-img-mini {
    border-radius: 10px;
    border-width: 1px;
    border-style: inset;
    border-color: var(--accent);
}

.float-img-l {
    float: left;
    width: 200px;
    margin: 0 20px 20px 0;
}

.float-img-r {
    float: right;
    width: 200px;
    margin: 0 0 20px 20px;
}

.float-img-mini {
    float: left;
    width: 125px;
    margin: 0 20px 20px 0;
}

.econtent::after {
    content: "";
    display: block;
    clear: both;
}

/* ------------------------------------------------------
   FOOTER
------------------------------------------------------ */

.footer {
    background-color: var(--footer-bg);
    color: var(--text);
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    border-top: 2px solid var(--accent);
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

    .footer-col h3 {
        margin-bottom: 10px;
        color: var(--accent);
    }

/* ------------------------------------------------------
   LOGIN
------------------------------------------------------ */

.login form {
    align-items: center;
    gap: 5px;
}

.login input {
    padding: 5px 8px;
    margin: 5px;
    border-radius: 4px;
    border: 1px solid var(--panel-border);
    font-size: 14px;
    width: 200px;
    background: var(--panel);
    color: var(--text);
}

.login button {
    padding: 5px 10px;
    margin: 5px;
    border-radius: 4px;
    border: 1px solid var(--panel-border);
    background-color: var(--accent);
    color: var(--bg);
    cursor: pointer;
    transition: background 0.25s ease;
    width: 200px;
}

    .login button:hover {
        background-color: var(--panel-border);
    }

/* ------------------------------------------------------
   STRISCE SFONDO
------------------------------------------------------ */

.bgStripe {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(var(--bg), var(--text), var(--bg));
    z-index: -1;
    transition: transform 0s linear;
}

.bgStripeV {
    position: fixed;
    left: 0;
    top: 0;
    width: 400px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0), var(--text), rgba(0,0,0,0));
    z-index: -1;
    transition: transform 0s linear;
}

.contact-form {
  display: grid;
  grid-template-columns: 150px 1fr; /* LABEL | INPUT */
  gap: 12px 20px;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-form label {
  text-align: right;
  font-weight: bold;
  color: var(--text);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 12px 20px;
  margin-left: 10px;
  margin-right: 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-sizing: border-box; /* <<< IMPORTANTE */
  display: block;         /* <<< forza l’allineamento identico */  font-family: Arial, sans-serif;
  font-size: 14px;}



.contact-form button {
  grid-column: 2; /* <<< ECCO LA MAGIA: va nella colonna degli INPUT */
  justify-self: start; /* allinea il bottone a sinistra della sua colonna */
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 10px;
}

.contact-form button:hover {
  opacity: 0.9;
}

.form-spacer {
  grid-column: 1 / span 2;   /* prende entrambe le colonne */
  height: 15px;              /* spazio desiderato */
  display: block;
}

/* Mobile: tutto in colonna */
@media (max-width: 600px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
  .contact-form label {
    text-align: left;
  }
  .contact-form button {
    grid-column: 1;
    justify-self: stretch; /* in mobile a tutta larghezza */
  }
}

html, body, section, header, .econtent, .footer, .bgStripe, .bgStripeV {
  transition: 
    background-color 1.4s ease,
    color 1.4s ease,
    border-color 1.4s ease,
    box-shadow 1.4s ease;
}

/* --- Toggle switch --- */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle {
    position: relative;
    width: 50px;
    height: 22px;
    margin-left: 8px;
}

    .toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 30px;
    transition: 0.3s;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 15px;
        width: 15px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        border-radius: 50%;
        transition: 0.3s;
    }

input:checked + .slider {
    background-color: #1a1a1a;
}

    input:checked + .slider:before {
        transform: translateX(26px);
    }

.logo-dark {
    display: block;
}

.logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: block;
}
/* ------------------------------------------------------
   ANIMAZIONI
------------------------------------------------------ */

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Generic table style used across the site */
.table-standard {
    width: 100%;
    border-collapse: collapse;
}
.table-standard tr {
    border-bottom: 1px solid #008cff;
}
.table-standard td {
    padding: 2px 2px;
    line-height: 1.2;
    vertical-align: top;
}
.table-standard td[style*="width:100%"] {
    width: 100%;
}
.table-standard tr:nth-child(even) {
    background-color: var(--table-row-even);
}

.table-standard tr:nth-child(odd) {
    background-color: transparent;
}

.table-standard tbody tr:hover {
    background-color: var(--table-row-hover);
    transition: background-color 0.15s ease-in-out;
}

#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; /* sotto tutti gli altri contenuti */
  pointer-events: none; /* opzionale: non interferisce con click su pulsanti */
}

.checklist-box {
  grid-column: 2;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px;
  margin-left: 10px;
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}

.checklist-box input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

body {
   margin: 0;
  padding: 0;
  overflow-x: hidden !important; /* blocca solo scroll orizzontale se vuoi */
  overflow-y: auto !important;   /* permette scroll verticale */
}

/* File list (documents/images) */
.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.file-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #008cff;
}
.file-thumb {
    max-height: 48px;
    max-width: 140px;
    object-fit: cover;
    border-radius: 6px;
}

/* ===========================
   MOBILE FRIENDLY OVERRIDES
   =========================== */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 5px;
        gap: 10px;
        text-align: center;
    }

    header img {
        margin-bottom: 10px;
    }

    header h1 {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
  section {
    padding: 12px;
    border-radius: 12px;
  }
}

@media (hover: none) {
  section:hover .content {
    transform: none;
  }
}

@media (max-width: 768px) {
  .table-standard,
  .table-standard thead,
  .table-standard tbody,
  .table-standard tr,
  .table-standard td,
  .table-standard th {
    display: block;
  }

  .table-standard thead {
    display: none;
  }

  .table-standard tr {
    margin-bottom: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 8px;
  }
}

@media (max-width: 600px) {
  .contact-form input,
  .contact-form textarea,
  .contact-form select {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  section .content {
    width: 100%;
  }
}

@media (hover: none) {
  section .content {
    transition: none;
  }
}

@media (max-width: 768px) {

  body {
    font-size: 14px;      /* prima era ~16 */
    line-height: 1.4;    /* prima ~1.6 */
  }

  p, li {
    line-height: 1.4;
    margin-bottom: 0.6em;
  }
}

@media (max-width: 768px) {

  .econtent {
    font-size: 14px;
    line-height: 1.45;
    padding: 12px 14px;   /* molto importante */
  }
}

@media (max-width: 768px) {

  h1 {
    font-size: 20px;
    margin-bottom: 8px;
  }

  h2 {
    font-size: 18px;
    margin-bottom: 6px;
  }

  h3 {
    font-size: 16px;
    margin-bottom: 4px;
  }
}

@media (max-width: 768px) {

  .table-standard td {
    font-size: 13px;
    line-height: 1;
    padding: 4px 4px;
  }
  .table-standard tr {
    padding: 2px 2px;
  }

  .table-standard td {
    padding: 2px 0;
    line-height: 1;
  }

  .table-standard td + td {
    margin-top: 1px; /* micro-spazio tra “righe” */
  }
}





