/* =============== SunshineTrack Global Styles =============== */
:root{
  --bg1: #e6fffa;      /* mint */
  --bg2: #e0f2fe;      /* azzurro */
  --ink: #0f2942;      /* testo scuro neutro */
  --muted: #708397;
  --card-bg: rgba(255,255,255,0.82);
  --card-border: rgba(15,41,66,0.06);
  --shadow: 0 12px 40px rgba(15,41,66,0.12);
  --radius: 18px;

  /* colori bottoni (allineati al login) */
  --brand: #0ea5e9;       /* Accedi / Salva */
  --brand-dark: #0369a1;  /* Annulla / Export PDF */
  --alt-green: #065f46;   /* Nuovo record, verdone scuro */

  --ring: rgba(147,197,253,.28);
  --ring-strong: rgba(59,130,246,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(178,245,234,.55), rgba(59,130,246,.22)),
    linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
}

/* Container */
.container{
  width:min(1100px, 92vw);
  margin:32px auto 120px;
}

/* Hero */
.hero{
  text-align:center;
  margin-bottom:18px;
}
.title{
  font-size:34px;
  line-height:1.2;
  margin:0;
  font-weight:800;
  color:var(--ink);
  display:inline-block;
  padding-bottom:8px;
}
.title-bordered{
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg,#ff5f6d,#ffc371,#33d9b2,#34ace0,#706fd3) 1;
}
.subtitle{
  margin:6px 0 0;
  color:var(--muted);
  font-weight:600;
}

/* Sections = pannelli glass */
.section{
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border:1px solid var(--card-border);
  border-radius: var(--radius);
  padding:18px;
  margin:14px 0;
  box-shadow: var(--shadow);
}
.sec-title{
  font-weight:800; color:var(--ink);
  margin:-4px 0 12px;
  letter-spacing:.2px;
}

/* Grid di campi */
.row{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:14px;
}

/* Etichette & campi */
label{display:block; font-size:14px; color:var(--ink); margin:8px 0 6px;}
label input, label select, label textarea{ margin-top:4px; }

input[type=text], input[type=date], input[type=number], input[type=password], select, textarea{
  width:100%;
  font-size:14px;
  padding:10px 12px;
  border:1px solid #dfe7ee;
  border-radius:10px;
  outline:none;
  background:#fff;
  transition: box-shadow .2s, border-color .2s, transform .02s;
}
input:focus, select:focus, textarea:focus{
  border-color:#93c5fd;
  box-shadow: 0 0 0 4px var(--ring);
}

/* Checkbox/Radio inline compatti */
.inline-options{ display:flex; gap:12px; align-items:center; }
.inline-options label{ margin:0; font-weight:600; }
input[type=checkbox], input[type=radio]{ transform: scale(1.05); }

/* Hint */
.hint{ color:var(--muted); font-size:12.5px; margin-top:4px; }
.hint.ok{ color:#059669; }
.hint.err{ color:#b91c1c; }

/* Actions */
.actions{
  display:flex; flex-wrap:wrap; gap:10px; margin-top:12px;
}
button{ font-family:inherit; }
.btn-save, .btn-pdf, .btn-new{
  border:0; cursor:pointer; padding:10px 16px;
  border-radius:999px; font-weight:800; font-size:14px;
  color:#fff; box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* colori come richiesto */
.btn-save{ background: var(--brand); }        /* Salva = come "Accedi" */
.btn-save:hover{ filter:brightness(.95); box-shadow:0 8px 22px rgba(14,165,233,.25); }

.btn-pdf{ background: var(--brand-dark); }    /* Export PDF = come "Annulla" */
.btn-pdf:hover{ filter:brightness(.95); box-shadow:0 8px 22px rgba(3,105,161,.25); }

.btn-new{ background: var(--alt-green); }     /* Nuovo record = verdone scuro */
.btn-new:hover{ filter:brightness(.97); box-shadow:0 8px 22px rgba(6,95,70,.25); }

/* ===== Modal (solo fix z-index/backdrop) ===== */
.modal.hidden{ display:none; }
.modal{
  position:fixed; inset:0;
  z-index:1000;           /* contenitore sopra alla pagina */
}
.modal-backdrop{
  position:absolute; inset:0;
  background:rgba(0,18,38,.35); backdrop-filter: blur(2px);
  z-index:1;              /* sfondo sotto */
}
.modal-card{
  position:absolute; left:50%; top:14%; transform: translateX(-50%);
  width:min(560px, 92vw);
  background: var(--card-bg);
  border:1px solid var(--card-border);
  border-radius:16px;
  box-shadow: var(--shadow);
  padding:18px;
  z-index:2;              /* popup sopra, cliccabile */
}
.modal-close{
  position:absolute; right:10px; top:8px;
  border:0; background:transparent; font-size:22px; line-height:1; cursor:pointer;
  color:#95a6b8;
}
.modal-close:hover{ color:var(--ink); }
.modal-actions{ display:flex; gap:8px; margin-top:10px; }

/* Autocomplete (Comuni) */
.ac{
  background:#fff; border:1px solid #dfe7ee; border-radius:12px; margin-top:6px;
  max-height:200px; overflow:auto; box-shadow:0 8px 20px rgba(0,0,0,.06);
  font-size:14px;
}
.ac.hidden{ display:none; }
.ac-item{ padding:8px 10px; cursor:pointer; }
.ac-item:hover{ background:#f1f5f9; }
.ac-empty{ padding:8px 10px; color:#6b7280; }

/* Badge fisso, molto discreto */
.brand-badge{
  position:fixed; left:10px; bottom:10px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(15,41,66,0.05);
  border-radius:999px; padding:2px 6px;
  font-size:9px; font-weight:500; color:rgba(15,41,66,.55);
  box-shadow:none;
  z-index:70;
}

/* Utility */
.hidden{ display:none !important; }
select{ background-color:#fff; }
button:active{ transform: translateY(0.5px); }
:focus-visible{ outline: none; box-shadow: 0 0 0 4px var(--ring-strong); border-radius:10px; }