/* ============================================================
   DMA Technical Support Form — Front-end Styles
   Tutte le classi sono prefissate .dma-ts- per evitare
   conflitti con altri plugin/widget sulla stessa pagina.
   ============================================================ */

.dma-ts-wrap { font-family: inherit; }

.dma-ts-card { background: transparent; border: none; }

.dma-ts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dma-ts-full { grid-column: 1 / -1; }

/* ── Field ──────────────────────────────────────────────── */
.dma-ts-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dma-ts-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  line-height: 1.3;
}

.dma-ts-req { color: #ef4444; margin-left: 1px; }

/* ── Inputs ─────────────────────────────────────────────── */
.dma-ts-input {
  display: block;
  width: 100%;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
}

select.dma-ts-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}

textarea.dma-ts-input { resize: vertical; min-height: 100px; }

.dma-ts-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.dma-ts-input.dma-ts-input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

/* ── Error message ──────────────────────────────────────── */
.dma-ts-error {
  font-size: 12px;
  color: #ef4444;
  min-height: 1em;
  display: none;
}
.dma-ts-field.dma-ts-has-error .dma-ts-error { display: block; }

/* ── Divider ────────────────────────────────────────────── */
.dma-ts-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2px 0;
}

/* ── Tip (P/N – S/N location) ───────────────────────────── */
.dma-ts-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}
.dma-ts-tip svg { flex-shrink: 0; margin-top: 2px; color: #94a3b8; }
.dma-ts-tip a   { color: #2563eb; text-decoration: underline; text-underline-offset: 3px; }

/* ── Feedback banners ───────────────────────────────────── */
.dma-ts-feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.dma-ts-feedback svg { flex-shrink: 0; margin-top: 2px; }
.dma-ts-feedback a   { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.dma-ts-feedback--success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}
.dma-ts-feedback--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

/* ── Submit footer ──────────────────────────────────────── */
.dma-ts-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* ── Button ─────────────────────────────────────────────── */
.dma-ts-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background .18s, transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.dma-ts-btn:not(:disabled):hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.dma-ts-btn:not(:disabled):active { transform: translateY(0); }
.dma-ts-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ── Spinner ────────────────────────────────────────────── */
.dma-ts-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dma-ts-spin .55s linear infinite;
  flex-shrink: 0;
}
.dma-ts-btn.dma-ts-loading .dma-ts-spinner { display: block; }

@keyframes dma-ts-spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 580px) {
  .dma-ts-grid { grid-template-columns: 1fr; }
  .dma-ts-full { grid-column: 1; }
}
