/* ========== RESET ========== */
* { margin:0; padding:0; box-sizing:border-box; -webkit-font-smoothing:antialiased; }
:root {
  --radius: 10px;
  --border: #e6e6e6;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --card-bg: #fff;
  --page-bg: #fafafa;
  --text: #111;
  --muted: #666;
  --control-h: 44px;  /* stessa altezza per input e bottoni */
}

/* ========== BASE ========== */
body {
  font-family: "SF Pro Display","Helvetica Neue",Arial,sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
}

/* ========== CONTAINER ========== */
.container {
  width: 95%;
  max-width: 1100px;
  margin: 40px auto;
  padding: 20px;
}

/* ========== CARD SECTIONS ========== */
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  overflow: hidden; /* evita fuoriuscite su mobile */
}
.section-card:hover { transform: translateY(-1px); transition: transform .2s ease; }

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #000;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

/* ========== TITOLI & TESTI ========== */
h1 { font-size: 1.8rem; font-weight: 700; text-align:center; margin-bottom: 18px; }
p  { font-size: .95rem; color: var(--text); }

/* ========== GRID DEI FORM ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  align-items: start;
}

.form-group { display:flex; flex-direction:column; width:100%; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: .85rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

/* Riga input + bottone (es: file + Analizza) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 240px; /* input largo, bottone a destra */
  gap: 16px;
  width: 100%;
}
@media (max-width: 700px){
  .form-row { grid-template-columns: 1fr; }
}

/* ========== INPUTS ========== */
.input-control, 
input[type="text"], 
input[type="number"], 
input[type="file"], 
select, 
textarea {
  width: 100%;
  max-width: 100%;
  height: var(--control-h);
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  background: #fafafa;
  font-size: .95rem;
  line-height: 1;
  transition: border .2s, box-shadow .2s, background .2s;
}

input[type="file"] {
  padding: 10px 12px; /* i file input ignorano l'altezza su alcuni browser */
  height: var(--control-h);
  cursor: pointer;
  background:#fff;
}

input:focus, select:focus, textarea:focus {
  border-color: #000;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
  background: #fff;
}

/* ========== BUTTONS (NERI) ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);         /* uguale agli input */
  padding: 0 16px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s, color .2s, transform .08s, border-color .2s;
  max-width: 100%;
}
.btn:hover   { background:#222; border-color:#222; }
.btn:active  { transform: translateY(1px); }
.btn-outline {
  background:#fff; color:#000; border-color:#000;
}
.btn-outline:hover { background:#000; color:#fff; }
.btn-full { width: 100%; }

/* Pulsante nella griglia: occupa tutta la riga */
.form-grid .btn-full { grid-column: 1 / -1; }

/* ========== TABELLA RISULTATI ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: .95rem;
}
.data-table th {
  font-weight: 600;
  color: #000;
  background: #fafafa;
}

/* ========== MESSAGGI ========== */
.error { color:#c62828; font-weight:500; margin: 8px 0 14px; }
.result { margin-top: 14px; padding-top: 12px; border-top:1px solid #eee; }

/* ========== RESPONSIVE TWEAKS ========== */
@media (max-width: 768px){
  .container { margin: 24px auto; padding: 12px; }
  .section-card { padding: 18px; }
  h1 { font-size: 1.5rem; }
  .section-title { font-size: 1.1rem; }
}

/* STOP ai conflitti precedenti: assicurati che NON esistano altre definizioni .btn blu in fondo al file */