/* ==================================================
   DOCUMENT SEARCH – FORM (HOME)
   ================================================== */

.ds-fields {
  width: 100%;
}

/* righe */
.ds-fields .ds-row {
  margin-bottom: 0.75em;
}

/* input full */
.ds-fields .ds-row-full input[type="text"] {
  width: 100%;
  padding: 0.6em 0.75em;
  border: 1px solid #bbb;
  border-radius: 0.25em;
  font: inherit;
  box-sizing: border-box;
}

/* riga a 3 colonne */
.ds-fields .ds-row-3 {
  display: flex;
  gap: 0.75em;
}

.ds-fields .ds-row-3 select {
  width: 100%;
  padding: 0.6em 2.5em 0.6em 0.75em;
  border: 1px solid #bbb;
  border-radius: 0.25em;
  background-color: #fff;
  font: inherit;
  appearance: none;
  box-sizing: border-box;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position:
    calc(100% - 16px) center,
    calc(100% - 11px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* riga azioni */
.ds-fields .ds-row-actions {
  display: flex;
}


/* ==================================================
   DOCUMENT SEARCH – ACTION GROUP
   Bottone composto Search + Reset
   ================================================== */

.ds-action-group {
  display: inline-flex;
  border: 1px solid #f36e21;
  border-radius: 0.25em;
  overflow: hidden;
}

/* stile base comune */
.ds-action-group .ds-btn {
  padding: 0.6em 1.4em;
  font: inherit;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  background-color: #fff;
  color: #f36e21;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* SEARCH – parte primaria */
.ds-action-group .ds-btn-search {
  background-color: #f36e21;
  color: #fff;
}

/* RESET – parte secondaria */
.ds-action-group .ds-btn-reset {
  border-left: 1px solid #f36e21;
}

/* hover / focus */
.ds-action-group .ds-btn-search:hover,
.ds-action-group .ds-btn-search:focus {
  background-color: #d95f1d;
}

.ds-action-group .ds-btn-reset:hover,
.ds-action-group .ds-btn-reset:focus {
  background-color: #fff4ee;
}


/* ==================================================
   DOCUMENT SEARCH – FORM (RICERCA)
   layout sempre verticale
   ================================================== */

.ds-form form {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

/* campi con stesso stile della home */
.ds-form input[type="text"],
.ds-form select {
  width: 100%;
  padding: 0.6em 0.75em;
  border: 1px solid #bbb;
  border-radius: 0.25em;
  background-color: #fff;
  font: inherit;
  box-sizing: border-box;
}

/* select: stessa freccia della home */
.ds-form select {
  padding-right: 2.5em;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position:
    calc(100% - 16px) center,
    calc(100% - 11px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* action group allineato a sinistra */
.ds-form .ds-action-group {
  align-self: flex-start;
}


/* ==================================================
   DOCUMENT SEARCH – RESULT DETAIL
   ================================================== */

.ds-result-description {
  margin: 1em 0 1.5em;
  font-size: 1rem;
  line-height: 1.6;
}


/* ==================================================
   MOBILE – Divi breakpoint
   ================================================== */

@media (max-width: 980px) {

  .ds-fields .ds-row-3 {
    flex-direction: column;
  }

  .ds-action-group {
    width: 100%;
  }

  .ds-action-group .ds-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ===============================
   INPUT CON TOOLTIP
   =============================== */

.ds-input-help {
  position: relative;
  width: 100%;
}

.ds-input-help input {
  width: 100%;
  padding-right: 2.8em; /* spazio per ? */
}

/* icona ? */
.ds-help-icon {
  position: absolute;
  top: 50%;
  right: 0.6em;
  transform: translateY(-50%);
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  border: 1px solid #f36e21;
  color: #f36e21;
  font-size: 0.8em;
  font-weight: bold;
  line-height: 1.2em;
  text-align: center;
  cursor: help;
  background: #fff;
  z-index: 5;
}

/* ===============================
   TOOLTIP – SEMPRE SOPRA A TUTTO
   =============================== */

.ds-help-tooltip {
  position: fixed;
  z-index: 999999;

  background: #333;
  color: #fff;

  font-size: 0.95rem;
  line-height: 1.6;

  padding: 1em 1.2em;
  border-radius: 6px;

  width: 340px;
  max-width: calc(100vw - 24px);

  box-sizing: border-box;

  white-space: normal;
  overflow-wrap: break-word;

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.15s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);

  isolation: isolate;
  background-clip: padding-box;
	
  mix-blend-mode: normal;
  filter: none;
  backdrop-filter: none;
}

/* visibile */
.ds-help-tooltip.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* freccetta */
.ds-help-tooltip::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 14px;
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

/* ===============================
   STILE ESEMPI UDI
   =============================== */

.ds-help-tooltip code {
  display: inline-block;
  max-width: 100%;
  background: #222;
  color: #ffcf9f;
  padding: 0.25em 0.45em;
  border-radius: 4px;
  font-size: 0.9em;
  margin-top: 0.25em;
  word-break: break-all;
}

/* ==================================================
   Eccezioni
   ================================================== */
.home .ds-action-group {
    display: inline-flex;
    border: 1px solid #ffffff;
    border-radius: 0.25em;
    overflow: hidden;
}

/* ==================================================
   Info card
   ================================================== */

.ds-info-card {
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 1.2rem 1.4rem;

  background: #2f2f2f;
  color: #fff;

  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.ds-info-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.ds-info-card p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e6e6e6;
}

.ds-info-example {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;

  font-size: 0.9rem;
  color: #d0d0d0;
}

.ds-info-example span {
  font-weight: 500;
}

.ds-info-example code {
  background: #1f1f1f;
  color: #ffcf9f;
  padding: 0.2em 0.45em;
  border-radius: 4px;
  font-size: 0.85rem;
  word-break: break-all;
}

.ds-info-arrow {
  font-size: 1rem;
  opacity: 0.8;
}