/* ═══════════════════════════════════════════════════════
   NCC MANAGER — SHARED BASE STYLES
   ═══════════════════════════════════════════════════════
   Regole CSS COMUNI tra calendario principale (index.html + app.css)
   ed event_editor.php. Estratte da mobile-enhancements.css per evitare
   asimmetrie visive tra i 2 contesti (vedi incident Eventi v1.4).

   Includere:
   - in index.html: <link rel="stylesheet" href="assets/css/shared-base.css">
     DOPO assets/css/app.css ma PRIMA di mobile-enhancements.css
   - in event_editor.php: <link rel="stylesheet" href="assets/css/shared-base.css">
     DOPO il <style> inline esistente

   Nota: regole responsive specifiche del calendario (grid mobile, sidebar
   drawer, dashboard responsive, safe area iPhone) restano in mobile-enhancements.css.
   Questo file contiene SOLO ciò che ha senso per entrambi i contesti.
   ═══════════════════════════════════════════════════════ */

/* ── 1. TOUCH TARGETS (Apple/Material guideline: min 44×44 ideale, 40 accettabile) ── */

.btn {
  min-height: 40px;
  padding: 10px 16px;
}
.btn-sm {
  min-height: 36px;
  padding: 7px 12px;
}

/* Bottoni close di modal/detail/notif — quadrati 36×36 minimi */
.modal-close, .detail-close, .notif-panel-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

/* Combo button (freccia ▾ a fianco degli input combo) */
.combo-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  font-size: 12px;
}

/* Bottone Rimuovi tappa intermedia */
.tappa-rm {
  width: 40px;
  height: 40px;
  min-width: 40px;
}

/* Bottone × dei multi-chip (driver/mezzo) */
.mchip-x {
  padding: 4px 6px;
  font-size: 18px;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── 2. FORM INPUT — touch friendly + previene zoom iOS ── */

.fg input, .fg select, .fg textarea {
  font-size: 16px; /* font ≥16px previene auto-zoom Safari iOS su focus */
  padding: 12px 14px;
  min-height: 44px;
  border-radius: 10px;
}
.fg select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238fa4c4' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.fg label {
  font-size: 11px;
  margin-bottom: 6px;
}
/* Autocomplete styling — previene flash bianco */
.fg input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px var(--bg0, #060b14) inset !important;
  -webkit-text-fill-color: var(--text, #e6ecf5) !important;
}

/* ── 3. VALIDATION ERROR STATE ── */

.fg.has-error input,
.fg.has-error select,
.fg.has-error textarea {
  border-color: var(--red, #c00000) !important;
  box-shadow: 0 0 0 3px rgba(212, 48, 48, .15) !important;
}
.fg .field-error {
  color: var(--red, #c00000);
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 4. LOADING BUTTON STATE ── */

.btn.loading {
  opacity: .7;
  pointer-events: none;
  position: relative;
}
.btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ncc-spin .6s linear infinite;
  margin-left: 6px;
}
@keyframes ncc-spin {
  to { transform: rotate(360deg); }
}
