/* ======================================================
   GGR Plugin – Stylesheet
   - Form Wizard (step 1/2)
   - Input helpers (CHF suffix + fade left)
   - Report output
   - Dashboard cards + list
   - Overlay "Elaborazione..."
   ====================================================== */


/* ======================================================
   0) Base wrapper
   ====================================================== */

.ggr-plugin{
  max-width: 100%;
  margin: 0 auto;
}

.ggr-success{
  padding-bottom: 20px !important;
}


/* ======================================================
   1) Header: credits / cost + error box
   ====================================================== */

.ggr-header{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
}

.ggr-credits,
.ggr-cost{
  font-size: 14px;
}

.ggr-error{
  padding: 10px 12px;
  border: 1px solid #f2b8b5;
  background: #fff5f5;
  border-radius: 10px;
}


/* ======================================================
   2) Step indicator (wizard)
   ====================================================== */

.ggr-steps{
  display: flex;
  gap: 10px;
  margin: 12px 0 18px;
}

.ggr-step{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fafafa;
  opacity: .65;
}

.ggr-step--active{
  background: #fff;
  opacity: 1;
  border-color: #cfd8e3;
}

.ggr-step__num{
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #cfd8e3;
  font-weight: 700;
  font-size: 13px;
  background: #fff;
}

.ggr-step__label{
  font-weight: 600;
  font-size: 14px;
}


/* ======================================================
   3) Form container + panels
   ====================================================== */

.ggr-form{
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 16px;
}

.ggr-form h3{
  margin: 6px 0 14px;
  font-size: 18px;
}

.ggr-step-panel{
  display: none;
}

.ggr-step-panel--active{
  display: block;
}


/* ======================================================
   4) Rows: field left + help right
   ====================================================== */

.ggr-row{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid #f1f1f1;
}

.ggr-row:first-of-type{
  border-top: 0;
}

.ggr-field label{
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
}

.ggr-help{
  font-size: 13px;
  line-height: 1.45;
  color: #555;
  background: #fafafa;
  border: 1px dashed #e3e3e3;
  border-radius: 10px;
  padding: 10px 12px;
}


/* ======================================================
   5) Inputs / selects / textarea (look & feel)
   ====================================================== */

.ggr-field input,
.ggr-field select{
  width: 100%;
  min-height: 50px;            /* come richiesto */
  padding: 10px 12px!important;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
}

.ggr-plugin .ggr-field select, .ggr-plugin .ggr-field input{
  font-size:19px;
font-weight: 700;
}

/* textarea (se in futuro) */
.ggr-field textarea{
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
}


/* ======================================================
   6) CHF suffix wrapper
   - Usa HTML: <span class="ggr-input-suffix"><input ...><span class="ggr-suffix">CHF</span></span>
   ====================================================== */

.ggr-input-suffix{
  position: relative;
  display: block;
  width: 100%;
}

/* spazio a destra per CHF */
.ggr-input-suffix input{
  padding-right: 3.2em; /* spazio per "CHF" */
}

/* label CHF */
.ggr-input-suffix .ggr-suffix{
  position: absolute;
  right: .9em;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  opacity: .65;
  pointer-events: none;
}


/* ======================================================
   7) Fade sinistro 10px sugli input (versione pulita)
   - Mantiene il border normale
   - Nessun effetto ombra
====================================================== */

/* assicura border visibile */
.ggr-field input,
.ggr-field select,
.ggr-field textarea {
  border: 1px solid #cfcfcf;
  box-shadow: none !important;
}



.ggr-field input:focus,
.ggr-field select:focus {
  border-color: #1e73be;
  outline: none;
}

/* ======================================================
   8) Buttons
   ====================================================== */

.ggr-actions{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.ggr-btn{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #cfcfcf;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.ggr-btn--primary{
  border-color: #1e73be;
  background: #1e73be;
  color: #fff;
}

.ggr-btn--primary:hover{
  filter: brightness(.95);
}


/* ======================================================
   9) Responsive
   ====================================================== */

@media (max-width: 720px){
  .ggr-header{
    flex-direction: column;
  }
  .ggr-row{
    grid-template-columns: 1fr;
  }
  .ggr-actions{
    flex-direction: column;
  }
  .ggr-btn{
    width: 100%;
  }
}


/* ======================================================
   10) Report output
   ====================================================== */

.ggr-output{
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
}

.ggr-output__title{
  margin: 0 0 12px;
  font-size: 18px;
}

.ggr-output__row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f1f1f1;
}

.ggr-output__row:first-child{
  border-top: 0;
}

.ggr-output__label{
  font-weight: 700;
}

.ggr-output__value{
  font-weight: 700;
}


/* ======================================================
   11) Dashboard cards
   ====================================================== */

.ggr-dashboard-card{
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
}

.ggr-card-title{
  margin: 0 0 12px;
  font-size: 18px;
}

.ggr-kpi{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #efefef;
  border-radius: 12px;
  background: #fafafa;
  margin: 0 0 14px;
}

.ggr-kpi__label{
  font-size: 14px;
  opacity: .8;
  font-weight: 600;
}

.ggr-kpi__value{
  font-size: 22px;
  font-weight: 800;
}

.ggr-btn-container{
  padding: 20px 0 10px;
}


/* ======================================================
   12) Lista valutazioni (card)
   ====================================================== */

.ggr-list{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ggr-list__item{
  padding: 16px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all .2s ease;
}

.ggr-list__item:hover{
  border-color: #d0d0d0;
  box-shadow: 0 3px 10px rgba(0,0,0,.04);
}

.ggr-list__link{
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.ggr-list__meta{
  font-size: 13px;
  opacity: .65;
}

@media (max-width: 720px){
  .ggr-list__item{
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}


/* ======================================================
   13) Overlay "Elaborazione..."
   ====================================================== */

.ggr-plugin .ggr-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.ggr-plugin .ggr-overlay.is-active{
  display: flex;
}

.ggr-plugin .ggr-overlay__box{
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  max-width: 420px;
  width: calc(100% - 40px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  text-align: center;
}

.ggr-plugin .ggr-overlay__text{
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.35;
}

.ggr-plugin .ggr-spinner{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(0,0,0,.12);
  border-top-color: rgba(0,0,0,.55);
  animation: ggrspin .9s linear infinite;
  margin: 0 auto;
}

@keyframes ggrspin{
  to{ transform: rotate(360deg); }
}