:root {
      --primary: #4ea8de;
      --secondary: #7400b8;
      --dark: #1f1f1f;
      --light: #f9f9f9;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background-color: var(--light);
      color: var(--dark);
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }

    .header {
      padding: 1.2rem 2rem;
      background: var(--dark);
      color: white;
      font-size: 1.5rem;
      font-weight: bold;
      text-align: center;
    }

    .container {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      max-width: 1200px;
      margin: 0 auto;
      padding: 2rem 1rem;
      min-height: 600px;
      gap: 40px; /* Spazio tra form e pannello variabili */
    }

    .card {
      flex: 1 1 550px;
      max-width: 550px;
      margin: 0 auto;
      background: white;
      padding: 2.5rem;
      border-radius: 1.5rem;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
      z-index: 1;
    }

    h2 {
      text-align: center;
      margin-bottom: 1.5rem;
      font-size: 2rem;
      color: var(--primary);
    }

    label {
      font-weight: 600;
    }

    .form-control {
      width: 100%;
      padding: 0.75rem;
      border: 1px solid #ccc;
      border-radius: 0.6rem;
      margin-bottom: 1rem;
      font-size: 1rem;
    }

    .form-check {
      margin-bottom: 1.5rem;
    }

    .form-check-label a {
      color: var(--secondary);
      text-decoration: underline;
    }

    .btn-submit {
      background: var(--primary);
      color: white;
      font-weight: bold;
      padding: 0.75rem;
      border: none;
      border-radius: 999px;
      width: 100%;
      cursor: pointer;
      font-size: 1rem;
      transition: all 0.3s ease;
    }

    .btn-submit:hover {
      background: #3a94c4;
      transform: scale(1.03);
    }

    .preview-btn {
      background: transparent;
      border: none;
      color: var(--secondary);
      font-size: 0.9rem;
      margin-top: -12px;
      margin-bottom: 12px;
      cursor: pointer;
      text-decoration: underline;
    }

    footer {
      text-align: center;
      padding: 1.2rem;
      background: var(--dark);
      color: white;
      font-size: 0.9rem;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(40px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Modal styling */
    .modal {
      display: none;
      position: fixed;
      z-index: 999;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: rgba(0,0,0,0.5);
    }

    .modal-content {
      background-color: white;
      margin: 10% auto;
      padding: 20px;
      border-radius: 1rem;
      width: 90%;
      max-width: 500px;
      font-size: 0.9rem;
      white-space: pre-wrap;
    }

    .close {
      color: #aaa;
      float: right;
      font-size: 28px;
      cursor: pointer;
    }

    lottie-player {
      width: 200px;
      margin: auto;
      display: block;
    }

    .stepper {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}
.step-wrapper {
  text-align: center;
}
.step {
  width: 32px;
  height: 32px;
  background: #ccc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.step.active {
  background: var(--primary, #007bff);
}

 .progress-bar {
      width: 100%;
      background-color: #eee;
      border-radius: 10px;
      overflow: hidden;
      height: 12px;
    }
    .progress {
      height: 100%;
      width: 0;
      background-color: #007bff;
      transition: width 0.4s ease;
    }

    .btn-insert {
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
}

.btn-insert:hover {
  background: #d7ecff;
  border-color: #4ea8de;
}

#variables-box {
  background-color: white;
  width: 25%;
}

.toggle-section {
  background: transparent;
  border: none;
  color: var(--secondary);
  font-size: 0.95rem;
  margin: 0.6rem 0;
  text-decoration: underline;
  cursor: pointer;
}

.header-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.header-row .form-control {
  flex: 1;
  min-width: 0;
}

.btn-remove {
  background: #e74c3c;
  border: none;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.btn-add {
  margin-top: 0.6rem;
  background: #3498db;
  color: white;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-block;
}

/* Scoped styles for WSDL page (no global overrides) */
#wsdlCard .wsdl-summary { font-size: 0.95rem; line-height: 1.4; }
#wsdlCard .operation-card { background: white; border: 1px solid #efefef; padding: 12px; border-radius: 8px; }
#wsdlCard .operation-card .op-title { font-size: 1rem; color: var(--dark); }
#wsdlCard .operation-card .op-description { color: #666; }
#wsdlCard .op-response-template { min-height: 110px; font-family: monospace; font-size: 0.9rem; }
#wsdlCard .op-endpoint-path { width: auto; max-width: 320px; }

#wsdlHelpModal .modal-content pre { white-space: pre-wrap; max-height: 60vh; overflow: auto; background: #fafafa; padding: 10px; border-radius: 6px; border: 1px solid #eee; }

/* buttons already used (btn-add, btn-insert, btn-submit) exist; ensure spacing */
#wsdlCard .btn-add { padding: 8px 12px; border-radius: 8px; }
#wsdlCard .btn-insert { padding: 8px 12px; border-radius: 8px;  margin: 9.6px 0 0 0;}
#wsdlCard .btn-submit { min-width: 180px; }

/* ========== Nuovi bottoni e varianti ========== */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(78,168,222,0.14); }
.btn-primary:disabled { opacity: 0.6; transform:none; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 1px solid #d0d5da;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--dark);
}
.btn-secondary:hover { background:#f4f6f8; }

/* small insert buttons */
.btn-insert { padding: 0.35rem 0.6rem; border-radius: 6px; border:1px solid #e0e6ea; background:#fafafa; cursor:pointer; }
.btn-insert:hover { background: #f0fbff; border-color: #cfeefc; }

/* keeps your .btn-add style but aligned with primary */
.btn-add { background: #3498db; color: white; padding: 0.5rem 0.8rem; border-radius: 8px; border: none; cursor:pointer; }
.btn-add:hover { transform: translateY(-1px); }

/* widen main card to give more room for operation templates
   but keep responsive behavior (mobile -> full width) */
@media (min-width: 980px) {
  .container { align-items: flex-start; }
  .card#wsdlCard { max-width: calc(100% - 360px); } /* leaves room for sidebar ~320px + gap */
  .variables-box { width: 320px; }
}

/* mobile: stack vertically */
@media (max-width: 979px) {
  .card#wsdlCard { max-width: 100%; }
  .variables-box { width: 100%; margin-left: 0; margin-top: 16px; }
}

/* modal API key display styling */
.modal-content pre.api-key-display {
  background: #f7fbff;
  border: 1px dashed #cfeefc;
  padding: 12px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

/* small tweak to textarea font for soap xml readability */
.op-response-template { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace; font-size: 0.95rem; line-height:1.35; }

#finalAnimation {
  display: block;
  text-align: center;
  margin-top: 2rem;
  position: static;
  width: 100%;
  max-width: 100%;
}

/* Layout desktop: form centrato, variabili a destra */
.container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 600px;
  gap: 40px; /* Spazio tra form e pannello variabili */
}

.card {
  flex: 1 1 550px;
  max-width: 550px;
  margin: 0 auto;
  background: white;
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.variables-box {
  position: relative;
  z-index: 10;
}

/* Mobile: stack verticalmente */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .card {
    max-width: 100%;
  }
  .variables-box {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-top: 1.5rem;
  }
}

/* Keep menu dropdowns above the variables panel on desktop only */
@media (min-width: 769px) {
  .menu .sub-menu,
  .menu .sub-menu .rest-submenu {
    position: absolute !important;
    z-index: 9999 !important;
  }
}

/* Migliora lo stile del dropdown variabili */
.dropdown-menu {
  font-size: 1rem;
  min-width: 220px;
  box-shadow: 0 4px 18px rgba(78,168,222,0.10);
  border-radius: 10px;
  padding: 8px 0;
}
.dropdown-item {
  padding: 8px 18px;
  font-size: 1rem;
  cursor: pointer;
}
.dropdown-item:hover {
  background: #f0fbff;
  color: #007bff;
}

/* Forza background bianco e testo scuro solo per l'editor JSON */
    #jsonEditor .CodeMirror {
      background: #fff !important;
      color: #222 !important;
    }
    #jsonEditor .CodeMirror-cursor {
      border-left: 1.5px solid #222 !important;
    }
    #jsonEditor .CodeMirror-gutters {
      background: #fff !important;
      border-right: 1px solid #eee;
    }

