
/* ==========================================================================
   ZFORM Responsive / Adaptive Styles – DIEF Ticketing
   Autore: Copilot (per Alberto Corni)
   Scopo: rendere i form usabili e gradevoli su desktop e smartphone
   ========================================================================== */

/* 0) Reset essenziale + box-sizing coerente */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  color: #1a1a1a;
  background: #f7f7f7;
  /* font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
   */
  line-height: 1.5;
}

#zammad-feedback-form {
    display: none;/*Nascondo tutti i campi del modulo Zammad*/
}
/* 1) Contenitori principali (riutilizzabili con le classi esistenti) */
.zform-container, .form-container, .ticketing-form, .container {
  max-width: 960px;
  margin-inline: auto;
  margin-block: 24px;
  padding-inline: 16px;
}

/* 2) Sezioni a “card” per blocchi del form (es. Sicurezza, ICT, Acquisti) */
.zform-section, .card, .panel {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 16px;
  margin-block: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* 3) Tipografia responsive */
h1, h2, h3 { line-height: 1.25;  text-align: center; color: #5a5b5d }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem); }
h2 { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 1.0rem + .5vw, 1.35rem); }
p  { margin: 0 0 10px; }

/* 4) Layout del form con Grid */
.zform-grid, .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.zform-col-6, .col-6 { grid-column: span 6; }   /* due colonne su desktop */
.zform-col-12, .col-12 { grid-column: span 12; } /* intera larghezza */

/* 5) Gruppi di campo */
.zform-field, .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
label {
  font-weight: 600;
}

/* 6) Controlli di input e textarea */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  min-height: 44px; /* target touch-friendly */
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

/* Placeholder leggibile */
::placeholder { color: #8a8a8a; }

/* Focus accessibile (WCAG) */
:where(input, select, textarea):focus {
  outline: 2px solid transparent;
  border-color: #2563eb;               /* blu accessibile */
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}

/* Stato disabilitato */
:where(input, select, textarea)[disabled] {
  background: #f2f2f2;
  color: #9f9f9f;
  cursor: not-allowed;
}

/* 7) Checkbox/Radio con area cliccabile maggiore */
.zform-choice, .form-choice {
  display: flex;
  align-items: center;
  gap: 10px;
}
.zform-choice input[type="checkbox"],
.zform-choice input[type="radio"],
.form-choice input[type="checkbox"],
.form-choice input[type="radio"] {
  inline-size: 18px;
  block-size: 18px;
}

/* 8) Select con caret custom, mantenendo compatibilità */
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%),
    linear-gradient(to right, #ddd, #ddd);
  background-position:
    calc(100% - 18px) calc(50% - 6px),
    calc(100% - 12px) calc(50% - 6px),
    calc(100% - 40px) 50%;
  background-size:
    6px 6px,
    6px 6px,
    1px 60%;
  background-repeat: no-repeat;
  padding-right: 48px;
}

/* 9) Fieldset/legend */
fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 12px 8px;
  margin: 8px 0;
}
legend {
  padding: 0 8px;
  font-weight: 700;
  color: #333;
}

/* 10) Messaggi di aiuto / errore */
.zform-help, .help { color: #6a6a6a; font-size: .95rem; }
.zform-error, .error { color: #b91c1c; font-weight: 600; }
:where(input, select, textarea).[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.2);
}

/* 11) Pulsanti */
.zform-actions, .form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
button,
input[type="submit"],
.button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .12s ease, background-color .12s ease;
}
.button-primary,
input[type="submit"] {
  background: #2563eb;
  color: #fff;
}
.button-primary:hover { background: #1e4fd4; }
.button-secondary {
  background: #eef2ff;
  color: #1e3a8a;
  border-color: #c7d2fe;
}
button:active { transform: translateY(1px); }

/* 12) Tabelle di riepilogo (se presenti) */
.zform-table, .table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e5e5;
  background: #fff;
}
.zform-table th, .zform-table td,
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.zform-table tr:hover, .table tr:hover { background: #fafafa; }

/* 13) Utilità */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.w-100 { width: 100% !important; }

/* 14) Media queries per adattività */
@media (max-width: 992px) {
  .zform-container, .form-container, .ticketing-form, .container { padding-inline: 12px; }
  .zform-grid, .grid { gap: 14px; }
}

@media (max-width: 768px) {
  .zform-grid, .grid { grid-template-columns: repeat(6, 1fr); }
  .zform-col-6, .col-6 { grid-column: span 6; } /* singola colonna */
  .zform-section, .card, .panel { padding: 14px; border-radius: 10px; }
  input, select, textarea { font-size: 1rem; }
  .zform-actions, .form-actions { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .zform-container, .form-container, .ticketing-form, .container {
    margin-block: 16px;
    padding-inline: 10px;
  }
  body { font-size: 1rem; }
  h1 { font-size: 1.5rem; }
  .zform-section, .card, .panel { padding: 12px; }
}

/* 15) Riduzione motion per chi preferisce meno animazioni */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 16) Modalità scura (opzionale, auto) */
@media (prefers-color-scheme: dark) {
  body { background: #0f172a; color: #e5e7eb; }
  h1, h2, h3 { line-height: 1.25;  text-align: center; color: #eaebed }
  a:link { color: #e5e7ff;}
  a:visited { color: #e5e7ff;}
  .zform-section, .card, .panel { background: #111827; border-color: #1f2937; box-shadow: none; }
  input, select, textarea { background: #0b1020; border-color: #334155; color: #e5e7eb; }
  .zform-table, .table { background: #111827; border-color: #1f2937; }
  .zform-table tr:hover, .table tr:hover { background: #0b1020; }
  .button-secondary { background: #0b1020; color: #cbd5e1; border-color: #334155; }
}
