/* =========================================================
   RESET + BASE
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", "Roboto", sans-serif;
}

body {
  background-color: #f6f8fb;
  color: #1f2937;

  /* Scala generale (più grande) */
  font-size: 20px;
  line-height: 1.75;

  /* layout */
  padding: 2.25rem;
  max-width: 1180px;
  margin: 0 auto;
}

/* =========================================================
   TESTO / TITOLI
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  color: #111827;
  margin-bottom: 0.85rem;
  font-weight: 600;
}

h2 { font-size: 1.65rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.18rem; }

p {
  margin-bottom: 1.05rem;
  color: #374151;
}

/* stacco tra sezioni consecutive (titoli) */
h2 + h3,
h3 + h4 {
  margin-top: 1.15rem;
}

/* =========================================================
   LINK
   - Default: link normali
   - Menu/azioni: stile bottone
   - Tabelle: chip compatti
   ========================================================= */
a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}
a:hover { text-decoration: underline; }

/* Link come bottoni (menu e azioni principali) */
ul li a,
p > a {
  display: inline-block;
  background-color: #2563eb;
  color: #ffffff !important;
  text-decoration: none;

  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);

  margin-top: 0.9rem;
  margin-bottom: 0.9rem;

  font-size: 1.06rem;
  padding: 0.85rem 1.45rem;
}

ul li a:hover,
p > a:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
  text-decoration: none;
}

ul li a:active,
p > a:active { transform: translateY(0); }

ul li a:visited,
p > a:visited { color: #ffffff !important; }

/* distacco tra form e link successivo */
form + p { margin-top: 1.35rem; }

/* =========================================================
   MENU (UL)
   ========================================================= */
ul {
  list-style: none;
  padding-left: 0;
}

ul li { margin-bottom: 0.25rem; }

ul li a {
  min-width: 240px;
  text-align: center;
}

/* =========================================================
   FORM (CARD)
   ========================================================= */
form {
  background: white;
  padding: 1.75rem;
  border-radius: 1.1rem;
  box-shadow: 0 5px 12px rgba(0,0,0,0.06);

  max-width: 980px;
}

/* riduce l'effetto dei <br> nativi */
form br { display: none; }

/* spazio sotto ogni campo */
form input,
form select,
form textarea { margin-bottom: 1.15rem; }

/* =========================================================
   BOTTONI SUBMIT
   ========================================================= */
input[type="submit"],
button[type="submit"] {
  display: inline-block;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;

  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;

  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
  margin-top: 0.95rem;

  font-size: 1.06rem;
  padding: 0.9rem 1.55rem;
  font-weight: 700;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
  background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.32);
}

input[type="submit"]:active,
button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.22);
}

input[type="submit"]:disabled,
button[type="submit"]:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

/* =========================================================
   INPUT / SELECT / TEXTAREA
   ========================================================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  background-color: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;

  font-size: 1.05rem;
  padding: 0.85rem 1.05rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.20);
}

/* =========================================================
   FUNZIONI / FORMAZIONI
   sub-card + 2 colonne di checkbox
   ========================================================= */
.two-col{
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 0.85rem;
}

.subcard{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1.05rem;
  padding: 1.05rem 1.15rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.subcard h4{
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.checklist{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1.15rem;
}

.checklist label{
  display: flex;
  align-items: center;
  gap: 0.7rem;

  border-radius: 0.7rem;
  margin: 0;

  color: #374151;
  font-weight: 600;

  font-size: 1.02rem;
  padding: 0.45rem 0.55rem;
}

.checklist label:hover{
  background: #f3f4f6;
}

.checklist input[type="checkbox"]{
  width: auto;
  margin: 0;
  transform: translateY(1px);
}

/* Responsive */
@media (max-width: 900px){
  .two-col{ flex-direction: column; }
  .checklist{ grid-template-columns: 1fr; }
}

/* =========================================================
   TABELLE
   ========================================================= */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  margin-top: 1.6rem;
}

th, td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;

  font-size: 1.02rem;
  padding: 1.15rem 1.15rem;
}

th {
  background-color: #f3f4f6;
  font-weight: 700;
  color: #374151;
}

tr:hover { background-color: #f9fafb; }

/* Link dentro tabella: chip compatti */
table a{
  display: inline-block;
  background: #eef2ff;
  color: #1d4ed8 !important;

  padding: 0.3rem 0.65rem;
  border-radius: 0.65rem;
  font-weight: 800;

  box-shadow: none;
  margin: 0;
  text-decoration: none;
}
table a:hover{
  background: #dbeafe;
  transform: none;
  text-decoration: none;
}

/* =========================================================
   CAMPO DATA (tuo stile, dimensioni aumentate)
   ========================================================= */
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;

  color: #1f2937;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;

  width: 100%;
  box-sizing: border-box;

  height: 3.05rem;
  line-height: normal;
  vertical-align: middle;

  font-size: 1.05rem;
  padding: 0.85rem 1.05rem;
  padding-right: 2.4rem;

  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.2rem;
}

