/* ========================================
   NOWDII — MODAL DE CÓDIGO DIGITAL (B6)
   ======================================== */

.nw-codigo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: nwCodigoFade 0.18s ease-out;
}
@keyframes nwCodigoFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nw-codigo-modal {
  background: #131313;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  padding: 28px 20px 32px;
  position: relative;
  overflow-y: auto;
  animation: nwCodigoSlide 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes nwCodigoSlide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (min-width: 640px) {
  .nw-codigo-backdrop {
    align-items: center;
    padding: 20px;
  }
  .nw-codigo-modal {
    border-radius: 22px;
    max-height: 88vh;
    animation: nwCodigoPop 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes nwCodigoPop {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

.nw-codigo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}
.nw-codigo-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Panes */
.nw-codigo-pane {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  animation: nwCodigoPaneIn 0.24s ease-out;
}
@keyframes nwCodigoPaneIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nw-codigo-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 230, 0, 0.12);
  border: 1px solid rgba(255, 230, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe600;
  font-size: 26px;
  margin-bottom: 4px;
}

.nw-codigo-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #f0f0f0;
  margin: 0;
}

.nw-codigo-sub {
  font-size: 13px;
  color: #999;
  line-height: 1.5;
  max-width: 340px;
  margin: 0;
}

.nw-codigo-input-wrap {
  width: 100%;
  max-width: 320px;
  margin: 8px 0;
}
.nw-codigo-input {
  width: 100%;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 230, 0, 0.3);
  border-radius: 12px;
  color: #ffe600;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  outline: none;
  transition: all 0.2s;
  text-transform: uppercase;
}
.nw-codigo-input:focus {
  border-color: rgba(255, 230, 0, 0.6);
  background: rgba(255, 230, 0, 0.04);
}
.nw-codigo-input::placeholder {
  color: rgba(255, 230, 0, 0.3);
  letter-spacing: 2px;
}

.nw-codigo-submit {
  width: 100%;
  max-width: 320px;
  padding: 14px 20px;
  background: #ffe600;
  border: none;
  border-radius: 12px;
  color: #1a1a00;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.nw-codigo-submit:hover:not(:disabled) {
  background: #fff35c;
  transform: translateY(-1px);
}
.nw-codigo-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.nw-codigo-submit-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f0f0f0;
}
.nw-codigo-submit-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.nw-codigo-hint {
  font-size: 12px;
  color: #ff8797;
  padding: 10px 14px;
  background: rgba(255, 80, 100, 0.1);
  border: 1px solid rgba(255, 80, 100, 0.25);
  border-radius: 10px;
  line-height: 1.5;
  max-width: 320px;
}

/* Submitting */
.nw-codigo-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 230, 0, 0.1);
  border: 1px solid rgba(255, 230, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe600;
  font-size: 24px;
}
.nw-codigo-loading-text {
  font-size: 13px;
  color: #999;
  margin: 0;
}

/* Success */
.nw-codigo-success-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #1db954;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  animation: nwCodigoCheckPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes nwCodigoCheckPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.nw-codigo-comprobante-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin-top: 4px;
}
.nw-codigo-comprobante {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 30px;
  font-weight: 800;
  color: #ffe600;
  letter-spacing: 4px;
  padding: 12px 20px;
  background: rgba(255, 230, 0, 0.08);
  border: 1px solid rgba(255, 230, 0, 0.3);
  border-radius: 12px;
  min-width: 180px;
  text-align: center;
}
.nw-codigo-success-note {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
  max-width: 280px;
  margin: 4px 0 8px;
}

/* Error pane */
.nw-codigo-error-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 80, 100, 0.1);
  border: 1px solid rgba(255, 80, 100, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff8797;
  font-size: 26px;
}
