/* ====== Design System ====== */
:root{
  --bg: #f6f8fb;
  --text: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --border: #e5e7eb;
  --primary: #38c793;        /* verde menta */
  --primary-600:#22a373;
  --accent: #6ec7f5;         /* azzurrino */
  --danger: #ef4444;
  --warning:#f59e0b;
  --success:#16a34a;
  --shadow: 0 8px 28px rgba(15, 23, 42, .06);
  --radius: 16px;
}

/* ====== Base ====== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}
.wrap-login{max-width:1000px;margin:15vh auto;padding:0 20px}
a{color:#2563eb;text-decoration:none}
a:hover{text-decoration:underline}
.note{color:var(--muted)}

/* ====== Card / Header ====== */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  box-shadow:var(--shadow);
  margin: 5vh 0;
}
.head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;   /* sfondo come body */
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  z-index: 1000;
}

.head h1 {font-size:1.1rem;
}
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
  margin-top: 15vh;  /* 👈 spazio per l’header fisso */
}
.badge{
  display:inline-block;padding:4px 10px;border-radius:999px;
  font-size:.82rem;border:1px solid var(--border);color:var(--muted);background:#fff;
}
.badge.done{color:#0a7c4d;background:#eafff4;border-color:#c7f5df}
.badge.todo{color:#915f00;background:#fff7e6;border-color:#fde4b2}
.card h1, .card h2{text-align:center;}
.card button {margin:0 auto;}
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;                /* spazio sopra e sotto */
}

/* ====== Inputs ====== */
label{display:block;margin:10px 0 6px 0;font-weight:600;color:#111827}
.input, input[type="email"], input[type="text"], input[type="number"], select, textarea{
  width:100%;
  max-width:100%;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:4px;
  background:#fff;
  color:var(--text);
  outline:none;
}
input, select, textarea{font-size:16px;line-height:1.3}
textarea{min-height:110px;resize:vertical}
input:focus, select:focus, textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(56,199,147,.15);
}

/* Campo email */
input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 16px;  /* 👈 spazio sotto il campo */
}

/* Bottone login */
.card button {
    display: block;
    width: auto;
    margin: 16px auto;
    padding: 12px 14px;
    border: none;
    border-radius: 4px;
    background: #22c55e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

/* Fix “sborda” su iOS/desktop */
input[type="email"]{box-sizing:border-box; overflow:hidden; text-overflow:ellipsis}

/* ====== Buttons ====== */
.btn, button{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color:#fff;border:0;border-radius:4px;padding:12px 16px;
  font-weight:700;cursor:pointer;box-shadow:0 6px 18px rgba(56,199,147,.28);
}
.btn:hover, button:hover{filter:brightness(.98)}
.btn.secondary{
  background:#fff;color:#0f172a;border:1px solid var(--border);
  box-shadow:none;
}
.btn.link{background:transparent;color:#2563eb;border:0;box-shadow:none;padding:0}

/* ====== Layout utilities ====== */
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.section{margin-bottom:16px}

/* ====== Alerts / Flash ====== */
.flash{background:#eafff4;border:1px solid #c7f5df;color:#065f46;padding:12px;border-radius:12px;margin-bottom:12px}
.err{background:#fff1f2;border:1px solid #fecdd3;color:#9f1239;padding:12px;border-radius:12px}

/* ====== Chart.js (tema chiaro) ====== */
canvas{background:#fff;border:1px solid var(--border);border-radius:12px;padding:10px}


/* Pulsanti principali (vai al test) */
a.btn {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:10px 14px;
  border-radius:4px;
  background:#8a2be2;    
  color:white;
  font-weight:700;
  text-decoration:none;
  box-shadow: none; 
  font-size:0.95rem;
}

/* Pulsanti secondari (aggiorna/salva risposte) */
.update button {
  padding:6px 10px;
  border:1px solid #475569;     /* bordo grigio scuro */
  border-radius:6px;
  background:#1e293b;           /* grigio/blu molto scuro */
  color:#e2e8f0;                /* testo chiaro */
  font-size:0.85rem;            /* leggermente più piccolo */
  cursor:pointer;
  opacity:0.8;                  /* meno “forte” */
}

.update button:hover {
  opacity:1;                    /* leggibile solo al passaggio */
  background:#334155;
}

p {
  line-height: 1.6;   /* default ~1.2, così aumenti la leggibilità */
  margin-bottom: 1em; /* opzionale: aggiunge spazio tra paragrafi */
}

h1, h2, h3 {
  line-height: 1.3;   /* titoli più compatti */
}

/* Grit: spacing tra domande */
.grit-item { 
  margin: 14px 0 18px; 
}
.grit-item > label { 
  display:block; 
  margin-bottom: 6px; 
  line-height: 1.5; 
}
.grit-options label { 
  display: inline-block; 
  margin-right: 12px; 
}

/* Tabella di riferimento valori 1–5 */
.grit-ref {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  color: white;
}
.grit-ref th, .grit-ref td {
  padding: 10px 12px;
  border-bottom: 1px solid #233040;
}
.grit-ref th {
  text-align: left;
  background: #0f172a;
  color: #cbd5e1;
}
.grit-ref tr:last-child td { border-bottom: 0; }

.grit-result{margin-top:10px;font-weight:600;color:var(--text)}