input[type="date"]:hover { border-color: #9ca3af; }

input[type="date"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.20);
  outline: none;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button { display: none; }

input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

/* =========================================================
   SPAZIATURA TRA "CARD" E TITOLO SUCCESSIVO
   ========================================================= */
form,
table,
.subcard {
  margin-bottom: 1.9rem;
}

form + h2, form + h3, form + h4,
table + h2, table + h3, table + h4,
.two-col + h2, .two-col + h3, .two-col + h4,
.subcard + h2, .subcard + h3, .subcard + h4 {
  margin-top: 2.0rem;
}
/* =========================================================
   APP SHELL (Splash + Login)
   - Header & footer fissi
   - Contenuto scrollabile indipendente
   - Layout 2 colonne responsive con contenuti centrati
   Usa: <body class="app-shell"> + .app-header/.app-main/.app-footer
   ========================================================= */

body.app-shell{
  /* override del layout “pagina” classico */
  padding: 0;
  margin: 0;
  max-width: none;

  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.app-header{
  flex: 0 0 auto;
  background-color: #2563eb; /* stesso colore dei bottoni */
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);

  padding: clamp(0.75rem, 1.2vw, 1rem) clamp(1rem, 3vw, 2.25rem);
}

.app-header__inner{
  /* full-width responsive container (no fixed max-width) */
  width: 100%;
  max-width: none;
  margin: 0 auto;

  display:flex;
  align-items:center;
  gap: 0.85rem;
}

/* Header brand link (logo + titolo cliccabili verso index.html) */
.app-brand-link{
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}
.app-brand-link:visited{ color: inherit; }
.app-brand-link:hover{ text-decoration: none; }


.app-logo{
  height: clamp(34px, 4vw, 48px);
  width: auto;
  display: block;
}

.app-title{
  margin: 0;
  color: #ffffff;
  font-weight: 800;
  line-height: 1.2;

  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

/* MAIN (scroll indipendente) */
.app-main{
  flex: 1 1 auto;
  overflow: auto;

  padding: clamp(1.25rem, 2.5vw, 2.25rem);
}

.app-main__inner{
  /* full-width responsive container (no fixed max-width) */
  width: 100%;
  max-width: none;
  margin: 0 auto;

  /* allow split to fill available height */
  min-height: 100%;
}

/* FOOTER */
.app-footer{
  flex: 0 0 auto;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;

  padding: 0.55rem clamp(1rem, 3vw, 2.25rem);

  font-size: 0.95rem;
  color: #6b7280;
}

.app-footer__inner{
width: 100%;
  max-width: none;
  margin: 0 auto;

  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =========================================================
   SPLIT LAYOUT (sx immagine / dx CTA o login)
   ========================================================= */
.split{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: stretch;

  min-height: 100%;
}

.split__panel{
  background: #ffffff;
  border-radius: 1.1rem;
  box-shadow: 0 5px 12px rgba(0,0,0,0.06);

  padding: clamp(1.25rem, 2.2vw, 2rem);

  display: flex;
  align-items: center;
  justify-content: center;
}

.split__content{
  width: 100%;
  max-width: 520px;
  text-align: center;
}



/* =========================================================
   SPLIT (splash/login) tweaks
   - left panel: media centered without max-width constraint
   ========================================================= */

.split{
  width: 100%;
  min-height: 100%;
}

.split__panel--media .split__content{
  max-width: none;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.split__panel--media .splash-hero{
  margin: 0;
  max-height: min(70vh, 520px);
  width: auto;
  object-fit: contain;
}
.split__content p{
  margin-left: auto;
  margin-right: auto;
}

/* Immagine splash */
.splash-hero{
  max-width: 100%;
  height: auto;
  max-height: min(520px, 52vh);
  display: block;
}

/* Piccolo testo di supporto */
.muted{
  color: #6b7280;
  font-size: 1.02rem;
  margin-top: 0.75rem;
}

/* Responsive: colonne -> righe */
@media (max-width: 980px){
  .split{
    grid-template-columns: 1fr;
  }
  .split__panel{
    min-height: auto;
  }
  .split__content{
    max-width: 640px;
  }
}

/* --- Fix: centra sempre l'immagine nella colonna sinistra (splash/login) --- */
.split__panel:first-child .split__content{
  display: flex;
  justify-content: center;
  align-items: center;
}
.split__panel:first-child .splash-hero{
  margin-left: auto;
  margin-right: auto;
}


/* Footer: allinea l'ultimo elemento a destra */
.app-footer__inner > :last-child{
  margin-left: auto;
  text-align: right;
}

/* =========================================================
   PORTALE: SELEZIONE PROFILO (Aziende / PA / Scuole)
   Usa: .choice-grid + .choice-card
   ========================================================= */

.portal-lead{
  margin-bottom: 0.9rem;
}

.choice-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.15rem;
}

.choice-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;

  text-align: center;
  text-decoration: none;

  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;

  padding: 1.1rem 1.1rem;
  border-radius: 1.1rem;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);

  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.choice-card:hover{
  transform: translateY(-2px);
  filter: brightness(0.98);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.32);
  text-decoration: none;
}

.choice-card:active{
  transform: translateY(0);
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.22);
}

.choice-card:visited{
  color: #ffffff;
}

.choice-icon{
  width: 56px;
  height: 56px;
  display: block;
}

.choice-title{
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
}

.choice-subtitle{
  font-size: 0.98rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
}

@media (max-width: 420px){
  .choice-icon{ width: 48px; height: 48px; }
}
