/* ==========================================================
   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: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  align-items: start;
}

.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 .tri-badge {
  width: 100%;
  min-height: 16px;
  text-align: center;
}

.btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ==========================================================
   SEPARATORI WORKFLOW MINT
   ========================================================== */

/* Linea tra Reset form e 1 Genera JSON */
.button-row.tri-actions > .tri-action:nth-child(2) {
  position: relative;
  margin-top: 7px;
}

.button-row.tri-actions > .tri-action:nth-child(2)::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 5%;
  right: 5%;
  height: 1px;
  background: rgba(148, 163, 184, .28);
}

/* Linea tra 3 Mint TOKEN e 4 Invia TOKEN */
.button-row.tri-actions > .tri-action:nth-child(4)
.action-with-status:nth-child(2) {
  position: relative;
  margin-top: 7px;
}

.button-row.tri-actions > .tri-action:nth-child(4)
.action-with-status:nth-child(2)::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 5%;
  right: 5%;
  height: 1px;
  background: rgba(148, 163, 184, .28);
}

/* Linea tra 4 Invia TOKEN e Genera PDF */
.button-row.tri-actions > .tri-action:nth-child(4)
.action-with-status:nth-child(3) {
  position: relative;
  margin-top: 7px;
}

.button-row.tri-actions > .tri-action:nth-child(4)
.action-with-status:nth-child(3)::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 5%;
  right: 5%;
  height: 1px;
  background: rgba(148, 163, 184, .28);
}

/* ==========================================================
   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);
  }
}

@media (max-width: 768px) {

  .button-row.tri-actions {
    gap: 18px;
  }

  .action-with-status + .action-with-status {
    margin-top: 18px;
  }

}

.model-status-processing {
  color: #f59e0b;
  font-weight: 700;
}

.model-status-ok {
  color: #2ee58f;
  font-weight: 700;
}

.model-status-error {
  color: #ff6b6b;
  font-weight: 700;
}

/* =========================================================
   NAVIGAZIONE RAPIDA SCHEDE MINT
   ========================================================= */

.mint-section-nav{
  margin-top: 22px;

  display: grid;
  grid-template-columns: repeat(4, 150px);
  gap: 8px 10px;

  max-width: 610px;
}

.mint-nav-btn{
  min-height: 30px;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;

  padding: 4px 10px;

  border: 1px solid rgba(148,163,184,.32);
  border-radius: 999px;

  background:
    linear-gradient(
      180deg,
      rgba(15,23,42,.78),
      rgba(2,6,23,.78)
    );

  color: #94a3b8;
  font: inherit;
  cursor: pointer;

  transition:
    border-color .2s ease,
    background .2s ease,
    transform .2s ease,
    box-shadow .2s ease;
}

.mint-nav-btn:hover{
  border-color: rgba(249,115,22,.70);

  background:
    linear-gradient(
      180deg,
      rgba(30,41,59,.90),
      rgba(2,6,23,.90)
    );

  box-shadow:
    0 0 0 1px rgba(249,115,22,.06),
    0 8px 24px rgba(0,0,0,.22);

  transform: translateY(-1px);
}

.mint-nav-number{
  width: 20px;
  height: 20px;
  flex: 0 0 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: #f97316;
  color: #07111f;

  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.mint-nav-dot{
  color: #f97316;
  font-size: 12px;
  line-height: 1;
}

.mint-nav-label{
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* seconda riga: 3 pulsanti equilibrati */
.mint-nav-btn:nth-child(5){
  grid-column: 1;
}

.mint-nav-btn:nth-child(6){
  grid-column: 2;
}

.mint-nav-btn:nth-child(7){
  grid-column: 3;
}

.mint-nav-btn:nth-child(8){
  grid-column: 4;
}

/* mobile */
/* mobile */
@media (max-width: 800px){

  .mint-section-nav{
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }

  .mint-nav-btn:nth-child(5),
  .mint-nav-btn:nth-child(6),
  .mint-nav-btn:nth-child(7),
  .mint-nav-btn:nth-child(8){
    grid-column: auto;
  }
}

@media (max-width: 520px){

  .mint-section-nav{
    width: 100%;
    max-width: none;

    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 4px;

    margin-top: 24px;
  }

  .mint-nav-btn{
    width: 100%;
    min-height: 28px;

    padding: 2px 3px;
    gap: 5px;

    justify-content: flex-start;
  }

  .mint-nav-number{
    width: 24px;
    height: 24px;
    flex: 0 0 24px;

    font-size: 12px;
  }

  .mint-nav-dot{
    font-size: 12px;
  }

  .mint-nav-label{
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
  }

}
