/* ==========================================================
   FILE: mint.css
   MODULO: creazione TOKEN / certificato digitale
   UTILIZZATO DA: mint.html
   ========================================================== */


/* ==========================================================
   LOGIN AREA MINT
   ========================================================== */

.mint-login-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: #111827;
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  border: 1px solid #1f2937;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: #f9fafb;
}

.login-card p {
  margin: 0 0 16px;
  color: #9ca3af;
  font-size: 0.95rem;
}

.mint-password-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  margin-bottom: 12px;
}

.mint-password-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.login-card .btn {
  width: 100%;
  justify-content: center;
}


/* ==========================================================
   MODELLO / TOKEN URI
   ========================================================== */

#mint-model {
  font-weight: 500;
}

.tokenuri-compact {
  height: 32px;
  min-height: 32px;
  max-height: 50px;
  resize: vertical;
  line-height: 1.4;
}

#mint-tokenuri {
  color: #2ee58f;
  font-weight: 800;
}

#mint-tokenuri::placeholder {
  color: rgba(255,255,255,.55);
  font-weight: 600;
}


/* ==========================================================
   AZIONI MINT
   Reset → JSON → CIDGATE → Mint → Invio → PDF
   ========================================================== */

.tri-actions-status {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.tri-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tri-badge {
  font-size: 12px;
  min-height: 16px;
  opacity: .95;
}

.tri-badge.ok {
  color: #2ee58f;
}

.tri-badge.error {
  color: #ff6b6b;
}

.tri-badge.info {
  color: #fbbf24;
}

.btn-ok {
  font-size: 12px;
  font-weight: 800;
  color: #2ee58f;
  min-height: 16px;
}

.btn-ok.error {
  color: #ff4d4d;
}

.button-row.tri-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
}


/* ==========================================================
   STATO SOTTO OGNI AZIONE
   ========================================================== */

.action-with-status {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-with-status + .action-with-status {
  margin-top: 10px;
}

.action-with-status .btn {
  width: 100%;
}


/* ==========================================================
   BADGE NUMERATI DEI PASSAGGI
   ========================================================== */

.btn-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 16px;
  height: 16px;
  margin-right: 1px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle at top,
      rgba(249,115,22,0.22),
      transparent
    ),
    var(--bg-soft);

  color: #ffffff;

  font-size: 10px;
  font-weight: 700;
  line-height: 1;

  vertical-align: middle;
  flex: 0 0 16px;

  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  border: 2px solid rgba(255,255,255,.7);
}


/* ==========================================================
   STATO MINT SERVER-SIDE
   ========================================================== */

#mint-status {
  margin-top: 10px;
  padding: 10px 12px;

  border-radius: 10px;

  font-size: 12px;
  line-height: 1.5;

  transition: all .25s ease;
}

#mint-status.mint-processing {
  color: #fbbf24;
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.35);
  font-weight: 700;
}

#mint-status.mint-success {
  color: #2ee58f;
  background: rgba(46,229,143,.08);
  border: 1px solid rgba(46,229,143,.35);
  font-weight: 700;
}

#mint-status.mint-error {
  color: #ff6b6b;
  background: rgba(255,107,107,.08);
  border: 1px solid rgba(255,107,107,.35);
  font-weight: 700;
}

#mint-status.mint-warning {
  color: #fbbf24;
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.35);
  font-weight: 700;
}

#mint-status a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}


/* ==========================================================
   SPINNER MINT
   ========================================================== */

.mint-spinner {
  display: inline-block;

  width: 15px;
  height: 15px;

  margin-right: 8px;
  vertical-align: -2px;

  border: 2px solid rgba(251,191,36,.30);
  border-top-color: #fbbf24;
  border-radius: 50%;

  animation: mint-spin .8s linear infinite;
}

@keyframes mint-spin {
  to {
    transform: rotate(360deg);
  }
}


/* ==========================================================
   MINT ACTIONS — MOBILE
   ========================================================== */

@media (max-width: 768px) {

  .button-row.tri-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    align-items: start;
  }

  /* Reset form */
  .button-row.tri-actions > .tri-action:nth-child(1) {
    grid-column: 1;
  }

  /* Genera JSON */
  .button-row.tri-actions > .tri-action:nth-child(2) {
    grid-column: 2;
  }

  /* Upload CIDGATE */
  .button-row.tri-actions > .tri-action:nth-child(3) {
    grid-column: 1 / -1;
  }

  /* Mint + Invio + PDF */
  .button-row.tri-actions > .tri-action:nth-child(4) {
    grid-column: 1 / -1;
  }

  .button-row.tri-actions .tri-action {
    width: 100%;
    min-width: 0;
  }

  .button-row.tri-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 42px;
  }

  .button-row.tri-actions .btn-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .button-row.tri-actions .tri-badge {
    width: 100%;
    min-height: 16px;
    text-align: center;
  }
}